parent
0f627107ce
commit
346077c0e0
16 changed files with 144 additions and 107 deletions
homeManagerModules/neovim/langs/csharp
|
@ -4,22 +4,16 @@ self: {
|
|||
pkgs,
|
||||
...
|
||||
}: let
|
||||
inherit (lib) attrValues mkIf;
|
||||
inherit (self.lib.${pkgs.system}) buildPlugin;
|
||||
inherit (self.inputs) vimplugin-roslyn-nvim-src;
|
||||
|
||||
inherit (lib) mkIf;
|
||||
|
||||
cfg = config.programs.neovim;
|
||||
in {
|
||||
config = mkIf cfg.enable {
|
||||
programs = {
|
||||
neovim = {
|
||||
extraPackages = attrValues {
|
||||
inherit
|
||||
(pkgs)
|
||||
roslyn-ls
|
||||
;
|
||||
};
|
||||
|
||||
extraLuaConfig =
|
||||
# lua
|
||||
''
|
||||
|
@ -27,46 +21,53 @@ in {
|
|||
pattern = { 'cs' },
|
||||
command = 'setlocal ts=4 sw=4 sts=0 expandtab',
|
||||
});
|
||||
|
||||
vim.api.nvim_create_autocmd('User', {
|
||||
pattern = 'RoslynInitialized',
|
||||
callback = function()
|
||||
vim.lsp.inlay_hint.enable();
|
||||
end,
|
||||
});
|
||||
|
||||
require('roslyn').setup({
|
||||
config = {
|
||||
capabilities = require('cmp_nvim_lsp').default_capabilities(),
|
||||
|
||||
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,
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
exe = 'Microsoft.CodeAnalysis.LanguageServer',
|
||||
});
|
||||
'';
|
||||
|
||||
plugins = [
|
||||
(buildPlugin "roslyn-nvim" vimplugin-roslyn-nvim-src)
|
||||
{
|
||||
plugin = buildPlugin "roslyn-nvim" vimplugin-roslyn-nvim-src;
|
||||
type = "lua";
|
||||
config =
|
||||
# lua
|
||||
''
|
||||
vim.api.nvim_create_autocmd('User', {
|
||||
pattern = 'RoslynInitialized',
|
||||
|
||||
callback = function()
|
||||
vim.lsp.inlay_hint.enable();
|
||||
end,
|
||||
});
|
||||
|
||||
require('roslyn').setup({
|
||||
config = {
|
||||
capabilities = require('cmp_nvim_lsp').default_capabilities(),
|
||||
|
||||
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,
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
exe = 'Microsoft.CodeAnalysis.LanguageServer',
|
||||
});
|
||||
'';
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
|
|
12
homeManagerModules/neovim/langs/csharp/shell.nix
Normal file
12
homeManagerModules/neovim/langs/csharp/shell.nix
Normal file
|
@ -0,0 +1,12 @@
|
|||
{
|
||||
mkShell,
|
||||
dotnetCorePackages,
|
||||
roslyn-ls,
|
||||
...
|
||||
}:
|
||||
mkShell {
|
||||
packages = [
|
||||
dotnetCorePackages.sdk_9_0
|
||||
roslyn-ls
|
||||
];
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue