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

Static and global variables are not evaluated without namespace #55

Closed
GloriousPtr opened this issue Jan 16, 2024 · 9 comments
Closed
Labels
Feature Request A request for a new feature or improvement.

Comments

@GloriousPtr
Copy link
Contributor

  • 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 GloriousPtr changed the title some variables are not evaluated without namespace Static and global variables are not evaluated without namespace Jan 16, 2024
@ryanfleury ryanfleury added the Feature Request A request for a new feature or improvement. label Jan 18, 2024
@ryanfleury
Copy link
Collaborator

Fixed as of f48d843.

@GloriousPtr
Copy link
Contributor Author

GloriousPtr commented Jan 21, 2024

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

@ryanfleury ryanfleury reopened this Jan 21, 2024
@GloriousPtr
Copy link
Contributor Author

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

@ryanfleury
Copy link
Collaborator

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.

@GloriousPtr
Copy link
Contributor Author

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

@ryanfleury
Copy link
Collaborator

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.

@GloriousPtr
Copy link
Contributor Author

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

@ryanfleury
Copy link
Collaborator

Great. As of 66b5678, 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 ed7d31d, hover evaluation & Alt+W will account for scope resolution operators in its "expression range forming" path, so that should fix that separate issue.

@GloriousPtr
Copy link
Contributor Author

Everything works perfectly, thanks for the fixes!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature Request A request for a new feature or improvement.
Projects
None yet
Development

No branches or pull requests

2 participants