typescript-go icon indicating copy to clipboard operation
typescript-go copied to clipboard

tsgo preview: import suggestions are not aware of paths

Open jpike88 opened this issue 3 months ago • 7 comments

With vtsls in zed: Image

But using tsgo: Image

I'm unsure whether this is something the zed extension should be handling or not... but I'm unable to work with tsgo until this is ready.

jpike88 avatar Sep 11 '25 04:09 jpike88

What is your tsconfig? Do you have a repo to test?

jakebailey avatar Sep 11 '25 04:09 jakebailey

Actually I think it just might be configuration thing that tsgo doesn't support yet.

Is there plans to support importModuleSpecifier: 'non-relative'?

jpike88 avatar Sep 11 '25 04:09 jpike88

Yes, we just don't have any user prefs implemented yet.

jakebailey avatar Sep 11 '25 21:09 jakebailey

Also been running into I think the same issue:

Cannot find module '@pubsub/events' or its corresponding type declarations.ts(2307)

In my tsconfig.json I have this:

"compilerOptions": {
  "paths": {
    "@pubsub/*": ["pubSub/client/*"],
    // ... other path aliases
  }
}

Sounds like this might just not be supported yet? Adding a comment just to track this so I can try the preview again when supported is added, thanks for your work on this, it's exciting!

robertbenjamin avatar Oct 10 '25 12:10 robertbenjamin

That is unrelated; please file a new issue with a repro.

jakebailey avatar Oct 10 '25 14:10 jakebailey

What's the priority on user preferences for the LSP?

marioparaschiv avatar Dec 12 '25 18:12 marioparaschiv

Priority? We want to fix them; I would have expected this to start working as of #1793.

If not, we need a repro.

jakebailey avatar Dec 12 '25 18:12 jakebailey

I can also repro after the latest changes in #1793 and extension version 0.20251214.1

Made a repro project https://github.com/longzheng/typescript-go-import-path-repro

Expecting import from @/export instead of ./export

Image
    "compilerOptions": {
        "paths": {
            "@/*": ["./src/*"]
        }
    }
{
  "typescript.preferences.importModuleSpecifier": "non-relative",
  "typescript.experimental.useTsgo": true
}

longzheng avatar Dec 14 '25 22:12 longzheng