feat(nvim): omnisharp -> roslyn-ls
All checks were successful
Discord / discord commits (push) Has been skipped

This commit is contained in:
matt1432 2024-12-11 14:00:13 -05:00
parent ab17dbbc1c
commit caaaba4381
6 changed files with 28 additions and 39 deletions

Binary file not shown.

BIN
flake.nix

Binary file not shown.

View file

@ -1,20 +1,21 @@
{
self: {
config,
lib,
pkgs,
...
}: let
inherit (lib) mkIf;
inherit (self.inputs) vimplugin-roslyn-nvim-src;
cfg = config.programs.neovim;
in
mkIf cfg.enableIde {
in {
config = mkIf cfg.enableIde {
programs = {
neovim = {
extraPackages = builtins.attrValues {
inherit
(pkgs)
omnisharp-roslyn
roslyn-ls
;
};
@ -26,42 +27,24 @@ in
command = 'setlocal ts=4 sw=4 sts=0 expandtab',
});
local omnisharp_extended = require('omnisharp_extended');
require('roslyn').setup({
capabilities = require('cmp_nvim_lsp').default_capabilities(),
require('lspconfig').omnisharp.setup({
cmd = { "dotnet", "${pkgs.omnisharp-roslyn}/lib/omnisharp-roslyn/OmniSharp.dll" },
handlers = {
["textDocument/definition"] = omnisharp_extended.definition_handler,
["textDocument/typeDefinition"] = omnisharp_extended.type_definition_handler,
["textDocument/references"] = omnisharp_extended.references_handler,
["textDocument/implementation"] = omnisharp_extended.implementation_handler,
},
settings = {
FormattingOptions = {
EnableEditorConfigSupport = true,
OrganizeImports = true,
},
MsBuild = {
LoadProjectsOnDemand = false,
},
RoslynExtensionsOptions = {
EnableAnalyzersSupport = true,
EnableDecompilationSupport = true,
EnableImportCompletion = true,
AnalyzeOpenDocumentsOnly = false,
},
Sdk = {
IncludePrereleases = true,
},
},
exe = 'Microsoft.CodeAnalysis.LanguageServer',
});
'';
plugins = builtins.attrValues {
inherit (pkgs.vimPlugins) omnisharp-extended-lsp-nvim;
plugins = [
(pkgs.vimUtils.buildVimPlugin {
pname = "roslyn-nvim";
version = "0.0.0+${vimplugin-roslyn-nvim-src.shortRev}";
src = vimplugin-roslyn-nvim-src;
})
];
};
};
};
# For accurate stack trace
_file = ./csharp.nix;
}

View file

@ -11,13 +11,13 @@ in {
imports = [
./bash.nix
./clang.nix
./csharp.nix
./hyprlang.nix
./java.nix
./json.nix
./lua.nix
./python.nix
./rust.nix
(import ./csharp.nix self)
(import ./markdown.nix self)
(import ./nix.nix self)
(import ./web.nix self)

View file

@ -266,6 +266,11 @@ let
owner = "dmmulroy";
repo = "ts-error-translator.nvim";
}
{
name = "vimplugin-roslyn-nvim-src";
owner = "seblj";
repo = "roslyn.nvim";
}
# Overlays & packages
{

View file

@ -22,9 +22,10 @@ in {
;
});
# FIXME: Omnisharp uses dotnet6
# FIXME: Roslyn-ls uses dotnet6
nixpkgs.config.permittedInsecurePackages = [
"dotnet-core-combined"
"dotnet-sdk-7.0.410"
"dotnet-sdk-6.0.428"
"dotnet-sdk-wrapped-6.0.428"
];