You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to use netcoredbg from neovim through nvim-dap and I get the following errors when debuging a simple ASP.NET Core Web API template project on Windows:
Error executing vim.schedule lua callback: ...ppData/Local/nvim-data/lazy/nvim-dap/lua/dap/session.lua:983: Expected value but found invalid escape code at character 209
stack traceback:
[C]: in function 'json_decode'
...ppData/Local/nvim-data/lazy/nvim-dap/lua/dap/session.lua:983: in function 'handle_body'
...ppData/Local/nvim-data/lazy/nvim-dap/lua/dap/session.lua:1479: in function 'fn'
vim/_editor.lua:351: in function <vim/_editor.lua:350>
Error executing vim.schedule lua callback: ...ppData/Local/nvim-data/lazy/nvim-dap/lua/dap/session.lua:983: Expected value but found invalid escape code at character 217
stack traceback:
[C]: in function 'json_decode'
...ppData/Local/nvim-data/lazy/nvim-dap/lua/dap/session.lua:983: in function 'handle_body'
...ppData/Local/nvim-data/lazy/nvim-dap/lua/dap/session.lua:1479: in function 'fn'
vim/_editor.lua:351: in function <vim/_editor.lua:350>
Error executing vim.schedule lua callback: ...ppData/Local/nvim-data/lazy/nvim-dap/lua/dap/session.lua:983: Expected value but found invalid escape code at character 201
stack traceback:
[C]: in function 'json_decode'
...ppData/Local/nvim-data/lazy/nvim-dap/lua/dap/session.lua:983: in function 'handle_body'
...ppData/Local/nvim-data/lazy/nvim-dap/lua/dap/session.lua:1479: in function 'fn'
vim/_editor.lua:351: in function <vim/_editor.lua:350>
Error executing vim.schedule lua callback: ...ppData/Local/nvim-data/lazy/nvim-dap/lua/dap/session.lua:983: Expected value but found invalid escape code at character 212
stack traceback:
[C]: in function 'json_decode'
...ppData/Local/nvim-data/lazy/nvim-dap/lua/dap/session.lua:983: in function 'handle_body'
...ppData/Local/nvim-data/lazy/nvim-dap/lua/dap/session.lua:1479: in function 'fn'
vim/_editor.lua:351: in function <vim/_editor.lua:350>
I added a few traces in nvim-dap's session.lua and found the problematic JSON body:
Note the unescaped backslashes in the path of the source file. Looking at the code of netcoredgb, it seems that it could easily be fixed by wrapping source.path in an EscapedString<JSON_escape_rules> within serialize_output in src/protocol/vscodeprotocol.cpp.
I have tested this fix on my side and it works, I can submit a PR if needed.
Just for the record, here is my nvim-dap configuration:
local dap = require("dap")
dap.adapters["coreclr"] = {
type = "executable",
command = vim.fn.exepath("netcoredbg"),
args = { "--interpreter=vscode" },
options = {
detached = false,
},
}
dap.configurations["cs"] = {
{
type = "coreclr",
name = "Debug C# App",
request = "launch",
program = function()
return vim.fn.input("Path to dll", vim.fn.getcwd() .. "/bin/Debug/", "file")
end,
},
}
And I created my C# App using dotnet new webapi -o WebApi1.
The text was updated successfully, but these errors were encountered:
Description
I'm trying to use netcoredbg from neovim through nvim-dap and I get the following errors when debuging a simple ASP.NET Core Web API template project on Windows:
I added a few traces in nvim-dap's session.lua and found the problematic JSON body:
Note the unescaped backslashes in the path of the source file. Looking at the code of netcoredgb, it seems that it could easily be fixed by wrapping
source.path
in anEscapedString<JSON_escape_rules>
withinserialize_output
in src/protocol/vscodeprotocol.cpp.I have tested this fix on my side and it works, I can submit a PR if needed.
Just for the record, here is my nvim-dap configuration:
And I created my C# App using
dotnet new webapi -o WebApi1
.The text was updated successfully, but these errors were encountered: