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>();
1111vscode . debug . onDidStartDebugSession ( ( s ) => sessions . set ( s . id , s ) ) ;
1212vscode . debug . onDidTerminateDebugSession ( ( s ) => sessions . delete ( s . id ) ) ;
1313
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+ */
1419export function registerGoDebugCommands ( ctx : vscode . ExtensionContext ) {
1520 class VariableContentProvider implements vscode . TextDocumentContentProvider {
1621 static uriForRef ( ref : VariableRef ) {
@@ -85,18 +90,27 @@ export function registerGoDebugCommands(ctx: vscode.ExtensionContext) {
8590 } )
8691 ) ;
8792
93+ /**
94+ * A reference to a variable, used to pass data between commands.
95+ */
8896 interface VariableRef {
8997 sessionId : string ;
9098 container : Container ;
9199 variable : Variable ;
92100 }
93101
102+ /**
103+ * A container for variables, used to pass data between commands.
104+ */
94105 interface Container {
95106 name : string ;
96107 variablesReference : number ;
97108 expensive : boolean ;
98109 }
99110
111+ /**
112+ * A variable, used to pass data between commands.
113+ */
100114 interface Variable {
101115 name : string ;
102116 value : string ;
@@ -111,6 +125,9 @@ export function registerGoDebugCommands(ctx: vscode.ExtensionContext) {
111125 t : '\t'
112126 } ;
113127
128+ /**
129+ * Parses a variable value, unescaping special characters.
130+ */
114131 function parseVariable ( variable : Variable ) {
115132 let raw = variable . value . trim ( ) ;
116133 try {
You can’t perform that action at this time.
0 commit comments