Skip to content

roslyn.nvim #885

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

Open
SchnozzleCat opened this issue Jan 3, 2024 · 7 comments
Open

roslyn.nvim #885

SchnozzleCat opened this issue Jan 3, 2024 · 7 comments
Labels
enhancement New feature or request

Comments

@SchnozzleCat
Copy link

Plugin: roslyn.nvim
Plugin repository: URL to the repository of the plugin
Is the plugin on nixpkgs: No

Extra information

This is the language server that is present in VSCode's C# Extension, and is supposed to replace Omnisharp.

@SchnozzleCat SchnozzleCat added the enhancement New feature or request label Jan 3, 2024
@GaetanLepage
Copy link
Member

Hi !
Thank you for this suggestion.
I upstreamed the package to nixpkgs in NixOS/nixpkgs#278511. It should make its way to the unstable channels pretty soon.
Then, you will be able to use it by adding it to extraPlugins.

However, I will not (yet) add support for it explicitly (plugins.roslyn.*) because:

  1. It is only compatible with neovim nightly and doesn't seem to work on stable versions.
  2. It requires to "build" the language server and I have not checked whether this works fine with nix or if it should be patched/upstreamed specifically.

1 is the real reason. 2 can be solve eventually.
I will close this issue, but please, feel free to re-open when the plugin will be compatible with the latest stable version of neovim.

@KennethHoff
Copy link

Hey, the officially-endorsed fork now only requires neovim >= 0.10; Would be interested in looking into this now? :)

@GaetanLepage
Copy link
Member

Hey, the officially-endorsed fork now only requires neovim >= 0.10; Would be interested in looking into this now? :)

Ok good to know !
I switched to this new fork: NixOS/nixpkgs#380043
Let's wait for it to make it's way to nixpkgs-unstable.

Would you be interested in making a PR yourself then ?

@MattSturgeon MattSturgeon reopened this Feb 7, 2025
@KennethHoff
Copy link

KennethHoff commented Apr 7, 2025

Would you be interested in making a PR yourself then ?

On the 2 month anniversary of the question, here I am!

I don't know where to put the various bits to make a PR (If you can give me some pointers that'd be great), but I just tried to do it locally and realized it required like no code to add.

programs.nixvim = {
  enable = true;
  extraPlugins = [ pkgs.vimPlugins.roslyn-nvim ];
  extraConfigLua = ''
    require('roslyn').setup({
      -- roslyn-ls adds this command
      exe = 'Microsoft.CodeAnalysis.LanguageServer'
    })
  '';
};
home.packages =  [ pkgs.roslyn-ls ];

@GaetanLepage
Copy link
Member

Would you be interested in making a PR yourself then ?

On the 2 month anniversary of the question, here I am!

I don't know where to put the various bits to make a PR (If you can give me some pointers that'd be great), but I just tried to do it locally and realized it required like no code to add.

programs.nixvim = {
enable = true;
extraPlugins = [ pkgs.vimPlugins.roslyn-nvim ];
extraConfigLua = ''
require('roslyn').setup({
-- roslyn-ls adds this command
exe = 'Microsoft.CodeAnalysis.LanguageServer'
})
'';
};
home.packages = [ pkgs.roslyn-ls ];

Good to hear!

Basically, you can have a look at recent PRs that have been made to add plugins.
You can even use our integrated helper to start. First, checkout a new branch and run:

nix develop --command new-plugin roslyn.nvim roslyn-nvim

Then, open the generated files and fill things in.

Importantly, please do not add anything under settingsOptions as we now try to not explicitly declare options anymore.
Simply add a settingsExample attrs and it should be good.

@KennethHoff
Copy link

Created the boilerplate just now, #3166.

I didn't really understand how I add dependencies, as I need to install the roslyn-ls package. I guess that's part of the reason #3162 exists.

@MattSturgeon
Copy link
Member

I didn't really understand how I add dependencies, as I need to install the roslyn-ls package. I guess that's part of the reason #3162 exists.

You could reference some of the mkPackageOption examples that are removed by #3162. Alternatively you could wait for that PR to land and go from there.

If that's a language server, it may be better to just have an assertion that the relevant plugins.lsp.servers.*.enable option is enabled (and/or mkDefault true it within your plugin), instead of adding a package option.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants