-
Notifications
You must be signed in to change notification settings - Fork 323
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
Show only fields from current atom constructor in the debugger #11217
Conversation
engine/runtime/src/main/java/org/enso/interpreter/runtime/data/atom/Atom.java
Outdated
Show resolved
Hide resolved
Cannot invoke non-existing members (fields from other constructor)
Request for comments @radeusgd @jdunkerley @GregoryTravis @JaroslavTulach @hubertp @4e6 and anybody else using Chrome Inspector for debugging. Atom now has methods as members. This means that all the methods will be (alphabetically) displayed in the debugger: An advantage of it is that, inside the console, tab completion works: There may be a way to hide the methods from the debugger, display only fields, with the tab completion in the console still working. What are your opinions? Is the list of methods (displayed alphabetically) on the atom something that you consider useful? Let's vote:
|
Return list of public methods
If we can still get tab completions for methods without displaying them, IMO that's best. Displaying methods, where their representation is just It's nice to see method names, but if as you say - tab completions still help with those - that will be IMO enough. |
The current situation is as follows:
I don't know how to convince the inspector to not display internal members, and to provide proper tab completion. However, as you can see from the screenshot above, the situation is at least better than before - all methods are in gray and so you can immediately see the "important stuff". Unless there are strong opinions against, I would like to merge this PR and optionally create new tickets to improve the debugging experience. I believe the promised fix of this PR is delivered. |
Sounds good. I need to convince myself to use the debugger more, since it's getting such cool new features 😃 |
They are internal, other languages should deal with that in their own way.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approving .enso changes.
engine/runtime/src/main/java/org/enso/interpreter/runtime/data/atom/GetFieldWithMatchNode.java
Outdated
Show resolved
Hide resolved
engine/runtime/src/main/java/org/enso/interpreter/runtime/data/atom/AtomConstructor.java
Show resolved
Hide resolved
} | ||
} | ||
return false; | ||
// All methods are internal. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That appears to contradict InteropLibrary.isMemberInternal
which says the default is false
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This method returns false
only for fields of a public constructor. All the other members, including all methods, are considered internal. That is, fields are "public members", methods are internal members. This is compatible with what we used to have before #9692.
Fixes #10675
Pull Request Description
Debugger shows only fields of the current atom constructor: (internal members shown in gray, "public" members shown in bold purple)
(Note that
static_method
is not displayed as a member ofMy_Type
- not in scope of this PR)Important Notes
The interop contract for
Atom
is changed as follows:Checklist
Please ensure that the following checklist has been satisfied before submitting the PR:
Scala,
Java,
TypeScript,
and
Rust
style guides. In case you are using a language not listed above, follow the Rust style guide.