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:
parent
d00e978fd4
commit
4044df17c2
|
@ -83,6 +83,10 @@ end
|
||||||
|
|
||||||
---@return thread
|
---@return thread
|
||||||
function M:choose_dll()
|
function M:choose_dll()
|
||||||
|
self.projects = self.find_projects()
|
||||||
|
|
||||||
|
local dap = require "dap"
|
||||||
|
|
||||||
return coroutine.create(function(search_coroutine)
|
return coroutine.create(function(search_coroutine)
|
||||||
vim.ui.select(
|
vim.ui.select(
|
||||||
self.projects,
|
self.projects,
|
||||||
|
@ -96,9 +100,13 @@ function M:choose_dll()
|
||||||
},
|
},
|
||||||
---@param item CSFTPlugin.Project
|
---@param item CSFTPlugin.Project
|
||||||
function(item)
|
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
|
||||||
)
|
)
|
||||||
end)
|
end)
|
||||||
|
@ -112,10 +120,20 @@ function M:start()
|
||||||
return
|
return
|
||||||
end
|
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"
|
local dap = require "dap"
|
||||||
|
|
||||||
|
---@type dap.ExecutableAdapter
|
||||||
|
dap.adapters.netcoredbg = {
|
||||||
|
type = "executable",
|
||||||
|
command = debugger_path,
|
||||||
|
args = { "--interpreter=vscode" },
|
||||||
|
}
|
||||||
|
|
||||||
|
---@type dap.Configuration[]
|
||||||
dap.configurations.cs = {
|
dap.configurations.cs = {
|
||||||
{
|
{
|
||||||
type = "netcoredbg",
|
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
|
vim.g.loaded_csftplugin = true
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -83,7 +83,7 @@ end, { range = true, nargs = "?" })
|
||||||
|
|
||||||
local dap = require "dap"
|
local dap = require "dap"
|
||||||
|
|
||||||
-- @type DapAdapter
|
---@type dap.Adapter
|
||||||
dap.adapters.codelldb = {
|
dap.adapters.codelldb = {
|
||||||
port = "${port}",
|
port = "${port}",
|
||||||
type = "server",
|
type = "server",
|
||||||
|
@ -93,7 +93,7 @@ dap.adapters.codelldb = {
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
-- @type DapAdapter
|
---@type dap.Adapter
|
||||||
dap.adapters.cppdbg = {
|
dap.adapters.cppdbg = {
|
||||||
id = "cppdbg",
|
id = "cppdbg",
|
||||||
type = "executable",
|
type = "executable",
|
||||||
|
@ -101,21 +101,14 @@ dap.adapters.cppdbg = {
|
||||||
"{pkgs.vscode-extensions.ms-vscode.cpptools}/share/vscode/extensions/ms-vscode.cpptools/debugAdapters/bin/OpenDebugAD7",
|
"{pkgs.vscode-extensions.ms-vscode.cpptools}/share/vscode/extensions/ms-vscode.cpptools/debugAdapters/bin/OpenDebugAD7",
|
||||||
}
|
}
|
||||||
|
|
||||||
-- @type DapAdapter
|
---@type dap.Adapter
|
||||||
dap.adapters.netcoredbg = {
|
|
||||||
type = "executable",
|
|
||||||
command = "netcoredbg",
|
|
||||||
args = { "--interpreter=vscode" },
|
|
||||||
}
|
|
||||||
|
|
||||||
-- @type DapAdapter
|
|
||||||
dap.adapters.godot = {
|
dap.adapters.godot = {
|
||||||
type = "server",
|
type = "server",
|
||||||
host = "127.0.0.1",
|
host = "127.0.0.1",
|
||||||
port = 6006,
|
port = 6006,
|
||||||
}
|
}
|
||||||
|
|
||||||
-- @type DapConfiguration
|
---@type dap.Configuration[]
|
||||||
dap.configurations.rust = {
|
dap.configurations.rust = {
|
||||||
{
|
{
|
||||||
name = "Launch file",
|
name = "Launch file",
|
||||||
|
@ -129,7 +122,7 @@ dap.configurations.rust = {
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
-- @type DapConfiguration
|
---@type dap.Configuration[]
|
||||||
dap.configurations.cpp = {
|
dap.configurations.cpp = {
|
||||||
{
|
{
|
||||||
name = "Launch file",
|
name = "Launch file",
|
||||||
|
@ -157,29 +150,7 @@ dap.configurations.cpp = {
|
||||||
|
|
||||||
dap.configurations.c = dap.configurations.cpp
|
dap.configurations.c = dap.configurations.cpp
|
||||||
|
|
||||||
-- @type DapConfiguration
|
---@type dap.Configuration[]
|
||||||
dap.configurations.cs = {
|
|
||||||
{
|
|
||||||
type = "netcoredbg",
|
|
||||||
name = "Launch DLL",
|
|
||||||
request = "launch",
|
|
||||||
program = function()
|
|
||||||
return vim.fn.input("Path to dll", vim.fn.getcwd() .. "/bin/Debug/", "file")
|
|
||||||
end,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
type = "netcoredbg",
|
|
||||||
name = "Attach to debugger",
|
|
||||||
request = "attach",
|
|
||||||
program = function()
|
|
||||||
return vim.fn.input("Path to dll", vim.fn.getcwd() .. "/bin/Debug/", "file")
|
|
||||||
end,
|
|
||||||
pid = "${command:pickProcess}",
|
|
||||||
cwd = "${workspaceFolder}",
|
|
||||||
},
|
|
||||||
}
|
|
||||||
|
|
||||||
-- @type DapConfiguration
|
|
||||||
dap.configurations.gdscript = {
|
dap.configurations.gdscript = {
|
||||||
{
|
{
|
||||||
name = "Launch scene",
|
name = "Launch scene",
|
||||||
|
|
Loading…
Reference in a new issue