nwolverson / purescript-language-server

MIT License
184 stars 41 forks source link

Symlinks confuse purescript-language-server #153

Closed arrowd closed 2 years ago

arrowd commented 2 years ago

On FreeBSD the /home directory is a symlink to /usr/home. I have a test project in /home/arr/aaa directory. Running a text editor with LSP yields

Found existing IDE server on port '15100' with wrong path: '/usr/home/arr' instead of '/home/arr'. Correct, kill or configure a different port, and restart.

Another subtle error is

Output directory does not exist at '/home/arr/output'

Am I doing something wrong, or this is an upstream bug?

nwolverson commented 2 years ago

On FreeBSD the /home directory is a symlink to /usr/home.

Ugh.

Certainly looks like we have a different idea what the cwd is.

Output directory does not exist at '/home/arr/output'

Well that is odd, this should be /home/arr/aaa/output or /usr/home/arr/aaa/output right? Actually the other message also suggests your editor/LSP client is misconfigured, the root directory should be your test project, while it seems to be your home directory. See the README for some examples how to configure various editors/lsp plugins.

arrowd commented 2 years ago

Ah, it is editor's responsibility to set the CWD. I missed rootIndicationFiles for my editor. Setting it fixed the issue.

Sorry for the noise.

nwolverson commented 2 years ago

Do you not still have a symlink issue? I could believe that if something is normalising symlinks somehow and something else isn't there could be an issue - in particular if this language server & purs ide server have different opinions on the matter

arrowd commented 2 years ago

Nope, no symlink warnings now. Everything's work great.