Skip to content

Support passing environment variables to LSP binaries #1159

@profectional

Description

@profectional

It seems that Fresh currently doesn’t have a way to pass environment variables to LSP binaries. I ran into this with OmniSharp on a low-RAM system: the CLR sometimes fails to initialize with an error like (this can be circumvented inside nvim with manually setting env flags):
C heap initialization failed with error 0x8007000E Failed to create CoreCLR, HRESULT: 0x8007000E
I tried setting DOTNET_* flags via .profile, shell exports, and wrapper scripts, but they didn’t appear to be picked up by Fresh when it launched OmniSharp. I’m not sure if this is just my setup tho?

It might be useful to have a way to specify environment variables per LSP binary, for example:
"c_sharp": { "command": "/path/to/OmniSharp", "args": ["--languageserver"], "env": { "DOTNET_gcServer": "0", "DOTNET_GCHeapHardLimitPercent": "50" } }

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions