File tree Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -11,6 +11,11 @@ const sessions = new Map<string, vscode.DebugSession>();
11
11
vscode . debug . onDidStartDebugSession ( ( s ) => sessions . set ( s . id , s ) ) ;
12
12
vscode . debug . onDidTerminateDebugSession ( ( s ) => sessions . delete ( s . id ) ) ;
13
13
14
+ /**
15
+ * Registers commands to improve the debugging experience for Go.
16
+ *
17
+ * Currently, it adds a command to open a variable in a new text document.
18
+ */
14
19
export function registerGoDebugCommands ( ctx : vscode . ExtensionContext ) {
15
20
class VariableContentProvider implements vscode . TextDocumentContentProvider {
16
21
static uriForRef ( ref : VariableRef ) {
@@ -85,18 +90,27 @@ export function registerGoDebugCommands(ctx: vscode.ExtensionContext) {
85
90
} )
86
91
) ;
87
92
93
+ /**
94
+ * A reference to a variable, used to pass data between commands.
95
+ */
88
96
interface VariableRef {
89
97
sessionId : string ;
90
98
container : Container ;
91
99
variable : Variable ;
92
100
}
93
101
102
+ /**
103
+ * A container for variables, used to pass data between commands.
104
+ */
94
105
interface Container {
95
106
name : string ;
96
107
variablesReference : number ;
97
108
expensive : boolean ;
98
109
}
99
110
111
+ /**
112
+ * A variable, used to pass data between commands.
113
+ */
100
114
interface Variable {
101
115
name : string ;
102
116
value : string ;
@@ -111,6 +125,9 @@ export function registerGoDebugCommands(ctx: vscode.ExtensionContext) {
111
125
t : '\t'
112
126
} ;
113
127
128
+ /**
129
+ * Parses a variable value, unescaping special characters.
130
+ */
114
131
function parseVariable ( variable : Variable ) {
115
132
let raw = variable . value . trim ( ) ;
116
133
try {
You can’t perform that action at this time.
0 commit comments