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

When a debug session is not active, edits made to watch expressions are not immediately shown #12605

Closed
sophiali23 opened this issue Jun 9, 2023 · 2 comments · Fixed by #12627
Labels
debug issues that related to debug functionality

Comments

@sophiali23
Copy link
Contributor

Bug Description:

When I don't have a debug session started, I notice that when I edit a watch expression, the updated expression is not shown until I click on the expression again.

Steps to Reproduce:

  1. Make sure you don't have a debug session running. Add a watch expression.
  2. Edit that watch expression.
  3. Observe that the old expression is still shown.
  4. Click on the expression. The updated expression should now be shown.

Additional Information

I believe it's caused by this block here: https://github.com/eclipse-theia/theia/blob/master/packages/debug/src/browser/view/debug-watch-expression.tsx#L45-L47
The function returns immediately when there is no debug session, so this.options.onDidChange(); is not called.

My colleague suggested the following change:

    protected override setResult(body?: DebugProtocol.EvaluateResponse['body'], error?: string): void {
       if (this.options.session()) {
            super.setResult(body, error);
            this.isError = !!error;
        }
        this.options.onDidChange();
    }
  • Operating System: Linux
  • Theia Version: 1.36.0
@vince-fugnitto vince-fugnitto added the debug issues that related to debug functionality label Jun 12, 2023
@vince-fugnitto
Copy link
Member

@sophiali23 thank you for reporting the bug, are you interested in contributing a pull-request to fix it?

@sophiali23
Copy link
Contributor Author

@vince-fugnitto thanks for getting back to me! Yes, I'll open up a PR with the fix.

sophiali23 added a commit to sophiali23/theia that referenced this issue Jun 16, 2023
…hether or not there is a debug session active so the updated expression can always be shown in UI. Fixes issue eclipse-theia#12605

Signed-off-by: Sophia Li <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
debug issues that related to debug functionality
Projects
None yet
2 participants