generated from ellisonleao/nvim-plugin-template
-
-
Notifications
You must be signed in to change notification settings - Fork 19
Open
Labels
contributions welcomeenhancementNew feature or requestNew feature or requestgood first issueGood for newcomersGood for newcomers
Description
nvim-dap-view supports highlighting a variable based on its type in the watches and scopes views. The highlighting is pretty basic, but it should already cover primitive types. However, it could be enhanced in two ways:
- Adding support for adapter-specific types. Some languages use slightly different naming conventions for types (e.g., in Python a string is
str). The current mapping isn't really extensive in this regard. However, you can easily contribute if you encounter an unmapped type:- Get the actual type name by using
:=require"dap-view.state".watched_expressions. It fetches all "watches related" data, so it might be long. Thetypeproperty lives inside a response or variable object, it shouldn't be hard to find. If you get lost, you can use:messagesto search fortype. - Submit a PR with the new mapping. You can take a look at this commit. Please, avoid introducing new highlight groups. Add a comment describing where the
typecan be found (e.g., "None" withdebugpy).
- Get the actual type name by using
- Parsing more complex types. I'm not sure how can this be done realistically as, AFAIK, there's no standard (in the protocol) that describes a variables' "raw" value. But perhaps it can be done "heuristically" for "not that complex" types (e.g., lists or dicts). If you have any ideas for that, leave them below.
The protocol outlines some "advanced" hints which we could use as well. For instance, there's an attribute that marks a variable as read only. But I'm not sure how it could be displayed on nvim-dap-view's side? I'm open to ideas on this front too.
Metadata
Metadata
Assignees
Labels
contributions welcomeenhancementNew feature or requestNew feature or requestgood first issueGood for newcomersGood for newcomers