feat(neovim): adjustment to c# ftplugin

- Remove from polish.lua the dap calls that configure c#
- Set DOTNET_ENVIRONMENT variable to "Development"
- Load projects on dap continue
This commit is contained in:
Alexandre Cavalheiro S. Tiago da Silva 2025-02-17 00:58:03 -03:00
parent d00e978fd4
commit 4044df17c2
Signed by: wizardlink
GPG key ID: A5767B54367CFBDF
2 changed files with 27 additions and 40 deletions

View file

@ -83,6 +83,10 @@ end
---@return thread
function M:choose_dll()
self.projects = self.find_projects()
local dap = require "dap"
return coroutine.create(function(search_coroutine)
vim.ui.select(
self.projects,
@ -96,9 +100,13 @@ function M:choose_dll()
},
---@param item CSFTPlugin.Project
function(item)
self:run "build"
local path = item and item.dll_path or dap.ABORT
coroutine.resume(search_coroutine, item and item.dll_path or require("dap").ABORT)
if path ~= dap.ABORT then
self:run "build"
end
coroutine.resume(search_coroutine, path)
end
)
end)
@ -112,10 +120,20 @@ function M:start()
return
end
self.projects = self.find_projects()
vim.fn.setenv("DOTNET_ENVIRONMENT", "Development")
local debugger_path = vim.fn.getnixpath "netcoredbg" .. "/bin/netcoredbg"
local dap = require "dap"
---@type dap.ExecutableAdapter
dap.adapters.netcoredbg = {
type = "executable",
command = debugger_path,
args = { "--interpreter=vscode" },
}
---@type dap.Configuration[]
dap.configurations.cs = {
{
type = "netcoredbg",
@ -127,8 +145,6 @@ function M:start()
},
}
vim.notify_once("Loaded projects for nvim-dap", vim.log.levels.INFO)
vim.g.loaded_csftplugin = true
end