in htmlhint-server/src/server.ts [219:245]
function doValidate(connection: server.IConnection, document: server.TextDocument): void {
try {
let uri = document.uri;
let fsPath = server.Files.uriToFilePath(uri);
let contents = document.getText();
let lines = contents.split('\n');
let config = getConfiguration(fsPath);
let errors: htmlhint.Error[] = linter.verify(contents, config);
let diagnostics: server.Diagnostic[] = [];
if (errors.length > 0) {
errors.forEach(each => {
diagnostics.push(makeDiagnostic(each, lines));
});
}
connection.sendDiagnostics({ uri, diagnostics });
} catch (err) {
let message: string = null;
if (typeof err.message === 'string' || err.message instanceof String) {
message = <string>err.message;
throw new Error(message);
}
throw err;
}
}