|
1 | 1 | import * as vscode from 'vscode'; |
| 2 | +import { watchList } from './debug/watch'; |
2 | 3 | import { CXXRTLDebugger } from './debugger'; |
3 | 4 | import * as sidebar from './ui/sidebar'; |
4 | 5 | import { inputTime } from './ui/input'; |
5 | 6 |
|
6 | 7 | export function activate(context: vscode.ExtensionContext) { |
7 | 8 | const rtlDebugger = new CXXRTLDebugger(); |
8 | | - const sidebarTreeDataProvider = new sidebar.TreeDataProvider(rtlDebugger); |
9 | 9 |
|
10 | | - context.subscriptions.push(vscode.window.createTreeView('rtlDebugger.sidebar', { |
| 10 | + const sidebarTreeDataProvider = new sidebar.TreeDataProvider(rtlDebugger); |
| 11 | + const sidebarTreeView = vscode.window.createTreeView('rtlDebugger.sidebar', { |
11 | 12 | treeDataProvider: sidebarTreeDataProvider |
12 | | - })); |
| 13 | + }); |
| 14 | + context.subscriptions.push(sidebarTreeView); |
13 | 15 |
|
14 | 16 | vscode.commands.executeCommand('setContext', 'rtlDebugger.sessionStatus', rtlDebugger.sessionStatus); |
15 | 17 | context.subscriptions.push(rtlDebugger.onDidChangeSessionStatus((state) => |
@@ -48,6 +50,11 @@ export function activate(context: vscode.ExtensionContext) { |
48 | 50 | context.subscriptions.push(vscode.commands.registerCommand('rtlDebugger.stepForward', () => |
49 | 51 | rtlDebugger.session!.stepForward())); |
50 | 52 |
|
| 53 | + context.subscriptions.push(vscode.commands.registerCommand('rtlDebugger.watchVariable', (treeItem) => |
| 54 | + watchList.append(treeItem.getWatchItem()))); |
| 55 | + context.subscriptions.push(vscode.commands.registerCommand('rtlDebugger.unWatchVariable', (treeItem) => |
| 56 | + watchList.remove(treeItem.metadata.index))); |
| 57 | + |
51 | 58 | // For an unknown reason, the `vscode.open` command (which does the exact same thing) ignores the options. |
52 | 59 | context.subscriptions.push(vscode.commands.registerCommand('rtlDebugger.openDocument', |
53 | 60 | (uri: vscode.Uri, options: vscode.TextDocumentShowOptions) => { |
|
0 commit comments