-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
#10027 Support EvaluatableExpressions #11484
Conversation
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 believe the implementation is correct, but while testing, I discovered a problem with the implementation of our DebugHoverWidget
. I tested this PR using this plugin and this debugger with the InlineValueProvider
code removed to allow it to activate.
As far as I can tell, all of the EvaluatableExpression code ran as expected - the plugin code was called, the returns were correct - but the DebugHoverWidget never appeared. It seems that when this code runs
theia/packages/debug/src/browser/editor/debug-hover-source.tsx
Lines 49 to 56 in 0c0f8c7
async evaluate(expression: string): Promise<ExpressionItem | DebugVariable | undefined> { | |
const evaluated = await this.doEvaluate(expression); | |
const elements = evaluated && await evaluated.getElements(); | |
this._expression = evaluated; | |
this.elements = elements ? [...elements] : []; | |
this.fireDidChange(); | |
return evaluated; | |
} |
elements
is undefined, and so there is nothing to render when the DebugHoverWidget
requests elements
theia/packages/debug/src/browser/editor/debug-hover-source.tsx
Lines 35 to 37 in 0c0f8c7
getElements(): IterableIterator<TreeElement> { | |
return this.elements[Symbol.iterator](); | |
} |
and so the DebugHoverWidget
does not appear. In VSCode, by contrast, the widget does appear and renders the text as returned by the debugger.
Thanks for your comments @colin-grant-work! About the As I mentioned in the description, for the Java case, the debugging session and the hover widget are working fine for me. |
@ndoschek, I see the problems you mention - I'm not sure what's going on there, and it should be investigated elsewhere - but it looks like it's still possible to step though, so it's possible to stop on any line you'd like, even without a breakpoint. The inability to exit the session is a bummer. I tried moving back to commit |
Thanks @colin-grant-work, that's way better now, I'll have another look at the mentioned issue! |
@ndoschek, I definitely think that the problems with the hover widget ought to be fixed, and the problems with the mock debug extension investigated, but in principle both are separate from the work you've done. If you'd prefer to pursue the fix for the hover widget in a separate PR, I think the plugin side of this PR is correct and complete and could be merged. |
- Implement support for plugins providing evalutable epressions - Update the debug hover widget to consume evaluatable expressions from the registered providers. Keep the former implementation of guessing the expression from the current line as fallback. Contributed on behalf of STMicroelectronics Signed-off-by: Nina Doschek <ndoschek@eclipsesource.com> Fixes eclipse-theia#10027
Hi @colin-grant-work, |
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.
The implementation of the EvaluatableExpressionProvider
API is complete and correct. 👍
What it does
Contributed on behalf of STMicroelectronics
Signed-off-by: Nina Doschek ndoschek@eclipsesource.com
Fixes #10027
How to test
To test, I created a simple evalutable expression provider for the
java
language, available via the custom vscode extension: evaluatable-expression-extension-10027-0.0.1.zipLanguage Support for Java(TM) by Red Hat
(identifier:redhat.java
) andDebugger for Java
(identifier:vscjava.vscode-java-debug
) from the Open VSX Registry (Extensions
view) in your Theia test workspace.On startup, it will show an information message that the provider was registered.
evaluatable-expression-extension-10027.vsix
in your Theia test workspace (viaExtensions
view - top menu barMore actions...
- Install from VSIX).Simple Test application
Launch config
logMessage
, the extension shows an information message with the cursor position and the provided word range of the expression.e.g.
[TestEvaluatableExpressionExtension] provide word range for position { "line": 6, "character": 26 } > [ { "line": 6, "character": 19 }, { "line": 6, "character": 29 } ]
Review checklist
Reminder for reviewers