-
Hey there, i have a question regarding the diagnostics: In my application i set up some some language defaults like this:
Earlier, when i used the plain monaco-api i got red underlines when i wrote something undefined, for example like this (the setting up of my own *.d.ts-files works flawlessly): How can i achieve this with the monaco-vscode-api, too? Do i have to install a LSP for javascript (as described in the Wiki for python)? In the demo there is an error explicitly marked for this:
in the main.common.ts, but if i write Thank you very much. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 4 replies
-
There is 2 way to provide javascript/typescript intellisense When you were using the plain monaco-editor, you were using the monaco-worker It can be used with monaco-vscode-api by installing and importing |
Beta Was this translation helpful? Give feedback.
I found my mistake. Previously i set up the settings for typescript not for javascript. After changing that everything works fine:
private setTypescriptValidationOptions() { const javascriptDefaults = languages.typescript.javascriptDefaults; javascriptDefaults.setDiagnosticsOptions({ noSemanticValidation: false, noSyntaxValidation: false, }); const tsOp = javascriptDefaults.getCompilerOptions(); tsOp.allowJs = true; tsOp.checkJs = true; tsOp.target = languages.typescript.ScriptTarget.ES2020; tsOp.lib = ["ES6"]; tsOp.isolatedModules = true; javascriptDefaults.setCompilerOptions(tsOp); }