File tree Expand file tree Collapse file tree 4 files changed +24
-1
lines changed Expand file tree Collapse file tree 4 files changed +24
-1
lines changed Original file line number Diff line number Diff line change @@ -79,6 +79,10 @@ Run a test and capture a profile
79
79
80
80
Delete selected profile
81
81
82
+ ### ` Go: Show pprof file `
83
+
84
+ Internal use. Open a pprof profile file.
85
+
82
86
### ` Go: Benchmark Package `
83
87
84
88
Runs all benchmarks in the package of the current file.
Original file line number Diff line number Diff line change 284
284
"description" : " Delete selected profile" ,
285
285
"category" : " Test"
286
286
},
287
+ {
288
+ "command" : " go.test.showProfileFile" ,
289
+ "title" : " Go: Show pprof file" ,
290
+ "description" : " Internal use. Open a pprof profile file."
291
+ },
287
292
{
288
293
"command" : " go.benchmark.package" ,
289
294
"title" : " Go: Benchmark Package" ,
2675
2680
"command" : " go.test.deleteProfile" ,
2676
2681
"when" : " false"
2677
2682
},
2683
+ {
2684
+ "command" : " go.test.showProfileFile" ,
2685
+ "when" : " false"
2686
+ },
2678
2687
{
2679
2688
"command" : " go.explorer.refresh" ,
2680
2689
"when" : " false"
Original file line number Diff line number Diff line change @@ -129,6 +129,12 @@ export class GoTestExplorer {
129
129
} )
130
130
) ;
131
131
132
+ context . subscriptions . push (
133
+ vscode . commands . registerCommand ( 'go.test.showProfileFile' , async ( file : Uri ) => {
134
+ return inst . profiler . showFile ( file . fsPath ) ;
135
+ } )
136
+ ) ;
137
+
132
138
context . subscriptions . push (
133
139
workspace . onDidChangeConfiguration ( async ( x ) => {
134
140
try {
Original file line number Diff line number Diff line change @@ -122,6 +122,10 @@ export class GoTestProfiler {
122
122
await runs [ 0 ] . show ( ) ;
123
123
}
124
124
125
+ showFile ( file : string ) {
126
+ return show ( file ) ;
127
+ }
128
+
125
129
// Tests that have been profiled
126
130
get tests ( ) {
127
131
const items = Array . from ( this . runs . keys ( ) ) ;
@@ -298,7 +302,7 @@ class ProfileTreeDataProvider implements TreeDataProvider<TreeElement> {
298
302
item . contextValue = 'go:test:file' ;
299
303
item . command = {
300
304
title : 'Open' ,
301
- command : 'vscode.open ' ,
305
+ command : 'go.test.showProfileFile ' ,
302
306
arguments : [ element . uri ]
303
307
} ;
304
308
return item ;
You can’t perform that action at this time.
0 commit comments