Skip to content

Commit 7a283f4

Browse files
committed
Improve virtual error scopes
1 parent 5ca108c commit 7a283f4

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/phpDebug.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -641,7 +641,7 @@ class PhpDebugSession extends vscode.DebugSession {
641641
if (status.exception) {
642642
const variableId = this._variableIdCounter++;
643643
this._errorScopes.set(variableId, status);
644-
scopes = [new vscode.Scope(status.exception.name, variableId)];
644+
scopes = [new vscode.Scope(status.exception.name.replace(/^(.*\\)+/g, ''), variableId)];
645645
}
646646
} else {
647647
const stackFrame = this._stackFrames.get(args.frameId);
@@ -658,7 +658,7 @@ class PhpDebugSession extends vscode.DebugSession {
658658
if (status && status.exception) {
659659
const variableId = this._variableIdCounter++;
660660
this._errorScopes.set(variableId, status);
661-
scopes.unshift(new vscode.Scope(status.exception.name, variableId));
661+
scopes.unshift(new vscode.Scope(status.exception.name.replace(/^(.*\\)+/g, ''), variableId));
662662
}
663663
}
664664
response.body = {scopes};
@@ -677,7 +677,7 @@ class PhpDebugSession extends vscode.DebugSession {
677677
// this is a virtual error scope
678678
const status = this._errorScopes.get(variablesReference);
679679
variables = [
680-
new vscode.Variable('name', '"' + status.exception.name + '"'),
680+
new vscode.Variable('type', status.exception.name),
681681
new vscode.Variable('message', '"' + status.exception.message + '"')
682682
];
683683
if (status.exception.code !== undefined) {

0 commit comments

Comments
 (0)