feat(nvim): omnisharp -> roslyn-ls
All checks were successful
Discord / discord commits (push) Has been skipped
All checks were successful
Discord / discord commits (push) Has been skipped
This commit is contained in:
parent
fa5fcfe8fd
commit
d563c80bd0
8 changed files with 81 additions and 41 deletions
|
@ -1,6 +1,6 @@
|
|||
using System;
|
||||
using System.Text.Json;
|
||||
using System.Reflection;
|
||||
using System.Text.Json;
|
||||
|
||||
using HomeAssistantGenerated;
|
||||
|
||||
|
|
17
flake.lock
generated
17
flake.lock
generated
|
@ -1741,6 +1741,7 @@
|
|||
"ts-for-gir-src": "ts-for-gir-src",
|
||||
"tuya-local-src": "tuya-local-src",
|
||||
"vimplugin-easytables-src": "vimplugin-easytables-src",
|
||||
"vimplugin-roslyn-nvim-src": "vimplugin-roslyn-nvim-src",
|
||||
"vimplugin-ts-error-translator-src": "vimplugin-ts-error-translator-src",
|
||||
"virtualkeyboard-adapter": "virtualkeyboard-adapter",
|
||||
"wakewords-src": "wakewords-src",
|
||||
|
@ -1994,6 +1995,22 @@
|
|||
"type": "github"
|
||||
}
|
||||
},
|
||||
"vimplugin-roslyn-nvim-src": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1734514131,
|
||||
"narHash": "sha256-BCrDW2sfronzpSoJHO6/8HH0VuGvdF4GO04USu4vuds=",
|
||||
"owner": "seblj",
|
||||
"repo": "roslyn.nvim",
|
||||
"rev": "1bc4553c3484480f08ea2ced3cebb6bd98e169e7",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "seblj",
|
||||
"repo": "roslyn.nvim",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"vimplugin-ts-error-translator-src": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
# Do not modify! This file is generated.
|
||||
|
||||
{
|
||||
inputs = {
|
||||
ags = {
|
||||
|
@ -464,6 +465,12 @@
|
|||
repo = "easytables.nvim";
|
||||
type = "github";
|
||||
};
|
||||
vimplugin-roslyn-nvim-src = {
|
||||
flake = false;
|
||||
owner = "seblj";
|
||||
repo = "roslyn.nvim";
|
||||
type = "github";
|
||||
};
|
||||
vimplugin-ts-error-translator-src = {
|
||||
flake = false;
|
||||
owner = "dmmulroy";
|
||||
|
@ -490,4 +497,4 @@
|
|||
};
|
||||
};
|
||||
outputs = inputs: inputs.flakegen ./outputs.nix inputs;
|
||||
}
|
||||
}
|
|
@ -50,6 +50,9 @@ in {
|
|||
silent = true,
|
||||
});
|
||||
|
||||
-- https://github.com/seblj/roslyn.nvim/issues/121#issuecomment-2544076963
|
||||
vim.opt.cmdheight = 2;
|
||||
|
||||
-- Get rid of deprecated messages
|
||||
vim.tbl_add_reverse_lookup = function(tbl)
|
||||
for k, v in pairs(tbl) do
|
||||
|
|
|
@ -1,20 +1,22 @@
|
|||
{
|
||||
self: {
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}: let
|
||||
inherit (lib) attrValues mkIf;
|
||||
inherit (self.lib.${pkgs.system}) buildPlugin;
|
||||
inherit (self.inputs) vimplugin-roslyn-nvim-src;
|
||||
|
||||
cfg = config.programs.neovim;
|
||||
in
|
||||
mkIf cfg.enableIde {
|
||||
in {
|
||||
config = mkIf cfg.enableIde {
|
||||
programs = {
|
||||
neovim = {
|
||||
extraPackages = attrValues {
|
||||
inherit
|
||||
(pkgs)
|
||||
omnisharp-roslyn
|
||||
roslyn-ls
|
||||
;
|
||||
};
|
||||
|
||||
|
@ -26,45 +28,51 @@ in
|
|||
command = 'setlocal ts=4 sw=4 sts=0 expandtab',
|
||||
});
|
||||
|
||||
local omnisharp_extended = require('omnisharp_extended');
|
||||
vim.api.nvim_create_autocmd('User', {
|
||||
pattern = 'RoslynInitialized',
|
||||
callback = function()
|
||||
vim.lsp.inlay_hint.enable();
|
||||
end,
|
||||
});
|
||||
|
||||
require('lspconfig').omnisharp.setup({
|
||||
cmd = { 'dotnet', '${pkgs.omnisharp-roslyn}/lib/omnisharp-roslyn/OmniSharp.dll' },
|
||||
-- FIXME: make editorconfig and format work
|
||||
require('roslyn').setup({
|
||||
config = {
|
||||
capabilities = require('cmp_nvim_lsp').default_capabilities(),
|
||||
|
||||
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,
|
||||
on_attach = function()
|
||||
vim.lsp.inlay_hint.enable();
|
||||
end,
|
||||
|
||||
settings = {
|
||||
["csharp|inlay_hints"] = {
|
||||
csharp_enable_inlay_hints_for_implicit_object_creation = true,
|
||||
csharp_enable_inlay_hints_for_implicit_variable_types = true,
|
||||
csharp_enable_inlay_hints_for_lambda_parameter_types = true,
|
||||
csharp_enable_inlay_hints_for_types = true,
|
||||
dotnet_enable_inlay_hints_for_indexer_parameters = true,
|
||||
dotnet_enable_inlay_hints_for_literal_parameters = true,
|
||||
dotnet_enable_inlay_hints_for_object_creation_parameters = true,
|
||||
dotnet_enable_inlay_hints_for_other_parameters = true,
|
||||
dotnet_enable_inlay_hints_for_parameters = true,
|
||||
dotnet_suppress_inlay_hints_for_parameters_that_differ_only_by_suffix = true,
|
||||
dotnet_suppress_inlay_hints_for_parameters_that_match_argument_name = true,
|
||||
dotnet_suppress_inlay_hints_for_parameters_that_match_method_intent = true,
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
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 = attrValues {
|
||||
inherit
|
||||
(pkgs.vimPlugins)
|
||||
omnisharp-extended-lsp-nvim
|
||||
;
|
||||
};
|
||||
plugins = [
|
||||
(buildPlugin "roslyn-nvim" vimplugin-roslyn-nvim-src)
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
||||
};
|
||||
|
||||
# For accurate stack trace
|
||||
_file = ./csharp.nix;
|
||||
}
|
||||
|
|
|
@ -11,7 +11,6 @@ in {
|
|||
imports = [
|
||||
./bash.nix
|
||||
./clang.nix
|
||||
./csharp.nix
|
||||
./hyprlang.nix
|
||||
./java.nix
|
||||
./json.nix
|
||||
|
@ -19,6 +18,7 @@ in {
|
|||
./python.nix
|
||||
./rust.nix
|
||||
|
||||
(import ./csharp.nix self)
|
||||
(import ./markdown.nix self)
|
||||
(import ./nix.nix self)
|
||||
(import ./web.nix self)
|
||||
|
|
|
@ -276,6 +276,11 @@ let
|
|||
owner = "dmmulroy";
|
||||
repo = "ts-error-translator.nvim";
|
||||
}
|
||||
{
|
||||
name = "vimplugin-roslyn-nvim-src";
|
||||
owner = "seblj";
|
||||
repo = "roslyn.nvim";
|
||||
}
|
||||
|
||||
# Overlays & packages
|
||||
{
|
||||
|
|
|
@ -22,7 +22,7 @@ in {
|
|||
;
|
||||
});
|
||||
|
||||
# FIXME: Omnisharp uses dotnet6
|
||||
# FIXME: Roslyn-ls uses dotnet6 https://github.com/NixOS/nixpkgs/blob/d3c42f187194c26d9f0309a8ecc469d6c878ce33/pkgs/by-name/ro/roslyn-ls/package.nix#L21
|
||||
nixpkgs.config.permittedInsecurePackages = [
|
||||
"dotnet-core-combined"
|
||||
"dotnet-sdk-6.0.428"
|
||||
|
|
Loading…
Add table
Reference in a new issue