coc-tsserver
coc-tsserver copied to clipboard
New File not automatically picked up.
Curious if I'm missing a setting or a configuration detail.
coc-tsserver works great for the most part, but when I create a new file I run into two issues: (1) auto import doesn't pick it up and (2) manually importing results in a tsserver error 6307 (the file I'm importing is not listed within the file list of my project, telling me to include it via an include pattern in my tsconfig).
The file definitely is included though, a CocRestart will resolve this issue. However, CocRestart for this project takes a good 10 seconds since it's reasonably large. Totally fine for a startup but really painful everytime I'm creating a lot of files or refactoring.
Is this something that's just expected from tsserver or am I messing something up?
File creation are observed by tsserver, there is tsserver.watchOptions
option might helps.
You are correct. It seems that the correct fix is to properly specify glob patterns in the tsconfig for tsserver to pick up:
"include": ["./src/**/*", "next-env.d.ts"],
I originally had:
"include": ["./src", "next-env.d.ts"],
which compiles fine but creates problems for tsserver it seems.
Some features of tsserver only work with saved files, checkout https://github.com/neoclide/coc-tsserver/blob/master/Readme.md#troubleshooting if you still have issue with that.