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

How to achieve intellisense with libraries defined in import maps? #2552

Open
zachsa opened this issue Nov 15, 2023 · 4 comments
Open

How to achieve intellisense with libraries defined in import maps? #2552

zachsa opened this issue Nov 15, 2023 · 4 comments

Comments

@zachsa
Copy link
Contributor

zachsa commented Nov 15, 2023

Currently I have an importmap with, say, @mui/material specified along with all indirect deps, etc. This is quite a nice development environment - I can write React directly in a .html file (using my esm-x library). However I only get intellisense if I install libraries into node_modules (at least I assume that's where types how how it works).

So I still have to have a node-based development environment, and work with libraries via package.json. Is there any way around this?

Maybe jspm install downloaded type def files (if they are available) to some VS Code specific cache that VS Code would check if node_modules didn't exist?

Is there a standard way for pointing to type definitions in package.json?

@zachsa
Copy link
Contributor Author

zachsa commented Nov 16, 2023

What about a VS Code JSPM plugin that lazily tried to load type defs of imports based on the "types" field in package.json? Then I could get autocomplete for @mui/material just by having an importmap that referenced @mui/material

@JayaKrishnaNamburu
Copy link
Member

Dropping this here, but there is a plugin for monaco for something similar. Not sure if there is a vs-code wrapper for the same 🤔
https://github.com/lukasbach/monaco-editor-auto-typings

@zachsa
Copy link
Contributor Author

zachsa commented Nov 16, 2023

Thanks @JayaKrishnaNamburu. Is that something I could look to using right away?

@JayaKrishnaNamburu
Copy link
Member

I couldn't find any vs-code plugin that built a wrapper around this monaco plugin yet 😅. So no t yet, will keep looking if i come across something with vscode 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants