Added workaround for omnisharp

This commit is contained in:
Nicholas Novak
2023-04-16 12:59:36 -07:00
parent 15226d8131
commit e0b1b9cf1c
+80 -1
View File
@@ -456,7 +456,86 @@ vim.keymap.set('n', '<leader>q', vim.diagnostic.setloclist)
-- LSP settings. -- LSP settings.
-- This function gets run when an LSP connects to a particular buffer. -- This function gets run when an LSP connects to a particular buffer.
local on_attach = function(_, bufnr) local on_attach = function(client, bufnr)
-- Omnisharp requires a workaround due to its non-conformance with the LSP spec
-- https://github.com/OmniSharp/omnisharp-roslyn/issues/2483
if client.name == "omnisharp" or client.name == "omnisharp_mono" then
client.server_capabilities.semanticTokensProvider = {
full = vim.empty_dict(),
legend = {
tokenModifiers = { "static_symbol" },
tokenTypes = {
"comment",
"excluded_code",
"identifier",
"keyword",
"keyword_control",
"number",
"operator",
"operator_overloaded",
"preprocessor_keyword",
"string",
"whitespace",
"text",
"static_symbol",
"preprocessor_text",
"punctuation",
"string_verbatim",
"string_escape_character",
"class_name",
"delegate_name",
"enum_name",
"interface_name",
"module_name",
"struct_name",
"type_parameter_name",
"field_name",
"enum_member_name",
"constant_name",
"local_name",
"parameter_name",
"method_name",
"extension_method_name",
"property_name",
"event_name",
"namespace_name",
"label_name",
"xml_doc_comment_attribute_name",
"xml_doc_comment_attribute_quotes",
"xml_doc_comment_attribute_value",
"xml_doc_comment_cdata_section",
"xml_doc_comment_comment",
"xml_doc_comment_delimiter",
"xml_doc_comment_entity_reference",
"xml_doc_comment_name",
"xml_doc_comment_processing_instruction",
"xml_doc_comment_text",
"xml_literal_attribute_name",
"xml_literal_attribute_quotes",
"xml_literal_attribute_value",
"xml_literal_cdata_section",
"xml_literal_comment",
"xml_literal_delimiter",
"xml_literal_embedded_expression",
"xml_literal_entity_reference",
"xml_literal_name",
"xml_literal_processing_instruction",
"xml_literal_text",
"regex_comment",
"regex_character_class",
"regex_anchor",
"regex_quantifier",
"regex_grouping",
"regex_alternation",
"regex_text",
"regex_self_escaped_character",
"regex_other_escape",
},
},
range = true,
}
end
-- NOTE: Remember that lua is a real programming language, and as such it is possible -- NOTE: Remember that lua is a real programming language, and as such it is possible
-- to define small helper and utility functions so you don't have to repeat yourself -- to define small helper and utility functions so you don't have to repeat yourself
-- many times. -- many times.