neoclide / coc-tsserver

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

Add support for tsconfigPath setting #286

Closed nateroling closed 3 years ago

nateroling commented 3 years ago

This adds support for a new "tsconfigPath" setting for tsserver.

chemzqm commented 3 years ago

It's not "tsconfigPath" setting for tsserver, but only tsconfig path fro tsserver.watchBuild command, please add description in package.json.

nateroling commented 3 years ago

Good point, updated. Do you think the setting name should change too, or is tsconfigPath good?

ridgekuhn commented 2 years ago

I'm sorry to necropost, but how do I use this feature? Is the watchBuild command a separate thing than simply opening a typescript file with coc-tsserver installed? I've set tsconfigPath in my CoC local config and confirmed the config is getting parsed, but if I run :CocCommand tsserver.openTsServerLog after opening a typescript file, there's no mention of tsconfig.test.json, only tsconfig.json. I'm also not seeing this error message in the log. Am I missing something?

  "tsserver": {
    "enable": true,
    "log": "verbose",
    "tsconfigPath": "tsconfig.test.json"
  }
}
chemzqm commented 2 years ago

Is the watchBuild command a separate thing than simply opening a typescript file with coc-tsserver installed?

That command compile your typescript files by run tsc --watch command as a vim job. It is separated from tsserver.

ridgekuhn commented 2 years ago

@ chemzqm Thanks for your response! So there is currently no way to use a custom tsconfig path for normal vim editing then?

chemzqm commented 2 years ago

Configuration "tsserver.tsconfigPath": "tsconfig.test.json" should works.

ridgekuhn commented 2 years ago

@chemzqm Unfortunately I can't seem to get it to work whether it's in the local project's CoC config or the global CoC config. I will keep trying to troubleshoot and open an issue if I can't find anything wrong. Thanks so much for your time and help!