OmniSharp / omnisharp-vim

Vim omnicompletion (intellisense) and more for C#
http://www.omnisharp.net
MIT License
1.72k stars 168 forks source link

How do I stop OmniSharp from creating '~/.omnisharp' directory? #839

Closed ztx-lyghters closed 1 year ago

ztx-lyghters commented 1 year ago

I want OmniSharp to respect XDG_CONFIG_HOME. How can I permanently move ~/.omnisharp to either ~/.config or ~/.local/share?

nickspoons commented 1 year ago

OmniSharp-vim doesn't use ~/.omnisharp by default, it uses $XDG_CACHE_HOME and falls back to $HOME/.cache, so usually installs the server to ~/.cache/omnisharp-vim/omnisharp-roslyn.

The OmniSharp-roslyn server does use ~/.omnisharp by default to read a global ~/.omnisharp/omnisharp.json config, but it is configurable (I am not exactly sure how, check that repo) and I don't think the directory is created automatically.

What do you have in your ~/.omnisharp directory?

ztx-lyghters commented 1 year ago

What do you have in your ~/.omnisharp directory?

Nothing, it's empty, it just gets created every time I open any *.cs file in neovim. And roslyn server is indeed in ~/.cache/omnisharp-vim

nickspoons commented 1 year ago

That directory is not being created by OmniSharp-vim, it's being created by OmniSharp-roslyn:

https://github.com/OmniSharp/omnisharp-roslyn/blob/master/src/OmniSharp.Host/Internal/ConfigurationBuilderExtensions.cs#L19

You can configure a different location using an 'OMNISHARPHOME' environment variable, see:

https://github.com/OmniSharp/omnisharp-roslyn/blob/master/src/OmniSharp.Host/Services/OmniSharpEnvironment.cs#L49