Skip to content

Commit 288e82d

Browse files
committed
Finish moving to sideview webview
Instead of popping up a new tab, the graphs now appear in the sideview on the debug page. You can still pull out this sideview item to be a full page if you want.
1 parent c93ddf0 commit 288e82d

File tree

3 files changed

+21
-10
lines changed

3 files changed

+21
-10
lines changed

.vscode/tasks.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,15 @@
1111
"presentation": {
1212
"reveal": "never"
1313
},
14+
"group": {
15+
"kind": "build",
16+
"isDefault": false
17+
}
18+
},
19+
{
20+
"type": "npm",
21+
"script": "compile",
22+
"problemMatcher": ["$ts-webpack-watch", "$tslint-webpack-watch"],
1423
"group": {
1524
"kind": "build",
1625
"isDefault": true

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949
"views": {
5050
"debug": [
5151
{
52-
"id": "python-resource-monitor",
52+
"id": "python-resource-monitor.graphsView",
5353
"name": "Python Resource Monitor",
5454
"when": "debugType == 'debugpy' || debugType == 'python'",
5555
"type": "webview"

src/extension.ts

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ var webview: vscode.Webview | undefined = undefined;
77
var pollingInterval = 100;
88
var rsmLength = 10000;
99

10-
var pidMonitors = new Map();
10+
var pidMonitors = new Map<number, NodeJS.Timeout>();
1111

1212
function nop() {}
1313

@@ -105,7 +105,7 @@ export function activate(context: vscode.ExtensionContext) {
105105
console.log("Extension Python Resource Monitor activated.");
106106
context.subscriptions.push(
107107
vscode.window.registerWebviewViewProvider(
108-
"python-resource-monitor",
108+
"python-resource-monitor.graphsView",
109109
new PyRSMWebviewProvider(context),
110110
{ webviewOptions: { retainContextWhenHidden: true } }
111111
)
@@ -207,13 +207,15 @@ export function activate(context: vscode.ExtensionContext) {
207207

208208
// Instead of just getting the debug start event, we now use an adapter tracker.
209209
// This also makes sure that we only get python debugs
210-
vscode.debug.registerDebugAdapterTrackerFactory(
211-
"python",
212-
new PyDebugAdapterTrackerFactory(context)
213-
);
214-
vscode.debug.registerDebugAdapterTrackerFactory(
215-
"debugpy",
216-
new PyDebugAdapterTrackerFactory(context)
210+
context.subscriptions.push(
211+
vscode.debug.registerDebugAdapterTrackerFactory(
212+
"python",
213+
new PyDebugAdapterTrackerFactory(context)
214+
),
215+
vscode.debug.registerDebugAdapterTrackerFactory(
216+
"debugpy",
217+
new PyDebugAdapterTrackerFactory(context)
218+
)
217219
);
218220

219221
// Listen for termination events per process.

0 commit comments

Comments
 (0)