2024-10-05 15:17:16 -04:00
|
|
|
{
|
|
|
|
config,
|
|
|
|
lib,
|
2024-11-22 02:48:41 -05:00
|
|
|
pkgs,
|
2024-10-05 15:17:16 -04:00
|
|
|
...
|
|
|
|
}: let
|
2024-12-16 17:44:17 -05:00
|
|
|
inherit (lib) attrValues mkIf;
|
2024-11-22 02:48:41 -05:00
|
|
|
|
|
|
|
cfg = config.programs.neovim;
|
2024-10-05 15:17:16 -04:00
|
|
|
in
|
2024-11-22 02:48:41 -05:00
|
|
|
mkIf cfg.enableIde {
|
2024-10-05 15:17:16 -04:00
|
|
|
programs = {
|
|
|
|
neovim = {
|
2024-12-16 17:44:17 -05:00
|
|
|
extraPackages = attrValues {
|
2024-10-05 15:17:16 -04:00
|
|
|
inherit
|
|
|
|
(pkgs)
|
2024-10-31 23:13:02 -04:00
|
|
|
omnisharp-roslyn
|
2024-10-05 15:17:16 -04:00
|
|
|
;
|
|
|
|
};
|
|
|
|
|
|
|
|
extraLuaConfig =
|
|
|
|
# lua
|
|
|
|
''
|
|
|
|
vim.api.nvim_create_autocmd('FileType', {
|
2024-10-31 23:13:02 -04:00
|
|
|
pattern = { 'cs' },
|
2024-10-05 15:17:16 -04:00
|
|
|
command = 'setlocal ts=4 sw=4 sts=0 expandtab',
|
|
|
|
});
|
|
|
|
|
2024-10-31 23:13:02 -04:00
|
|
|
local omnisharp_extended = require('omnisharp_extended');
|
|
|
|
|
|
|
|
require('lspconfig').omnisharp.setup({
|
2024-12-16 17:44:17 -05:00
|
|
|
cmd = { 'dotnet', '${pkgs.omnisharp-roslyn}/lib/omnisharp-roslyn/OmniSharp.dll' },
|
2024-10-05 15:17:16 -04:00
|
|
|
|
|
|
|
handlers = {
|
2024-12-16 17:44:17 -05:00
|
|
|
['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,
|
2024-10-31 23:13:02 -04:00
|
|
|
},
|
|
|
|
|
|
|
|
settings = {
|
|
|
|
FormattingOptions = {
|
|
|
|
EnableEditorConfigSupport = true,
|
|
|
|
OrganizeImports = true,
|
|
|
|
},
|
|
|
|
MsBuild = {
|
|
|
|
LoadProjectsOnDemand = false,
|
|
|
|
},
|
|
|
|
RoslynExtensionsOptions = {
|
|
|
|
EnableAnalyzersSupport = true,
|
|
|
|
EnableDecompilationSupport = true,
|
|
|
|
EnableImportCompletion = true,
|
|
|
|
AnalyzeOpenDocumentsOnly = false,
|
|
|
|
},
|
|
|
|
Sdk = {
|
|
|
|
IncludePrereleases = true,
|
|
|
|
},
|
2024-10-05 15:17:16 -04:00
|
|
|
},
|
|
|
|
});
|
|
|
|
'';
|
|
|
|
|
2024-12-16 17:44:17 -05:00
|
|
|
plugins = attrValues {
|
|
|
|
inherit
|
|
|
|
(pkgs.vimPlugins)
|
|
|
|
omnisharp-extended-lsp-nvim
|
|
|
|
;
|
2024-10-05 15:17:16 -04:00
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|