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

Add on_config hooks to dap.providers #1241

Merged
merged 5 commits into from
May 31, 2024
Merged

Add on_config hooks to dap.providers #1241

merged 5 commits into from
May 31, 2024

Conversation

mfussenegger
Copy link
Owner

No description provided.

Example:
>lua
local dap = require("dap")
dap.providers.on_config["dummy-noop"] = function(config)
Copy link
Owner Author

@mfussenegger mfussenegger May 30, 2024

Choose a reason for hiding this comment

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

I'm still not sure about the overall naming. Other options:

  • dap.ext.on_config and dap.ext.configs
  • dap.ext.on_config and dap.ext.config_providers
  • dap.config_providers and dap.config_hooks

I'd kinda like having a namespace because I have in mind of also adding variable-placeholder-processors and later on likely variable formatters for the REPL and widgets.

Copy link
Owner Author

Choose a reason for hiding this comment

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

Moving it to dap.listeners.on_config: #1248

Makes the implementation a bit simpler. Given that the function is
called from a coroutine it is still possible to use coroutine.running(),
coroutine.resume() and coroutine.yield() within it for async operations.
@mfussenegger
Copy link
Owner Author

I'm going ahead and merge this but this doesn't mean that the API is final and I'd still very much appreciate feedback about it.

@mfussenegger mfussenegger merged commit b22b3f6 into master May 31, 2024
16 checks passed
@mfussenegger mfussenegger deleted the more-types branch May 31, 2024 16:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant