-
-
Notifications
You must be signed in to change notification settings - Fork 311
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
plugins/dap-rr: init #3089
Merged
Merged
plugins/dap-rr: init #3089
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
{ lib, ... }: | ||
let | ||
inherit (lib) types; | ||
inherit (lib.nixvim) defaultNullOpts; | ||
in | ||
lib.nixvim.plugins.mkNeovimPlugin { | ||
name = "dap-rr"; | ||
packPathName = "nvim-dap-rr"; | ||
package = "nvim-dap-rr"; | ||
|
||
maintainers = [ lib.maintainers.GaetanLepage ]; | ||
|
||
settingsOptions = { | ||
mappings = | ||
defaultNullOpts.mkAttrsOf types.str | ||
{ | ||
continue = "<F7>"; | ||
step_over = "<F8>"; | ||
step_out = "<F9>"; | ||
step_into = "<F10>"; | ||
reverse_continue = "<F19>"; | ||
reverse_step_over = "<F20>"; | ||
reverse_step_out = "<F21>"; | ||
reverse_step_into = "<F22>"; | ||
step_over_i = "<F32>"; | ||
step_out_i = "<F33>"; | ||
step_into_i = "<F34>"; | ||
reverse_step_over_i = "<F44>"; | ||
reverse_step_out_i = "<F45>"; | ||
reverse_step_into_i = "<F46>"; | ||
} | ||
'' | ||
Keyboard mappings for nvim-dap-rr. | ||
''; | ||
}; | ||
|
||
settingsExample = { | ||
mappings = { | ||
continue = "<f4>"; | ||
step_over = "<f10>"; | ||
step_out = "<f8>"; | ||
step_into = "<f11>"; | ||
reverse_continue = "<f4>"; | ||
reverse_step_over = "<s-f10>"; | ||
reverse_step_out = "<s-f8>"; | ||
reverse_step_into = "<s-f11>"; | ||
}; | ||
}; | ||
|
||
# Manually supplied to nvim-dap config module | ||
callSetup = false; | ||
extraConfig = cfg: { | ||
plugins.dap = { | ||
enable = true; | ||
extensionConfigLua = '' | ||
require("nvim-dap-rr").setup(${lib.nixvim.toLuaObject cfg.settings}) | ||
''; | ||
configurations = { | ||
rust = lib.mkDefault [ { __raw = "require('nvim-dap-rr').get_rust_config()"; } ]; | ||
cpp = lib.mkDefault [ { __raw = "require('nvim-dap-rr').get_config()"; } ]; | ||
}; | ||
}; | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
{ | ||
empty = { | ||
plugins = { | ||
dap.enable = true; | ||
dap-rr.enable = true; | ||
}; | ||
}; | ||
|
||
defaults = { | ||
plugins = { | ||
dap.enable = true; | ||
dap-rr = { | ||
enable = true; | ||
|
||
settings = { | ||
mappings = { | ||
continue = "<F7>"; | ||
step_over = "<F8>"; | ||
step_out = "<F9>"; | ||
step_into = "<F10>"; | ||
reverse_continue = "<F19>"; | ||
reverse_step_over = "<F20>"; | ||
reverse_step_out = "<F21>"; | ||
reverse_step_into = "<F22>"; | ||
step_over_i = "<F32>"; | ||
step_out_i = "<F33>"; | ||
step_into_i = "<F34>"; | ||
reverse_step_over_i = "<F44>"; | ||
reverse_step_out_i = "<F45>"; | ||
reverse_step_into_i = "<F46>"; | ||
}; | ||
}; | ||
}; | ||
}; | ||
}; | ||
|
||
example = { | ||
plugins = { | ||
dap.enable = true; | ||
dap-rr = { | ||
enable = true; | ||
|
||
settings = { | ||
mappings = { | ||
continue = "<f4>"; | ||
step_over = "<f10>"; | ||
step_out = "<f8>"; | ||
step_into = "<f11>"; | ||
reverse_continue = "<f4>"; | ||
reverse_step_over = "<s-f10>"; | ||
reverse_step_out = "<s-f8>"; | ||
reverse_step_into = "<s-f11>"; | ||
}; | ||
}; | ||
}; | ||
}; | ||
}; | ||
} |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we set up the
configurationType
so that a string would be automatically converted to lua?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Initial reaction: I'd assume not, since we want to gradually move away from such implicit conversion?
Saying that, this is a non-freeform option (right?), so we can design it to be more helpful if we wanted.
If we aren't trying to exactly represent an upstream setting and it's unlikely that non-raw string values will ever be valid, then treating strings as lua is fine IMO.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was exactly my reasoning.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, I gave it a try and it adds more complexity than I thought.
As
dap-go
anddap-python
both use this type, we would need to port the conversion logic there too.Maybe it is better to stick to using the
rawType
straight.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, if we did this we'd want to construct two types; one for use in freeform settings and another one that can be used in nixvim's own options.
Both types could use the same modules in their submodule-type though.