neoclide / coc-tsserver

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

tsserver stopped working after any package install #452

Closed ronitkrshah closed 3 months ago

ronitkrshah commented 5 months ago

Issue

(In React Native)

In the middle of coding if I add any package (npm/yarn) tsserver stops working. But in COC Status it shows that the server is active.
I have to run :CocRestart. After that it works

NVIM : Latest(Stable) OS: Arch Linux Kernel : LTS Release Terminal: alacritty

How I Work

tmux with 3-4 windows

1 - Main Code 2 - Development Server yarn run android 3 - scrcpy for screen mirroring.

I use coc-prettier & coc-tsserver during development.

I can provide logs but please send me the command to get logs

fannheyward commented 5 months ago

Similar issue https://github.com/neoclide/coc-tsserver/issues/431.

Try this: install https://facebook.github.io/watchman/ and make sure watchman started after you open your project, coc.nvim will use watchman to watch files changes and notify language server, maybe this can help.

ronitkrshah commented 5 months ago

Watchman is installed on my PC, but I'm unsure if it's actively monitoring my project. Additionally, I couldn't find a .watchmanconfig file in the project root. How can I confirm if it's working correctly?

fannheyward commented 5 months ago

How can I confirm if it's working correctly?

After you open your project in vim, check :CocCommand workspace.showOutput watchman.

ronitkrshah commented 5 months ago
[Info  - 11:59:37 PM] watchman watching project: /home/rks/Projects/TicTacToe
[Info  - 11:59:37 PM] subscribing "**/package.json" in /home/rks/Projects/TicTacToe
[Info  - 11:59:37 PM] subscribing "**/{.prettierrc,.prettierrc.json,.prettierrc.json5,.prettierrc.yaml,.prettierrc.yml,.prettierrc.toml,.prettierrc.js,.prettierrc.cjs,package.json,prettier.config.js,prettier.config.cjs,.editorconfig}" in /home/rks/Projects/TicTacToe
[Info  - 11:59:37 PM] subscribing "**/[tj]sconfig.json" in /home/rks/Projects/TicTacToe
[Info  - 11:59:37 PM] subscribing "**/package.json" in /home/rks/Projects/TicTacToe
[Info  - 11:59:37 PM] subscribing "**/*.{ts,tsx,mts,cts,js,jsx,mjs,cjs}" in /home/rks/Projects/TicTacToe

After running that command i got this output. Seems like watchman is watching but still the issue exists

ronitkrshah commented 4 months ago

@fannheyward I just uninstalled watchman ....and all my issues are solved dunno why

chaozwn commented 3 months ago

add .watchman.json in your project root. so this issue can close now.

{
  "ignore_dirs": [
    "dist",
    "node_modules"
  ]
}

link: https://github.com/neoclide/coc.nvim/wiki/Install-coc.nvim#install-watchman-for-file-watching