Skip to content

Commit 921b255

Browse files
committed
show runtime data decorator
1 parent 8d0f4a7 commit 921b255

File tree

1 file changed

+19
-2
lines changed

1 file changed

+19
-2
lines changed

src/analyticsCodeLens.ts

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,9 @@ class CodelensProvider implements vscode.CodeLensProvider<vscode.CodeLens>
8585

8686
let lens: vscode.CodeLens[] = [];
8787

88+
var insightsButNoDecorator = true;
89+
var environment ="";
90+
8891
for (const insight of insights){
8992
if (!insight.decorators){
9093
continue;
@@ -109,8 +112,22 @@ class CodelensProvider implements vscode.CodeLensProvider<vscode.CodeLens>
109112
command: CodelensProvider.clickCommand,
110113
arguments: [methodInfo, insight.environment]
111114
}));
115+
116+
insightsButNoDecorator=false;
117+
environment=insight.environment;
112118

113119
}
120+
121+
122+
}
123+
124+
if (insightsButNoDecorator && !environmentPrefix){
125+
lens.push(new vscode.CodeLens(codeObjectInfo.range, {
126+
title: "Runtime data",
127+
tooltip: "Click to see this function's runtime data",
128+
command: CodelensProvider.clickCommand,
129+
arguments: [methodInfo, environment]
130+
}));
114131
}
115132

116133
return lens;
@@ -181,7 +198,6 @@ class CodelensProvider implements vscode.CodeLensProvider<vscode.CodeLens>
181198
if(!documentInfo)
182199
return [];
183200

184-
185201
const codelens: vscode.CodeLens[] = [];
186202
for(let methodInfo of documentInfo.methods)
187203
{
@@ -195,7 +211,6 @@ class CodelensProvider implements vscode.CodeLensProvider<vscode.CodeLens>
195211
for (const lens of lenses){
196212
codelens.push(lens);
197213
}
198-
199214

200215
}
201216

@@ -256,6 +271,8 @@ class CodelensProvider implements vscode.CodeLensProvider<vscode.CodeLens>
256271

257272
}
258273

274+
275+
259276
return codelens;
260277
}
261278

0 commit comments

Comments
 (0)