Skip to content

Commit 25207af

Browse files
Fix counter for insights tab when mouse pointer is present on general file body
1 parent 3305848 commit 25207af

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

ide-common/src/main/java/org/digma/intellij/plugin/document/DocumentInfoContainer.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
import org.digma.intellij.plugin.analytics.AnalyticsService;
77
import org.digma.intellij.plugin.analytics.AnalyticsServiceException;
88
import org.digma.intellij.plugin.log.Log;
9+
import org.digma.intellij.plugin.model.InsightType;
910
import org.digma.intellij.plugin.model.discovery.DocumentInfo;
1011
import org.digma.intellij.plugin.model.discovery.MethodInfo;
1112
import org.digma.intellij.plugin.model.rest.insights.CodeObjectInsight;
@@ -76,7 +77,9 @@ private void loadAllInsightsForCurrentDocument() {
7677
List<String> objectIds = getObjectIdsForCurrentDocument();
7778
try {
7879
Log.log(LOGGER::debug, "Requesting insights with ids {}", objectIds);
79-
insights = analyticsService.getInsights(objectIds);
80+
insights = analyticsService.getInsights(objectIds)
81+
.stream().filter(codeObjectInsight -> !codeObjectInsight.getType().equals(InsightType.Unmapped))
82+
.collect(Collectors.toList());
8083
Log.log(LOGGER::debug, "Got next insights: {}", insights);
8184
} catch (AnalyticsServiceException e) {
8285
//insights = Collections.emptyList() means there was an error loading insights, usually if the backend is not available.

ide-common/src/main/java/org/digma/intellij/plugin/document/DocumentInfoService.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
import org.apache.commons.lang3.mutable.MutableInt;
88
import org.digma.intellij.plugin.analytics.AnalyticsService;
99
import org.digma.intellij.plugin.log.Log;
10+
import org.digma.intellij.plugin.model.InsightType;
1011
import org.digma.intellij.plugin.model.discovery.DocumentInfo;
1112
import org.digma.intellij.plugin.model.discovery.MethodInfo;
1213
import org.digma.intellij.plugin.model.discovery.MethodUnderCaret;
@@ -134,10 +135,11 @@ public List<CodeObjectInsight> getCachedMethodInsights(@NotNull MethodInfo metho
134135
if (documentInfoContainer != null) {
135136
return documentInfoContainer.getAllInsights().stream().filter(codeObjectInsight -> {
136137
String codeObjectId = codeObjectInsight.getCodeObjectId();
137-
return methodInfo.getId().equals(codeObjectId)
138+
return (!codeObjectInsight.getType().equals(InsightType.Unmapped)) &&
139+
(methodInfo.getId().equals(codeObjectId)
138140
|| methodInfo.idWithType().equals(codeObjectId)
139141
|| methodInfo.getRelatedCodeObjectIds().contains(codeObjectId)
140-
|| methodInfo.getRelatedCodeObjectIdsWithType().contains(codeObjectId);
142+
|| methodInfo.getRelatedCodeObjectIdsWithType().contains(codeObjectId));
141143
}).collect(Collectors.toList());
142144
}
143145
return new ArrayList<>();

0 commit comments

Comments
 (0)