mirror of
https://github.com/Microsoft/vscode
synced 2024-08-27 13:00:58 +00:00
[html] A 'return' statement can only be used within a function body. Fixes #143220
This commit is contained in:
parent
c7a685113b
commit
a0612b2e04
|
@ -87,7 +87,7 @@ export function getJavaScriptMode(documentRegions: LanguageModelCache<HTMLDocume
|
|||
const languageService = await host.getLanguageService(jsDocument);
|
||||
const syntaxDiagnostics: ts.Diagnostic[] = languageService.getSyntacticDiagnostics(jsDocument.uri);
|
||||
const semanticDiagnostics = languageService.getSemanticDiagnostics(jsDocument.uri);
|
||||
return syntaxDiagnostics.concat(semanticDiagnostics).map((diag: ts.Diagnostic): Diagnostic => {
|
||||
return syntaxDiagnostics.concat(semanticDiagnostics).filter(d => d.code !== 1108).map((diag: ts.Diagnostic): Diagnostic => {
|
||||
return {
|
||||
range: convertRange(jsDocument, diag),
|
||||
severity: DiagnosticSeverity.Error,
|
||||
|
|
|
@ -121,6 +121,8 @@ suite('HTML Embedded Support', () => {
|
|||
assertEmbeddedLanguageContent('<script type="text/javascript">var i = 0;</script>', 'javascript', ' var i = 0; ');
|
||||
|
||||
assertEmbeddedLanguageContent('<div onKeyUp="foo()" onkeydown="bar()"/>', 'javascript', ' foo(); bar(); ');
|
||||
assertEmbeddedLanguageContent('<div onKeyUp="return"/>', 'javascript', ' return; ');
|
||||
|
||||
});
|
||||
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue