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