mirror of
https://github.com/Microsoft/vscode
synced 2024-08-27 21:09:43 +00:00
Enable Semantics Diagnostics for Inline JS (#25850)
Fixes #25809 **Bug** Inline js in html currently only reports semantic errors. This means that `// @ts-check` does not work to help catch programming errors **Fix** Also report semantic errors in script tags
This commit is contained in:
parent
242cb936f0
commit
9b0141aaec
|
@ -71,8 +71,9 @@ export function getJavascriptMode(documentRegions: LanguageModelCache<HTMLDocume
|
|||
},
|
||||
doValidation(document: TextDocument): Diagnostic[] {
|
||||
updateCurrentTextDocument(document);
|
||||
const diagnostics = jsLanguageService.getSyntacticDiagnostics(FILE_NAME);
|
||||
return diagnostics.map((diag): Diagnostic => {
|
||||
const syntaxDiagnostics = jsLanguageService.getSyntacticDiagnostics(FILE_NAME);
|
||||
const semanticDiagnostics = jsLanguageService.getSemanticDiagnostics(FILE_NAME);
|
||||
return syntaxDiagnostics.concat(semanticDiagnostics).map((diag): Diagnostic => {
|
||||
return {
|
||||
range: convertRange(currentTextDocument, diag),
|
||||
severity: DiagnosticSeverity.Error,
|
||||
|
|
Loading…
Reference in a new issue