coc-tsserver icon indicating copy to clipboard operation
coc-tsserver copied to clipboard

New File not automatically picked up.

Open impguard opened this issue 2 years ago • 1 comments

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?

impguard avatar Aug 21 '22 18:08 impguard

File creation are observed by tsserver, there is tsserver.watchOptions option might helps.

chemzqm avatar Aug 31 '22 04:08 chemzqm

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.

impguard avatar Oct 23 '22 21:10 impguard

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.

chemzqm avatar Nov 22 '22 20:11 chemzqm