Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to debug LSP start failure #2553

Open
edaqa-uncountable opened this issue Nov 11, 2024 · 6 comments
Open

Unable to debug LSP start failure #2553

edaqa-uncountable opened this issue Nov 11, 2024 · 6 comments

Comments

@edaqa-uncountable
Copy link

Describe the bug

LSP-biome is unable to find Node and there doesn't appear to be any way to debug this.

This used to work on my machine and I have no idea what changed (I recently got a new Sublime license and upgraded, so maybe there are new versions involved).

My biggest problem is that I have no idea how to proceed further with debugging. There's no output other than this modal, which isn't reporting the correct information. As you can see below I have my path setup (as documented) and node is available there.

Screenshots

image

image

image

Logs

The LSP-Log Panel output does not contain any message about biome.

Environment (please complete the following information):

  • OS: Ubuntu 22.04
  • Sublime Text version: 4180
  • LSP version: 2.2.0, (lsp-biome: 1.51)
  • Language servers used: biome, ruff, typescript

Additional context

I'm launching Sublime from the launcher. Node is installed on the specific project and cannot be referenced globally (that is, I can't update my global path).

@edaqa-uncountable
Copy link
Author

My workaround is to let Sublime LSP install Node. I don't like this approach since then I have different versions of node than what my CLI tools on this machine will use (For example when running biome during git checkin)

@rchl
Copy link
Member

rchl commented Nov 11, 2024

https://lsp.sublimetext.io/troubleshooting/#updating-the-path-used-by-lsp-servers explains how to deal with this issue.

The env in settings won't help here since it only applies inside the started server and not before.

@edaqa-uncountable
Copy link
Author

The linked doc shows that adding env is supported.

If that is not supported, then the plugin fails to account for a common use-case: I cannot modify the global path. In order to use LSP then I'd have to write a wrapper launcher that sets a path and then launches sublime. That doesn't seem like that would be intended.

@rchl
Copy link
Member

rchl commented Nov 11, 2024

The documentation is not very precise or possibly even wrong. The env.PATH can only be used to modify the PATH that server sees after it's started. So it can help if the server itself needs to find some binary in the PATH but it won't help for starting the server itself.

Since you are using NVM, you can just ensure that the NVM initialization script is evaluated in context of ST. I don't see why would that not be fine since you are doing the same in your terminal.

@edaqa-uncountable
Copy link
Author

How do I configure how Sublime/LSP initializes/configs NVM?

@rchl
Copy link
Member

rchl commented Nov 11, 2024

It's mentioned in the link I've posted.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants