-
Notifications
You must be signed in to change notification settings - Fork 3.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to scope intillisense down to just passed in .d.ts
defs.
#1001
Comments
You can pass 'nolib' option to setcompileroption. |
Thanks @yln99517 - that's great. Setting As a follow-on question, how would I go about dealing with this "No Promise" error: I'm setting const typescript = monaco.languages.typescript;
typescript.typescriptDefaults.setCompilerOptions({
noLib: true,
lib: ['ESNext', 'ES2015'],
target: typescript.ScriptTarget.ESNext,
allowNonTsExtensions: true,
}); This has the same effect to (dropping the const typescript = monaco.languages.typescript;
typescript.typescriptDefaults.setCompilerOptions({
lib: ['ESNext', 'ES2015'],
target: typescript.ScriptTarget.ESNext,
allowNonTsExtensions: true,
}); Any ideas? Thanks! |
You need to extract required libs from default libs then pass to addExtraLib. It solves the problem. |
Thanks @yln99517. Where do I find the "default libs" to extract from? |
I wonder if you might be able to give me a brief code sample to get me going in the right direction please @yln99517 ? |
Hi , |
@yln99517 - sweet! That's perfect, thanks! |
I’m looking at the configuration options for the VSCode MonacoEditor related to specifying intellisense via
.d.ts
definitions:Playground: Configure JS Defaults Example
I’m wondering if there is a way to scope intillisense down to just the types passed in via
addExtraLib
- at the moment the kitchen sink of ES6 is available in the dropdown lists, including all of HTML5 for the browser etc etc.For my purposes, I’m having the editor run in a tightly constrained environment so most of the API surface area represented in these dropdowns in not relevant.
The
target
field ofsetCompilerOptions
seems likely, but in playing around with that it doesn’t seem to have any effect on reducing scope, eg all of these options don't narrow scope at all:ref Playground
Any ideas? It feels like this must be somewhere else in the API, yeah?
Thanks 🌵
The text was updated successfully, but these errors were encountered: