mirror of
https://github.com/godotengine/godot-vscode-plugin.git
synced 2025-12-31 13:48:24 +03:00
Fix debugger watch window freeze caused by missing responses (#781)
This commit is contained in:
@@ -25,7 +25,6 @@ interface Variable {
|
||||
variable: GodotVariable;
|
||||
index: number;
|
||||
object_id: number;
|
||||
error: string;
|
||||
}
|
||||
|
||||
export class GodotDebugSession extends LoggingDebugSession {
|
||||
@@ -126,17 +125,16 @@ export class GodotDebugSession extends LoggingDebugSession {
|
||||
await debug.activeDebugSession.customRequest("scopes", { frameId: 0 });
|
||||
|
||||
if (this.all_scopes) {
|
||||
const variable = this.get_variable(args.expression, null, null, null);
|
||||
|
||||
if (variable.error == null) {
|
||||
try {
|
||||
const variable = this.get_variable(args.expression, null, null, null);
|
||||
const parsed_variable = parse_variable(variable.variable);
|
||||
response.body = {
|
||||
result: parsed_variable.value,
|
||||
variablesReference: !is_variable_built_in_type(variable.variable) ? variable.index : 0,
|
||||
};
|
||||
} else {
|
||||
} catch (error) {
|
||||
response.success = false;
|
||||
response.message = variable.error;
|
||||
response.message = error.toString();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -405,7 +403,6 @@ export class GodotDebugSession extends LoggingDebugSession {
|
||||
variable: null,
|
||||
index: null,
|
||||
object_id: null,
|
||||
error: null,
|
||||
};
|
||||
|
||||
if (!root) {
|
||||
@@ -489,8 +486,7 @@ export class GodotDebugSession extends LoggingDebugSession {
|
||||
(x) => x.sanitized.name === propertyName && x.sanitized.scope_path === path,
|
||||
)?.real;
|
||||
if (!result.variable) {
|
||||
result.error = `Could not find: ${propertyName}`;
|
||||
return result;
|
||||
throw new Error(`Could not find: ${propertyName}`);
|
||||
}
|
||||
|
||||
if (root.value.entries) {
|
||||
|
||||
@@ -25,7 +25,6 @@ interface Variable {
|
||||
variable: GodotVariable;
|
||||
index: number;
|
||||
object_id: number;
|
||||
error: string;
|
||||
}
|
||||
|
||||
export class GodotDebugSession extends LoggingDebugSession {
|
||||
@@ -126,17 +125,16 @@ export class GodotDebugSession extends LoggingDebugSession {
|
||||
await debug.activeDebugSession.customRequest("scopes", { frameId: 0 });
|
||||
|
||||
if (this.all_scopes) {
|
||||
const variable = this.get_variable(args.expression, null, null, null);
|
||||
|
||||
if (variable.error == null) {
|
||||
try {
|
||||
const variable = this.get_variable(args.expression, null, null, null);
|
||||
const parsed_variable = parse_variable(variable.variable);
|
||||
response.body = {
|
||||
result: parsed_variable.value,
|
||||
variablesReference: !is_variable_built_in_type(variable.variable) ? variable.index : 0,
|
||||
};
|
||||
} else {
|
||||
} catch (error) {
|
||||
response.success = false;
|
||||
response.message = variable.error;
|
||||
response.message = error.toString();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -405,7 +403,6 @@ export class GodotDebugSession extends LoggingDebugSession {
|
||||
variable: null,
|
||||
index: null,
|
||||
object_id: null,
|
||||
error: null,
|
||||
};
|
||||
|
||||
if (!root) {
|
||||
@@ -489,8 +486,7 @@ export class GodotDebugSession extends LoggingDebugSession {
|
||||
(x) => x.sanitized.name === propertyName && x.sanitized.scope_path === path,
|
||||
)?.real;
|
||||
if (!result.variable) {
|
||||
result.error = `Could not find: ${propertyName}`;
|
||||
return result;
|
||||
throw new Error(`Could not find: ${propertyName}`);
|
||||
}
|
||||
|
||||
if (root.value.entries) {
|
||||
|
||||
Reference in New Issue
Block a user