sourcegraph / javascript-typescript-langserver

JavaScript and TypeScript code intelligence through the Language Server Protocol
https://sourcegraph.com
Apache License 2.0
793 stars 72 forks source link

Support leading slash imports using "paths" in tsconfig.json #680

Open javoire opened 4 years ago

javoire commented 4 years ago

Hello,

It seems this language server does not support the import style of

import Hello from '/folder/hello';

using the tsconfig.json setting:

// ...
    "paths": {
      /* Support absolute /imports/* with a leading '/' */
      "/*": ["*"]
    },
// ...

Test case: https://github.com/javoire/sourcegraph-javascript-typescript-langserver-testcase

VSCode supports it (which I believe uses tsserver, and https://github.com/theia-ide/typescript-language-server supports it.

Here's an example result from me using Neovim and https://github.com/autozimu/LanguageClient-neovim:

Annotation 2020-05-09 230733

Cheers