typescriptneovimneovim-pluginnvim-lspconfigtsserver

Nvim TypeScript LSP is getting restarted constantly


This is an issue I've been facing for about a month already. My TS LSP is getting constantly reloaded for certain projects and I can't find a fix for it. I'm constantly getting an Initializing JS/TS language features....

According to the log this happens due to some kind of updates to the tscofnig.json file, but there's nothing that updates it, I don't see any writes to the file or anything.

What I already tried:

On the other hand VSCode doesn't seem to have this issue in those projects that are causing problems in nvim.

The only thing I found is that this happens for projects with TS 4.9 and above, no issues with TS 4.2 and below. Although, I haven't found any relevant information about incompatibility between tsserver/vtsls and latest versions of TypeScript.

Here's the log message after which the project is getting reloaded:

Info 1525 [16:30:00.888] event:
    {"seq":0,"type":"event","event":"projectLoadingStart","body":{"projectName":"[path-to-project]/tsconfig.json","reason":"Change in config file detected"}}

System:

Let me know if I can bring any more information to debug it.


Solution

  • It turned out to be git related for some reason. I haven’t figured it out completely, but whenever I commit changes to tsconfig.json the problem disappears and LSP works just fine. I can live with that for now and gonna accept this answer until (if ever) somebody post a real solution.