diff --git a/lsp-sample/server/src/server.ts b/lsp-sample/server/src/server.ts index 2f5ea60d..08c243b0 100644 --- a/lsp-sample/server/src/server.ts +++ b/lsp-sample/server/src/server.ts @@ -134,7 +134,7 @@ async function validateTextDocument(textDocument: TextDocument): Promise { 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 { 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.