Skip to content

Commit e9f2b6a

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

File tree

1 file changed

+11
-15
lines changed

1 file changed

+11
-15
lines changed

src/analyticsCodeLens.ts

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

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

88-
var insightsButNoDecorator = true;
89-
var environment ="";
90-
9188
for (const insight of insights){
9289
if (!insight.decorators){
9390
continue;
@@ -113,23 +110,11 @@ class CodelensProvider implements vscode.CodeLensProvider<vscode.CodeLens>
113110
arguments: [methodInfo, insight.environment]
114111
}));
115112

116-
insightsButNoDecorator=false;
117-
environment=insight.environment;
118-
119113
}
120114

121115

122116
}
123117

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-
}));
131-
}
132-
133118
return lens;
134119
}
135120

@@ -211,6 +196,17 @@ class CodelensProvider implements vscode.CodeLensProvider<vscode.CodeLens>
211196
for (const lens of lenses){
212197
codelens.push(lens);
213198
}
199+
200+
if (lenses.length===0 && thisEnvInsights.length>0){
201+
codelens.push(new vscode.CodeLens(methodInfo.range, {
202+
title: "Runtime data",
203+
tooltip: "Click to see this function's runtime data",
204+
command: CodelensProvider.clickCommand,
205+
arguments: [methodInfo, this._state.environment]
206+
}));
207+
208+
209+
}
214210

215211
}
216212

0 commit comments

Comments
 (0)