-
Notifications
You must be signed in to change notification settings - Fork 31
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
TypeScript Intellisense Not Working Across Files #360
Comments
Hi, The VSCode typescript language features extension only provides per-file intellisense by default. To provide the project-wide intellisense in the browser, it needs shared array buffers which are only available if crossOriginIsolated is true. It doesn't work in the online demo of this project but it does work if you pull it locally because we configure the vite server to add some headers You'll also need to serve the main page html, the ext host iframe html (webWorkerExtensionHostIframe.html) and the ext host worker (extensionHost.worker.js) with those headers I'll add a troubleshooting section 👍 |
Thanks a lot, this was very helpful. Adding the headers fixed the intellisense across files issue for me and the node_modules work out of the box now - except for a few issues. btw, do you know why |
The npm default extensions calls registry.npmjs.org to get some metadata about packages that are used in the project, are you using it? you can disable this behavior by setting |
I don't have the npm extensions installed. I tried to install it and set |
Then I'm not able to reproduce nor seeing any code from this repo referencing registry.npmjs.org Can you provide a simple reproduction repo? |
Sorry for late reply, I forked this repo and added code to reproduce here https:/Abdallatif/monaco-vscode-api When you open the index.ts file, you can see in the network tab it's trying to download the npm packages I found that if I delete the node_modules folder, vscode would no longer try to download the packages! |
I also found that TS was ignoring the They are working on it: microsoft/vscode#182791 But it is not complete and only has ATA (Automatic Type Acquisition) support. It automatically detects the required types and downloads them from npm. I recently found a library called |
It looks like it's not an issue with this library but with the VSCode typescript extension then, right? |
Yes, that's right, VSCode did not complete this feature in the web version of the extension. (You must disable ATA so that types are not downloaded automatically: https:/cemalgnlts/jside/blob/main/src/workspace/userConfiguration.json#L38) |
@cemalgnlts Yeah, and I tried to do that but the extension fetches the types anyway! |
Sometimes (maybe because of the way I use it) when I delete IndexedDB and refresh the page, the configuration file starts working correctly. |
I was able to disable this behavior by commenting out this subscription https:/microsoft/vscode/blob/main/extensions/typescript-language-features/src/extension.browser.ts#L108 Do you think this is something that should be patched in this package? I understand if it's not and I can publish my changes under a different package. |
Probably not. It's not a bug but a feature you don't want |
For future reference, it seems that typescript extension always override the node_modules uri here and try to always load it from a different schema. This schema is being listened to by a different service AutoInstallerFs which doesn't respect and totally ignores the existing node_modules folder and always try to download the package from the internet. This seems like a bug in vscode web to me. Since this means we can't run vscode in offline mode or have custom node_modules. |
I discovered that you can force it to read using Screen.recording.2024-03-14.12.28.56.webm |
This issue is stale because it has been open for 30 days with no activity. |
This issue was closed because it has been inactive for 14 days since being marked as stale. |
Hi! I've been trying to get TypeScript Intellisense to work with multiple files using the demo, but it's not happening. I added a tsconfig file thinking it might help, but no luck there either.
My main goal is to export a function from one file and have VSCode suggest to auto-import it. After that, I want to make sure VSCode can see the node_modules I install and check types correctly.
I saw this project called jside that seems to have everything working, including TypeScript Intellisense. They're doing something different with how files are set up, I think, but I can't figure out exactly what makes it work there and not in my case - demo project.
Any ideas on what I might be missing or doing wrong?
The text was updated successfully, but these errors were encountered: