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:
- LazyNvim and Astro distros;
- My own configuration based on lazy.nvim;
- Disabled every plugin except for
lsp-config
andmason
; - Tried pure nvim config with Packer and only
lsp-config
; - Tried two different LSP's:
tsserver
andvtsls
;
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:
- MacBook Pro M1 Max
- macOS Sonoma
- nvim 0.9.2
Let me know if I can bring any more information to debug it.
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.