neoclide / coc-tsserver

Tsserver extension for coc.nvim that provide rich features like VSCode for javascript & typescript
MIT License
1.05k stars 68 forks source link

jsconfig compiler options paths ignored #359

Open abidibo opened 2 years ago

abidibo commented 2 years ago

Hi, in my new nvim configuration, with all coc plugins updated I noticed that auto import and coc-definition command do not follow the paths rules defined in jsconfig:

Example of jsconfig:

{
  "compilerOptions": {
    "module": "commonjs",
    "target": "es6",
    "baseUrl": "./src",
    "paths": {
      "@Common/*": ["./Common/*"],
      "@Core/*": ["./Core/*"],
      "@Config": ["./Config/index.js"],
      "@Config/*": ["./Config/*"],
      "@Auth/*": ["./Auth/*"],
    }
  },
  "exclude": ["dist"]
}

When auto-importing a module, the relative path (i.e. ../../Common/Components/Foo) is used instead of the mapped one (@Common/Components/Foo).

At the same time nvim can't follow the definition of such imports.

All these stuff was working well with the same code base with an older nvim installation.

Any idea?

chemzqm commented 2 years ago

Should be issue with your tsserver https://github.com/neoclide/coc-tsserver/blob/master/Readme.md#troubleshooting