updated ocaml and c#

This commit is contained in:
MasterGordon 2024-09-10 21:28:02 +02:00
parent a7e2fe3ea0
commit 7648c06f07
5 changed files with 146 additions and 120 deletions

View File

@ -54,6 +54,7 @@
"popui.nvim": { "branch": "master", "commit": "4d903e46fdb5eef25fa79ef1b598f5340a2674b0" }, "popui.nvim": { "branch": "master", "commit": "4d903e46fdb5eef25fa79ef1b598f5340a2674b0" },
"popup.nvim": { "branch": "master", "commit": "b7404d35d5d3548a82149238289fa71f7f6de4ac" }, "popup.nvim": { "branch": "master", "commit": "b7404d35d5d3548a82149238289fa71f7f6de4ac" },
"presence.nvim": { "branch": "main", "commit": "87c857a56b7703f976d3a5ef15967d80508df6e6" }, "presence.nvim": { "branch": "main", "commit": "87c857a56b7703f976d3a5ef15967d80508df6e6" },
"roslyn.nvim": { "branch": "main", "commit": "e284f0e6c34b01cd1db9fdb71c75ae85d732a43b" },
"statuscol.nvim": { "branch": "main", "commit": "93d8bcda516fc86e11c03f9ef577bae9a72fba0e" }, "statuscol.nvim": { "branch": "main", "commit": "93d8bcda516fc86e11c03f9ef577bae9a72fba0e" },
"supermaven-nvim": { "branch": "main", "commit": "d71257f431e190d9236d7f30da4c2d659389e91f" }, "supermaven-nvim": { "branch": "main", "commit": "d71257f431e190d9236d7f30da4c2d659389e91f" },
"tailwind-tools.nvim": { "branch": "master", "commit": "48523580c6af449a7a57610ce5596c716cf4363a" }, "tailwind-tools.nvim": { "branch": "master", "commit": "48523580c6af449a7a57610ce5596c716cf4363a" },

View File

@ -28,3 +28,16 @@ set.signcolumn = "auto:2"
-- set leader -- set leader
vim.g.mapleader = " " vim.g.mapleader = " "
vim.filetype.add(
{
extension = {
zsh = "sh",
sh = "sh"
},
filename = {
[".zshrc"] = "sh",
[".zshenv"] = "sh"
}
}
)

View File

@ -80,7 +80,8 @@ require("lazy").setup(
"williamboman/mason.nvim", "williamboman/mason.nvim",
"williamboman/mason-lspconfig.nvim", "williamboman/mason-lspconfig.nvim",
"neovim/nvim-lspconfig", "neovim/nvim-lspconfig",
"jay-babu/mason-null-ls.nvim" "jay-babu/mason-null-ls.nvim",
"seblj/roslyn.nvim"
} }
}, },
{ {

View File

@ -63,16 +63,35 @@ require("formatter").setup(
stdin = true stdin = true
} }
end end
},
xml = {
function()
return {
exe = "xmllint",
args = {"--format", "-"},
stdin = true
}
end
},
cs = {
function()
return {
exe = "dotnet-csharpier",
args = {"--write-stdout"},
stdin = true
}
end
},
-- ocaml
ocaml = {
function()
return {
exe = "ocamlformat",
args = {"--name", vim.api.nvim_buf_get_name(0), "-"},
stdin = true
}
end
} }
-- cs = {
-- function()
-- return {
-- exe = "dotnet",
-- args = {"csharpier", "--write-stdout"},
-- stdin = true
-- }
-- end
-- }
} }
} }
) )
@ -81,7 +100,7 @@ vim.api.nvim_exec(
[[ [[
augroup FormatAutogroup augroup FormatAutogroup
autocmd! autocmd!
autocmd BufWritePost *.h,*.cpp,*.rs,*.lua,*.tsx,*.ts,*.js,*.jsx,*.json,*.jsonc,*.swift FormatWrite autocmd BufWritePost *.cs,*.h,*.cpp,*.rs,*.lua,*.tsx,*.ts,*.js,*.jsx,*.json,*.jsonc,*.swift,*.xml,*.sln,*.csproj,*.ml FormatWrite
augroup END augroup END
]], ]],
true true
@ -90,7 +109,7 @@ local formatGrp = vim.api.nvim_create_augroup("Format", {clear = true})
vim.api.nvim_create_autocmd( vim.api.nvim_create_autocmd(
"BufWritePre", "BufWritePre",
{ {
pattern = "*.cs,*.php", pattern = "*.php",
command = "lua vim.lsp.buf.format { async = false }", command = "lua vim.lsp.buf.format { async = false }",
group = formatGrp group = formatGrp
} }

View File

@ -26,13 +26,13 @@ local common_servers = {
"lua_ls", "lua_ls",
"html", "html",
"vimls", "vimls",
"yamlls" "yamlls",
"ocamllsp"
} }
local extra_servers = { local extra_servers = {
"vtsls", "vtsls",
"eslint", "eslint",
"jsonls", "jsonls",
"omnisharp",
"rust_analyzer", "rust_analyzer",
"tailwindcss" "tailwindcss"
} }
@ -199,115 +199,107 @@ nvim_lsp.tailwindcss.setup {
debounce_text_changes = 150 debounce_text_changes = 150
}, },
capabilities = capabilities, capabilities = capabilities,
-- on_init = function(client)
-- local path = client.workspace_folders and client.workspace_folders[1] and client.workspace_folders[1].name
-- local config_path = path .. "/.vscode/settings.json"
-- if vim.uv.fs_stat(config_path) then
-- local file = vim.fn.readfile(config_path)
-- local vscode_settings = vim.fn.json_decode(file)
-- client.config.settings =
-- vim.tbl_deep_extend(
-- "force",
-- client.config.settings,
-- {
-- tailwindCSS = {
-- rootFontSize = vscode_settings["tailwindCSS.rootFontSize"]
-- }
-- }
-- )
-- client.notify(vim.lsp.protocol.Methods.workspace_didChangeConfiguration, {settings = client.config.settings})
-- end
-- end,
settings = tailwindcss_settings settings = tailwindcss_settings
} }
nvim_lsp.omnisharp.setup { require("roslyn").setup(
cmd = {"OmniSharp"}, {
enable_editorconfig_support = true, config = {},
enable_roslyn_analyzers = true, exe = {
enable_import_completion = true, "dotnet",
on_attach = function(client, bufnr) vim.fs.joinpath(vim.fn.stdpath("data"), "roslyn", "Microsoft.CodeAnalysis.LanguageServer.dll")
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 filewatching = true
} }
on_attach(client, bufnr) )
end,
flags = { -- nvim_lsp.omnisharp.setup {
debounce_text_changes = 150 -- cmd = {"OmniSharp"},
}, -- enable_editorconfig_support = true,
capabilities = capabilities -- enable_roslyn_analyzers = true,
} -- enable_import_completion = true,
-- on_attach = function(client, bufnr)
-- 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
-- }
-- on_attach(client, bufnr)
-- end,
-- flags = {
-- debounce_text_changes = 150
-- },
-- capabilities = capabilities
-- }
nvim_lsp.rust_analyzer.setup { nvim_lsp.rust_analyzer.setup {
on_attach = on_attach, on_attach = on_attach,