-
Notifications
You must be signed in to change notification settings - Fork 646
Pointer variable debugger issues #2176
Comments
@brycekahle, thoughts? |
This is how VS Code displays variables. It wants a name and value, but there is no name for the dereferenced value. I mentioned this design choice in the original PR and it was deemed good enough.
Incompatible in what way? They are not identical, but AFAIK this issue is about design decisions and doesn't impact functionality in any way.
IMHO we should leave the type information in. It may not be obvious from the code what the type is. The debugger is helping here by removing ambiguity. We show type information for other variables as well ( |
I'm not sure what value there is in having a separate line for the dereferenced value. Is it possible to omit the dereferenced value and display the fields directly under the pointer? For example, instead of having:
would it work to have this instead:
This is explained by the sentence that follows it about how different cases are displayed:
Pointer values are integers too, just like the
OK, so then shouldn't we display |
A trivial amount of value is in showing the unambiguous data relationship. It is definitely possible to display it, as in your 2nd example. This would be more difficult than the original changes I made, but not impossible. I'd be happy to review your PR if you wanted to attempt that change.
Incompatible, for me, indicates some sort of functionality issue. IMHO Displaying pointers differently than simple types, is not an incompatibility.
Perhaps, but that is far beyond the scope of the original request in #1989, which was to improve the display of pointer values. I did not change the existing display behavior for other types. |
OK, good to know. Thanks.
Inconsistent might have been a better word for it. As the issue description said, the feature worked for me, assuming the single colon was working as intended.
That's what this issue is about, aside from the colon question. Since the colon is fine, this issue doesn't have to hold up shipping #1989 as-is, but the part about consistency is still unresolved, it seems. |
Hello all, We are in the midst of a repo move, see We are moving section in our readme for more details. Please subscribe to golang/vscode-go#112 for further updates on this issue. Thanks for all the support & Happy Coding! |
The fix for #1989 worked for me (see #2164 (comment)), although the dereferenced pointer value is labeled with a single colon, which might be a bug. See the b variable below:
The debugger presentation of the pointer type seems incompatible with the other integral types (variables i and x in the example above).
int(0)
is displayed asi: 0
,X(34)
(where X istype X int
) is displayed asx: 34
, but(*int)(0xc0000160f8)
is displayed asp: <*int>(0xc0000160f8)
. Maybe it makes sense to display it as justp: 0xc0000160f8
and let the user infer the type from the code like for the other variable types (and the presence of the drill down menu)?The text was updated successfully, but these errors were encountered: