private parseDiagnostics()

in src/commandObserver.ts [79:109]


	private parseDiagnostics(output: string)
	{
		let match;
		while ((match = msbuildOutputRegex.exec(output)) !== null) {
			var file = match.groups.origin.trim();
			const lineMatch = lineRegex.exec(file);
			let lineDetails;
			if (lineMatch) {
				file = lineMatch['groups'].origin;
				lineDetails = lineMatch['groups'].linedetails;
			}
			let diag: vscode.Diagnostic = {
				code: match.groups.code,
				message: match.groups.text,
				range: this.getRange(lineDetails),
				severity: match.groups.category && match.groups.category === 'error' ?  vscode.DiagnosticSeverity.Error : vscode.DiagnosticSeverity.Warning,
			};

			if (this._diagnosticMap.has(file)) {
				let diagArray = this._diagnosticMap.get(file);
				var index = diagArray.findIndex(d => d.message === match.groups.text);
				if (index < 0) {
					diagArray.push(diag);
				}
			} else {
				this._diagnosticMap.set(file, [diag]);
			}
		}

		msbuildOutputRegex.lastIndex = 0;
	}