feat(roslyn): force inject capabilities for blink.cmp

This commit is contained in:
Radu C. Martin 2025-02-21 11:52:03 +01:00
parent 8f997a4dca
commit a4e40d86af

View file

@ -1,28 +1,55 @@
return { return {
'seblj/roslyn.nvim', {
event = { 'BufReadPre', 'BufNewFile' }, 'seblj/roslyn.nvim',
ft = 'cs', config = function()
opts = { -- NOTE: not sure if needed. check https://github.com/seblyng/roslyn.nvim/issues/90
filewatching = false, local capabilities = vim.lsp.protocol.make_client_capabilities()
broad_search = true, capabilities = require('blink.cmp').get_lsp_capabilities(capabilities)
-- ignore_sln = function(sln) capabilities = vim.tbl_deep_extend('force', capabilities, {
-- return string.match(sln, 'Contactify.sln') ~= nil textDocument = {
-- end, diagnostic = {
config = { dynamicRegistration = true,
settings = { },
['csharp|inlay_hints'] = {
csharp_enable_inlay_hints_for_implicit_variable_types = true,
csharp_enable_inlay_hints_for_types = true,
csharp_enable_inlay_hints_for_parameters = true,
}, },
['csharp|background_analysis'] = { })
background_analysis_dotnet_analyzer_diagnostics_scope = 'openFiles', require('roslyn').setup {
background_analysis_dotnet_compiler_diagnostics_scope = 'openFiles', filewatching = true,
config = {
capabilities = capabilities,
settings = {
['csharp|background_analysis'] = {
-- background_analysis = {
-- dotnet_analyzer_diagnostics_scope = "openFiles",
-- dotnet_compiler_diagnostics_scope = "fullSolution",
-- },
dotnet_analyzer_diagnostics_scope = 'openFiles',
dotnet_compiler_diagnostics_scope = 'fullSolution',
},
['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,
},
['csharp|code_lens'] = {
dotnet_enable_references_code_lens = true,
dotnet_enable_tests_code_lens = true,
},
['csharp_completion'] = {
dotnet_show_completion_items_from_unimported_namespaces = true,
dotnet_show_name_completion_suggestions = true,
},
},
}, },
['csharp|completion'] = { }
dotnet_show_completion_items_from_unimported_namespaces = true, end,
},
},
},
}, },
} }