raddebugger icon indicating copy to clipboard operation
raddebugger copied to clipboard

Static and global variables are not evaluated without namespace

Open GloriousPtr opened this issue 1 year ago • 3 comments

  • Static and global variables are not evaluated without namespace even though the cursor is in the same namespace. (issue persists with mouse hover)
  • Class static variables are not evaluated on mouse hover.

image image

GloriousPtr avatar Jan 16 '24 21:01 GloriousPtr

Fixed as of f48d8431c0b0940136a9756a34cf1fdb833bbf40.

ryanfleury avatar Jan 20 '24 02:01 ryanfleury

Mouse hover over static variable in class still shows wrong value image

GloriousPtr avatar Jan 21 '24 00:01 GloriousPtr

Another note (maybe helpful): clicking Alt+W while cursor on Line 24 adds b to watch window instead of Test::b.

GloriousPtr avatar Jan 21 '24 00:01 GloriousPtr

Can you try this again on the latest commits? I've fixed some things w.r.t. global evaluation, and want to see if this is another manifestation of those bugs.

ryanfleury avatar Jan 25 '24 05:01 ryanfleury

Built 96b0dd078330cb0e17f9ef66eab6228b58e1da58 Seems to be broken again, nothing on hover over the static and global variables. Screenshot 2024-01-25 105007

GloriousPtr avatar Jan 25 '24 10:01 GloriousPtr

This is not the same test as original, as you're inside of NS::Log::Trace rather than NS::Func, so it isn't really testing what I was hoping to fix. But it did raise that other issue (e.g. nested namespaces), so I'll go ahead and fix that as well.

ryanfleury avatar Jan 25 '24 13:01 ryanfleury

Oh okay, I tested with original code. Everything in watch seems to work perfectly for this case. Hover on Test::b doesn't show the value and Alt+W over that line adds b to the watch window. image

GloriousPtr avatar Jan 25 '24 14:01 GloriousPtr

Great. As of 66b56789c6898049b994fdc7af5b2f99d53915ac, nested namespaces should now work, with the eval system's parser prioritizing more deeply nested namespace prefixes, then falling back on shallower ones. So inside of Foo::Bar::Baz, if X does not resolve to anything local, it will try to resolve as Foo::Bar::X first, then Foo::X.

As of ed7d31d7eafb4892e92c0ffc3e6b3a2f53f38ed0, hover evaluation & Alt+W will account for scope resolution operators in its "expression range forming" path, so that should fix that separate issue.

ryanfleury avatar Jan 25 '24 14:01 ryanfleury

Everything works perfectly, thanks for the fixes!

GloriousPtr avatar Jan 25 '24 14:01 GloriousPtr