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

Don't show non-instantiated variables #2061

Merged
merged 5 commits into from
Mar 31, 2023
Merged

Conversation

elliette
Copy link
Contributor

@elliette elliette commented Mar 30, 2023

Fixes #2060
Work towards #2056

See screenshots below:

When paused at:

Screenshot 2023-03-30 at 12 50 34 PM

With this change:

Screenshot 2023-03-30 at 12 50 42 PM

  • name is not shown (this matches the behavior of vm_service)
  • count is null (as expected)
  • first and second are not shown (as expected)

Without this change:

Screenshot 2023-03-30 at 12 55 03 PM

  • name is shown and is null (does not match vm_service implementation!)
  • first and second are shown as null (not expected!)

Copy link
Contributor

@annagrin annagrin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks Elliott, adding tests would be awesome!

@@ -67,6 +67,8 @@ Future<List<Property>> visibleProperties({
if (value == null) return true;

final type = value.type;
if (type == 'undefined') return true;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think correct behavior according to the vm_service protocol is to have sentinel instead of an InstanceRef, but that would require more work and can be postponed to later.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah nice! We can track in #2056

@elliette
Copy link
Contributor Author

Thanks Elliott, adding tests would be awesome!

Added a couple test cases!

Copy link
Contributor

@annagrin annagrin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LTGM!

@elliette elliette merged commit b139649 into dart-lang:master Mar 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Pausing at breakpoint shows variables that have not yet been instantiated (patterns)
2 participants