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

Support for `"imports"` and `"exports"` fields in package.json #354

Closed MuhammadSawalhy closed 2 years ago

MuhammadSawalhy commented 2 years ago

I am using the "exports" field in package.json with self-referencing import the files. But coc-definition and coc-reference doesn't work with theme new fields.

Note: I was using jsconfig.json file to define my paths but switched to the new field because of FOMO... This was of defining alias or path was working with some tweak for webpack, babeljs, eslint. I thought they will work well with the new standard fields.

  "name": "-",
  "exports": {
    "./*": "./src/*"
  }
import whatEver from "-/some-file/in/src"; 
chemzqm commented 2 years ago

You need to configure jsconfig.json or tsconfig.json https://code.visualstudio.com/docs/languages/jsconfig

MuhammadSawalhy commented 2 years ago

You need to configure jsconfig.json or tsconfig.json https://code.visualstudio.com/docs/languages/jsconfig

So we should use the VSCode's opinion of defining aliases and ignore the more standard way of defining path aliases?!!! Note that other code editors such as atom or IntelliJ have other opinions of doing this. See "Editors autocompletion" in babel-plugin-module-resolver.

I know that

This extension is a fork of typescript-language-features extension which is bundled with VSCode.

MuhammadSawalhy commented 2 years ago

This is a feature request 👈

chemzqm commented 2 years ago

That should be done by tsserver, send your feature request to typescript team, or you can create plugin for tsserver.

MuhammadSawalhy commented 2 years ago

or you can create plugin for tsserver

And I will call it Yatss which stands for "yet another tsserver" 😂

That should be done by tsserver, send your feature request to typescript team

Thank you! I will do that insha'Allah...