Files
LazyVim/lua/lazyvim/plugins/extras/lang/omnisharp.lua
CaueDosAnjos dfebe70b8d fix(lang.omnisharp): update CSharpier command and arguments for Mason compatibility (#6156)
## Description
This PR updates the CSharpier integration in LazyVim to reflect changes
in how Mason installs the formatter.

Previously, Mason installed CSharpier as the `dotnet-csharpier` binary,
which allowed running it without additional arguments. Now, Mason
installs it simply as `csharpier`, requiring the explicit format
argument for it to work correctly.

This change updates the formatter command and arguments accordingly to
ensure compatibility with the latest Mason installation and CSharpier
CLI behavior.

## Changes
Replaced `dotnet-csharpier` with `csharpier` as the executable command.

Added the required `format` argument to the command invocation.

## Related Issue(s)
Fixes #6155

## Checklist
I have read the
[CONTRIBUTING](https://github.com/LazyVim/LazyVim/blob/main/CONTRIBUTING.md)
guidelines.
2025-10-19 12:46:46 +02:00

112 lines
2.8 KiB
Lua

return {
recommended = function()
return LazyVim.extras.wants({
ft = { "cs", "vb" },
root = { "*.sln", "*.csproj", "omnisharp.json", "function.json" },
})
end,
{ "Hoffs/omnisharp-extended-lsp.nvim", lazy = true },
{
"nvim-treesitter/nvim-treesitter",
opts = { ensure_installed = { "c_sharp" } },
},
{
"nvimtools/none-ls.nvim",
optional = true,
opts = function(_, opts)
local nls = require("null-ls")
opts.sources = opts.sources or {}
table.insert(opts.sources, nls.builtins.formatting.csharpier)
end,
},
{
"stevearc/conform.nvim",
optional = true,
opts = {
formatters_by_ft = {
cs = { "csharpier" },
},
},
},
{
"mason-org/mason.nvim",
opts = { ensure_installed = { "csharpier", "netcoredbg" } },
},
{
"neovim/nvim-lspconfig",
opts = {
servers = {
omnisharp = {
handlers = {
["textDocument/definition"] = function(...)
return require("omnisharp_extended").handler(...)
end,
},
keys = {
{
"gd",
LazyVim.has("telescope.nvim") and function()
require("omnisharp_extended").telescope_lsp_definitions()
end or function()
require("omnisharp_extended").lsp_definitions()
end,
desc = "Goto Definition",
},
},
enable_roslyn_analyzers = true,
organize_imports_on_format = true,
enable_import_completion = true,
},
},
},
},
{
"mfussenegger/nvim-dap",
optional = true,
opts = function()
local dap = require("dap")
if not dap.adapters["netcoredbg"] then
require("dap").adapters["netcoredbg"] = {
type = "executable",
command = vim.fn.exepath("netcoredbg"),
args = { "--interpreter=vscode" },
options = {
detached = false,
},
}
end
for _, lang in ipairs({ "cs", "fsharp", "vb" }) do
if not dap.configurations[lang] then
dap.configurations[lang] = {
{
type = "netcoredbg",
name = "Launch file",
request = "launch",
---@diagnostic disable-next-line: redundant-parameter
program = function()
return vim.fn.input("Path to dll: ", vim.fn.getcwd() .. "/", "file")
end,
cwd = "${workspaceFolder}",
},
}
end
end
end,
},
{
"nvim-neotest/neotest",
optional = true,
dependencies = {
"Nsidorenco/neotest-vstest",
},
opts = {
adapters = {
["neotest-vstest"] = {
-- Here we can set options for neotest-vstest
},
},
},
},
}