Is it possible to pass an env to LSP?
See original GitHub issueDescription: 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:
- Created 4 years ago
- Reactions:3
- Comments:15 (13 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@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.
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?