Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

launch.json support changes #156

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions lua/dap/ext/vscode.lua
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,11 @@ function M.load_launchjs(path)
assert(data.configurations, "launch.json must have a 'configurations' key")
for _, config in ipairs(data.configurations) do
assert(config.type, "Configuration in launch.json must have a 'type' key")
local configurations = dap.configurations[config.type]
local config_key = config.nvimKey or config.type
local configurations = dap.configurations[config_key]
if not configurations then
configurations = {}
dap.configurations[config.type] = configurations
dap.configurations[config_key] = configurations
end
table.insert(configurations, config)
end
Expand Down
6 changes: 3 additions & 3 deletions lua/dap/session.lua
Original file line number Diff line number Diff line change
Expand Up @@ -732,9 +732,9 @@ end
function Session:initialize(config)
self.config = config
self:request('initialize', {
clientId = 'neovim';
clientname = 'neovim';
adapterID = 'nvim-dap';
clientID = config.clientID or 'neovim';
clientName = config.clientName or 'neovim';
adapterID = config.type or 'nvim-dap';
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we think about incorporating this line at least? It would make defining the adapter for cppdbg a lot easier.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you explain why this would make defining the cppdbg adapter easier?

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, it removes the necessity for the step

* Copy extension/cppdbg.ad7Engine.json to extension/debugAdapters/bin/nvim-dap.ad7Engine.json

on this page.

This is helpful because you might want to install cppdbg via a system package manager or something, and don't want to be messing around in system directories like this. Especially helpful if you're using the nix package manager too like me

Copy link
Owner

@mfussenegger mfussenegger Aug 9, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've created a PR that allows to add a id property to the adapter definition: #264 / ccf14ca

pathFormat = 'path';
columnsStartAt1 = true;
linesStartAt1 = true;
Expand Down