4
4
5
5
import * as vscode from 'vscode' ;
6
6
import { bundlePage } from '../bundlePage' ;
7
- import { ProfileAnnotations } from '../profileAnnotations' ;
7
+ import { Message } from '../common/types' ;
8
+ import { openLocation } from '../open-location' ;
8
9
import { ProfileCodeLensProvider } from '../profileCodeLensProvider' ;
9
10
import { ReadonlyCustomDocument } from '../readonly-custom-document' ;
10
11
import { reopenWithEditor } from '../reopenWithEditor' ;
11
12
import { buildModel , IProfileModel } from './model' ;
12
- import { IHeapProfileRaw , Message } from './types' ;
13
+ import { IHeapProfileRaw } from './types' ;
13
14
14
15
export class HeapProfileEditorProvider
15
16
implements vscode . CustomEditorProvider < ReadonlyCustomDocument < IProfileModel > >
@@ -30,7 +31,8 @@ export class HeapProfileEditorProvider
30
31
const raw : IHeapProfileRaw = JSON . parse ( new TextDecoder ( ) . decode ( content ) ) ;
31
32
const document = new ReadonlyCustomDocument ( uri , buildModel ( raw ) ) ;
32
33
33
- const annotations = new ProfileAnnotations ( ) ;
34
+ // TODO: annotations
35
+ // const annotations = new ProfileAnnotations();
34
36
// const rootPath = document.userData.rootPath;
35
37
// for (const location of document.userData.locations) {
36
38
// annotations.add(rootPath, location);
@@ -50,12 +52,12 @@ export class HeapProfileEditorProvider
50
52
webviewPanel . webview . onDidReceiveMessage ( ( message : Message ) => {
51
53
switch ( message . type ) {
52
54
case 'openDocument' :
53
- // openLocation({
54
- // rootPath: document.userData?.rootPath ,
55
- // viewColumn: message.toSide ? vscode.ViewColumn.Beside : vscode.ViewColumn.Active,
56
- // callFrame: message.callFrame,
57
- // location: message.location,
58
- // });
55
+ openLocation ( {
56
+ rootPath : undefined ,
57
+ viewColumn : message . toSide ? vscode . ViewColumn . Beside : vscode . ViewColumn . Active ,
58
+ callFrame : message . callFrame ,
59
+ location : message . location ,
60
+ } ) ;
59
61
return ;
60
62
case 'reopenWith' :
61
63
reopenWithEditor ( document . uri , message . viewType , message . requireExtension ) ;
0 commit comments