Add dap_enrich_config to pass enrich_config to dap adapter config #522
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.
DAP suggests passing an
enrich_config
function to the adapter configuration to allow "hydrating" the launch.json configuration in case it contains anenvFile
, eg. mfussenegger/nvim-dap#548 (comment)It can also be useful to expose this function given that
dap.adapters.go
gets overwritten bygo.nvim
. https://github.com/mfussenegger/nvim-dap/blob/8517126e9323e346f6a99b3b594c5a940b914dcd/doc/dap.txt#L199-L220If nil, the enrich_config function is ignored, so we're going to default to that: https://github.com/mfussenegger/nvim-dap/blob/8517126e9323e346f6a99b3b594c5a940b914dcd/lua/dap.lua#L458
The motivation for me is that calling
GoEnv
depending on which launch configuration I select is a bit cumbersome, especially when different configurations specify different envFiles.