psalm icon indicating copy to clipboard operation
psalm copied to clipboard

Multiple psalm-language-server instances out of sync (due to shared cache?)

Open sebcode opened this issue 3 years ago • 2 comments

I'm using psalm-language-server with neovim's lsp integration which works great as long as I'm not launching multiple neovim instances for the same project root. If I do launch multiple instances, the results get out of sync, for example:

screenshot_2022-07-07-122205

$ ps aux|grep Psalm
seb      1820767  0.3  0.1 171884 104856 pts/6   S+   12:19   0:00 Psalm 4.24.0@06dd975cb55d36af80f242561738f16c5f58264f - PHP Language Server
seb      1821161  0.3  0.1 171888 105072 pts/7   S+   12:19   0:00 Psalm 4.24.0@06dd975cb55d36af80f242561738f16c5f58264f - PHP Language Server

This doesn't happen with other lsp servers like intelephense or tsserver.

I believe that happens because both pslam instances are using the same cache.

My workaround is this wrapper script which uses a new cache directory for each pslam instance. Not ideal but it solves my problem:

export XDG_CACHE_HOME=$HOME/.cache/psalm/$$
/opt/vendor/psalm/vendor/bin/psalm-language-server $*

($$ resolves to the current pid of the script instance)

sebcode avatar Jul 07 '22 10:07 sebcode

Hey @sebcode, can you reproduce the issue on https://psalm.dev ?

psalm-github-bot[bot] avatar Jul 07 '22 10:07 psalm-github-bot[bot]

Hi! Are there any updates?

jombert-a avatar Sep 07 '24 21:09 jombert-a