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

fix: fix starlark debugger broken in release 0.11.0 (#432) #433

Merged

Conversation

dpar39
Copy link
Contributor

@dpar39 dpar39 commented Jan 29, 2025

This PR fixes starlark debugging which is broken in release 0.11.0 #432. The debugger program currently fails to start because it can't import vscode. In addition, it also fixes hovering over symbols with starlark debugger respond with errors because symbols are not defined.

@dpar39 dpar39 changed the title Fix starlark debugger broken in release 0.11.0 Fix starlark debugger broken in release 0.11.0 (#432) Jan 29, 2025
@dpar39 dpar39 changed the title Fix starlark debugger broken in release 0.11.0 (#432) bugfix: fix starlark debugger broken in release 0.11.0 (#432) Jan 29, 2025

const value = (
await this.bazelConnection.sendRequest({
try {
Copy link
Contributor Author

@dpar39 dpar39 Jan 29, 2025

Choose a reason for hiding this comment

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

This try ... catch is needed to avoid that when hovering over starlark code, vscode automatically requests 'evaluation' of the statement under mouse cursor. Without it, starlark EvaluateResponses such as:

sequence_number: 33
error {
  message: "name \'target\' is not defined"
}

causes the debugger program to crash.

On another note, I can't find how to evaluate variables like target or ctx on the debugger. I see the evaluate request takes the thread_id and the statement, but I can only successfully evaluate in the global scope of the current thread, i.e., cannot evaluate call stack local variables. Is this a limitation of the Starlark debugger or something we are missing in the adapter?

@cameron-martin cameron-martin changed the title bugfix: fix starlark debugger broken in release 0.11.0 (#432) fix: fix starlark debugger broken in release 0.11.0 (#432) Feb 1, 2025
@cameron-martin cameron-martin merged commit b83b99c into bazel-contrib:master Feb 1, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants