question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Is it possible to pass an env to LSP?

See original GitHub issue

Description: Is it possible to pass an env to LSP?

For example, when starting clangd, I want to specify a CPATH for it. I tried to send RawCommandServerDefinition like this:

        RawCommandServerDefinition cpp = new RawCommandServerDefinition("cpp", new String[]{"set CPATH=xxxxx","&&","D:\\Program Files\\LLVM\\bin\\clangd.exe","-log=verbose"});

but it will not recognize the set command.

Do you have any other suggestion? Thank you!

Suggested Labels: Feature

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:3
  • Comments:15 (13 by maintainers)

github_iconTop GitHub Comments

2reactions
NipunaRanasinghecommented, Oct 29, 2019

do we REALLY need it?

@nixel2007 That’s a good question! These server definition types are inspired by the gtache’s original implementation, but it seems command based server definitions would be sufficient when going forward. So maybe we can get rid of the rest by revamping the server definition implementation, which will require a careful revamping process to avoid regressions.

2reactions
nixel2007commented, Oct 29, 2019

since the input won’t be a “raw command” anymore.

Agreed.

abstract thought - looks like API has “overloaded” org/wso2/lsp4intellij/client/languageserver/serverdefinition package. So much server definition types and ways to define LS connection. do we REALLY need it? Maybe we should reduce number of accessable definitions to two of them: raw-command and process builder?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Custom environment variables for each language-server. #128
This requires both LSP and server changes. Extend the os.environ passed to POpen by PYTHONPATH=C:\Apps\Sublime environment variable. While ...
Read more >
emacs-lsp/lsp-mode - Gitter
I don't know how environment variables for servers are handled. Is it worth it to add a local variable to lsp-mode with this...
Read more >
LSP-mode select python interpreter? (virtual environment ...
I want emacs python lsp-mode to be able to automatically choose the virtual environment python interpreter for the current project.
Read more >
How to setup Emacs LSP Mode for Go - GeekSocket
This blog post shows how to setup Emacs as a basic Go programming environment with LSP Mode and gopls.
Read more >
lsp-mode Golang build tags - Emacs Stack Exchange
I figure out the solution. Just change lsp-go-env with (setq lsp-go-env '((GOFLAGS . "-tags=tagthis")) ). make it works.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found