-
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
Fix displaying of host values in chrome devtools #11468
base: develop
Are you sure you want to change the base?
Conversation
public TestWatcher testWatcher = | ||
new TestWatcher() { | ||
@Override | ||
protected void failed(Throwable e, Description description) { |
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.
Interesting. If this could be the default for defaultContextBuilder
.
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.
I was thinking the same way. But I am afraid that in order to implement this, ContextUtils would need to be an abstract class and all the test classes would need to extend it.
HostMethodCallNode.getPolyglotCallType(value, symbol, interopUncached); | ||
try { | ||
switch (polyglotCallType) { | ||
case CONVERT_TO_DATE -> { |
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.
Here is the main idea. Chrome inspector instrument builds DebugLocalScope
which holds a materialized frame with all the bindings. If a binding is a host object that can/should be converted to an appropriate Enso builtin type before sending back to the inspector, it is converted here. This is pretty much the same kind of conversion that is done inside InvokeMethodNode on the self
argument before any kind of method dispatch is done.
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.
- I'd expand this to other languages than Java - e.g. Python & co.
- I don't understand the different between
PolyglotCall
& the otherenum
- I still believe the code should be in
EnsoLanguage.getLanguageView
engine/runtime-integration-tests/src/test/java/org/enso/interpreter/test/DebuggingEnsoTest.java
Show resolved
Hide resolved
...ne/runtime/src/main/java/org/enso/interpreter/node/callable/resolver/HostMethodCallNode.java
Outdated
Show resolved
Hide resolved
engine/runtime/src/main/java/org/enso/interpreter/runtime/scope/DebugLocalScope.java
Outdated
Show resolved
Hide resolved
engine/runtime/src/main/java/org/enso/interpreter/runtime/scope/DebugLocalScope.java
Outdated
Show resolved
Hide resolved
engine/runtime/src/main/java/org/enso/interpreter/runtime/scope/DebugLocalScope.java
Outdated
Show resolved
Hide resolved
engine/runtime-integration-tests/src/test/java/org/enso/interpreter/test/DebuggingEnsoTest.java
Show resolved
Hide resolved
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.
Having all of this in getLanguageView
should show beneficial in the future. Hopefully.
} | ||
|
||
@ExportMessage | ||
Class<? extends TruffleLanguage<?>> getLanguage() { |
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.
Can we add a test (based on ValuesGenerator
that verifies all values of EnsoObject
respond to this message?
Blocked by #11538 |
How exactly this is blocked by ? |
The test in enso/engine/runtime-integration-tests/src/test/java/org/enso/interpreter/test/WarningsTest.java Line 148 in 339c275
v.getMetaObject() on that value returns non-null, but on develop it returns null. And for some reason, warning2.getMetaObject() returns null, thus the test fails. I figured out it would be just easier to first ensure that we stick to correct Truffle contracts and do that in a separate PR.
|
# Conflicts: # engine/runtime-integration-tests/src/test/java/org/enso/interpreter/test/WarningsTest.java
…age. This is a fix after merge of develop.
Primitive values is expected not to have meta object.
assertThat("Is a number", longVal.isNumber(), is(true)); | ||
assertThat("Does not fit in int", longVal.fitsInInt(), is(false)); | ||
assertThat("Fits in long", longVal.fitsInLong(), is(true)); | ||
assertThat("Does not fit in double (but could)", longVal.fitsInDouble(), 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 is surprising. A value that fits in Long
, but does not fit in Double
(according to Enso) ??
Note that all of these 3 tests pass in develop
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.
Fixes #7890
Pull Request Description
Chrome inspector now displays polyglot objects that have a corresponding Enso builtin type as enso objects:
Important Notes
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.
or the Snowflake database integration, a run of the Extra Tests has been scheduled.