LSP doesn't offer auto-importing packages
Extension Version
0.20251203.1
VS Code Version
1.107.0-insider
Operating system Version
MacOS 26.1
Steps to reproduce
- Create an empty TypeScript project
- Install
typescript-result - Create index.ts
- Type
Resultand nothing happens
Issue
I noticed somewhere that auto-imports are mostly done, but in my work project, it doesn't auto-import most of the packages that I have installed. It usually auto-imports built-in dependencies such as node:crypto or global types, but not installed deps.
Seems not to be an issue with pnpm, catalog dependencies, etc. It happens with npm as well.
I'm really sorry if this is a current limitation and has been mentioned somewhere, and I didn't notice.
I think I'm experiencing the same thing. I seem to get auto-import suggestions when typing for functions inside the codebase, but external packages aren't coming up (i.e. react's useState).
One other thing: quick fix doesn't seem to be identifying that something needs to be imported, or at least the eslint rules complaining about the resulting code not being safe (because there's no useState import) seems to be winning. When I flip back to the non-experimental server the quick fix suggestion correctly identifies that I need to import useState. I'm noticing this also happens for internal imports: while typing an un-imported function that exists in another file I'll get good suggestions, but if I don't pick one and try to use quick-fix it won't suggest that import anymore.
Just trying to throw in more data to this issue. Right now this is happening in my work repo, but if I need to make a reproduction I'm happy to.
Extension version: 0.20251013.2
Cursor Version: 1.7.33 (Universal)
VSCode Version: 1.99.3
Not a monorepo
Using pnpm
Wow! https://github.com/microsoft/typescript-go/pull/1902 Basically fixed almost all of the issues I had so far with tsgo. Autocomplete works (at least from my short time testing), and The inferred type of xxx cannot be named is fixed.
I have noticed that the autocomplete is really slow in a medium-sized project. This is my structure
apps/
- web
- something
packages/
- package1
- package2
- ...
If I work in a packageX, it's literally lightning fast. However, if I work in apps/web, it's much slower than with the original TypeScript implementation. @andrewbranch, any idea why?
In the first half of the video, I'm typing SerializeFrom with Typescript Native enabled. In the second half, I turn it off, wait for LSP to start and do it again. The autocomplete is much faster.
https://github.com/user-attachments/assets/48ae35f5-7a24-47ef-adf1-1a07e45af6fc
I'm completely redesigning the auto-import backend right now, so not going to investigate any issues with the current implementation. (The current implementation is a pure port of the TS version, but with literally no caching, because we knew we would eventually redesign it to play nicely with parallelism and snapshots.) The performance should be very good in the new version, and hopefully I'll have something to share soon.
I am looking for codebases to test the new implementation out on, especially monorepos. Is your project open source?
so not going to investigate any issues with the current implementation
Completely understandable
I am looking for codebases to test the new implementation out on, especially monorepos. Is your project open source?
Sadly, no, this is a closed-source project.
We are seeing a bit of slowness with import suggestions right now too. We have a pnpm monorepo which is closed source but we can give access privately if volunteers are needed!
@kieranm that would be great! If you need an email for me, you can use my first name dot last name @microsoft.com.
I'm experiencing the same issues. Monorepo + PNPM and unfortunately it is a private codebase.
When I click Ctrl + Space, I have the import right there available, but then nothing happens. If I restart the IDE, it starts working, but after a while it gets in the same state.
Same problem. You can check with this monorepo https://github.com/dalisoft/airlight