Skip to content
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

Compiler option "noLib" for autocompletion without breaking inference #1673

Closed
IamFonky opened this issue Nov 13, 2019 · 2 comments
Closed

Comments

@IamFonky
Copy link

monaco-editor version:0.18.1
Browser:chrome/firefox/ie
OS:windows/linux

Hello!

I'm using monaco-editor with the typescript language, i wanted to add my own definitions and avoid standard es lib proposal in autocompletion.

So i used the compiler option noLib. Everything worked well until i tried to add a more complex function that need to infer type from and argument and force another argument to use inferred type.

plz see this stack overflow question

I filed this issue because I don't know if it's a bug, a potential feature or even me that didn't read the docs well enough to make the editor do what i want.

@IamFonky IamFonky changed the title Compiler option "noLib" only for autocompletion Compiler option "noLib" for autocompletion without breaking intellisense Nov 13, 2019
@IamFonky IamFonky changed the title Compiler option "noLib" for autocompletion without breaking intellisense Compiler option "noLib" for autocompletion without breaking inference Nov 18, 2019
@blutorange
Copy link
Contributor

There's a workaround I just discovered for replacing the default lib by adding an extra lib with a specific name, see the answer on stackoverflow for more info:

monaco.languages.typescript.typescriptDefaults.addExtraLib(
  YOUR_CUSTOM_LIBRARY,
  "defaultLib:lib.es6.d.ts"
)

@IamFonky
Copy link
Author

Thank you so much. You just gave me exactly what i needed!

@vscodebot vscodebot bot locked and limited conversation to collaborators Jan 6, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants