-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
dap: strip package paths from variable types #3516
Comments
It is. Gdlv does something like this but it doesn't work in all cases with generics, if it's the type is too complicated it gives up: https://github.com/aarzilli/gdlv/blob/master/internal/prettyprint/short.go |
@aarzilli This is very helpful, thanks. Would you be ok with reusing that code here? However, when I said I need help I didn't only mean the algorithm to shorten the types, but also where in the code to do this. I suppose it needs to be in various places inside of |
yes
I think it's just getTypeIfSupported |
I had hoped so too, but unfortunately that's not enough. |
cc @suzmue |
I looked into this some more, and if I'm not mistaken this can't be fixed in It would be fantastic if a more experienced developer would have the time to look into this and give some guidance; like #3500, it would be a big usability improvement. |
prettyprint is used in several places, it can't be changed unconditionally, but it would be fine to add a flag to it, to simplify type names. |
This would definitely be a big improvement. We have a similar request filed in the vscode-go extension issue tracker: golang/vscode-go#2569 I have a similar wip change that removes the types altogether, but that may be a more controversial change. Shortening the type names would probably need to touch the same places in the code: master...suzmue:delve:vartyps |
Here's a PR: #3535 |
Now that we strip paths from function names in the stacktrace view (since #3500), I want the same for the types of variables in the variables view.
Here's a simple example. With a reasonably sized side bar, I can't see any variable names or values, only the beginnings of the paths:
This is how ridiculously wide I would have to make the side bar so that I can see variable names and values (impractical on a laptop screen):
This is what I would like to see instead:
I'd be interested in working on this, but it looks a lot less straighforward than #3500 was, so I'd need some guidance.
The text was updated successfully, but these errors were encountered: