mirror of
https://github.com/microsoft/vscode-extension-samples.git
synced 2026-04-27 16:55:44 +08:00
Merge pull request #154 from pmcelhaney/typo-diagnosic
typo: "diagnosic" should be "diagnostic"
This commit is contained in:
@ -134,7 +134,7 @@ async function validateTextDocument(textDocument: TextDocument): Promise<void> {
|
||||
let diagnostics: Diagnostic[] = [];
|
||||
while ((m = pattern.exec(text)) && problems < settings.maxNumberOfProblems) {
|
||||
problems++;
|
||||
let diagnosic: Diagnostic = {
|
||||
let diagnostic: Diagnostic = {
|
||||
severity: DiagnosticSeverity.Warning,
|
||||
range: {
|
||||
start: textDocument.positionAt(m.index),
|
||||
@ -144,24 +144,24 @@ async function validateTextDocument(textDocument: TextDocument): Promise<void> {
|
||||
source: 'ex'
|
||||
};
|
||||
if (hasDiagnosticRelatedInformationCapability) {
|
||||
diagnosic.relatedInformation = [
|
||||
diagnostic.relatedInformation = [
|
||||
{
|
||||
location: {
|
||||
uri: textDocument.uri,
|
||||
range: Object.assign({}, diagnosic.range)
|
||||
range: Object.assign({}, diagnostic.range)
|
||||
},
|
||||
message: 'Spelling matters'
|
||||
},
|
||||
{
|
||||
location: {
|
||||
uri: textDocument.uri,
|
||||
range: Object.assign({}, diagnosic.range)
|
||||
range: Object.assign({}, diagnostic.range)
|
||||
},
|
||||
message: 'Particularly for names'
|
||||
}
|
||||
];
|
||||
}
|
||||
diagnostics.push(diagnosic);
|
||||
diagnostics.push(diagnostic);
|
||||
}
|
||||
|
||||
// Send the computed diagnostics to VSCode.
|
||||
|
||||
Reference in New Issue
Block a user