Skip to content

Commit 92dea6b

Browse files
Navigation schema change - environment selection #324
1 parent 0b10a4a commit 92dea6b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+1070
-584
lines changed

CHANGELOG.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
# Changelog
22
All notable changes to this project will be documented in this file.
33

4+
## [2.0.39] - 2023-03-17
5+
### Changed
6+
- Added Pycharm support
7+
- bugfix/link on span modifies the active env (#387)
8+
- Navigation schema change - environment selection #324
9+
410
## [2.0.38] - 2023-03-08
511
### Changed
612
- Repaint UI only when insights list was changed
@@ -45,4 +51,5 @@ All notable changes to this project will be documented in this file.
4551
[2.0.36]: https://github.com/digma-ai/digma-intellij-plugin/compare/v2.0.35...v2.0.36
4652
[2.0.37]: https://github.com/digma-ai/digma-intellij-plugin/compare/v2.0.36...v2.0.37
4753
[2.0.38]: https://github.com/digma-ai/digma-intellij-plugin/compare/v2.0.37...v2.0.38
48-
[Unreleased]: https://github.com/digma-ai/digma-intellij-plugin/compare/v2.0.38...HEAD
54+
[2.0.39]: https://github.com/digma-ai/digma-intellij-plugin/compare/v2.0.38...v2.0.39
55+
[Unreleased]: https://github.com/digma-ai/digma-intellij-plugin/compare/v2.0.39...HEAD

build.gradle.kts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@ changelog {
5050
version.set(project.semanticVersion.version.get().toString())
5151
path.set("${project.projectDir}/CHANGELOG.md")
5252
groups.set(listOf("Added", "Changed", "Deprecated", "Removed", "Fixed", "Security"))
53-
// groups.set(emptyList())
5453
header.set(provider { "[${version.get()}] - ${date()}" })
5554
keepUnreleasedSection.set(false)
5655
}

ide-common/src/main/java/org/digma/intellij/plugin/analytics/AnalyticsService.java

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
import org.apache.commons.lang3.time.StopWatch;
99
import org.digma.intellij.plugin.common.Backgroundable;
1010
import org.digma.intellij.plugin.common.CommonUtils;
11+
import org.digma.intellij.plugin.common.usageStatusChange.UsageStatusChangeListener;
1112
import org.digma.intellij.plugin.log.Log;
1213
import org.digma.intellij.plugin.model.InsightType;
1314
import org.digma.intellij.plugin.model.rest.debugger.DebuggerEventRequest;
@@ -199,7 +200,18 @@ public CodeObjectErrorDetails getErrorDetails(String errorUid) throws AnalyticsS
199200
}
200201

201202
public UsageStatusResult getUsageStatus(List<String> objectIds) throws AnalyticsServiceException {
202-
return executeCatching(() -> analyticsProviderProxy.getUsageStatus(new UsageStatusRequest(objectIds)));
203+
UsageStatusResult usageStatusResult = executeCatching(() -> analyticsProviderProxy.getUsageStatus(new UsageStatusRequest(objectIds)));
204+
notifyUsageStatusChanged(usageStatusResult);
205+
return usageStatusResult;
206+
}
207+
208+
private void notifyUsageStatusChanged(UsageStatusResult newUsageStatusResult) {
209+
Log.log(LOGGER::debug, "Firing UsageStatusChange event for {}", newUsageStatusResult);
210+
if (project.isDisposed()) {
211+
return;
212+
}
213+
UsageStatusChangeListener publisher = project.getMessageBus().syncPublisher(UsageStatusChangeListener.USAGE_STATUS_CHANGED_TOPIC);
214+
publisher.usageStatusChanged(newUsageStatusResult);
203215
}
204216

205217
public RecentActivityResult getRecentActivity(List<String> environments) throws AnalyticsServiceException {
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
package org.digma.intellij.plugin.common.modelChangeListener;
2+
3+
import org.digma.intellij.plugin.ui.model.PanelModel;
4+
5+
public class ModelChangeHandler implements ModelChangeListener {
6+
7+
@Override
8+
public void modelChanged(PanelModel newModel) {
9+
//nothing to do here
10+
}
11+
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
package org.digma.intellij.plugin.common.modelChangeListener;
2+
3+
import com.intellij.util.messages.Topic;
4+
import org.digma.intellij.plugin.ui.model.PanelModel;
5+
6+
public interface ModelChangeListener {
7+
8+
@Topic.ProjectLevel
9+
Topic<ModelChangeListener> MODEL_CHANGED_TOPIC = Topic.create("MODEL_CHANGED_TOPIC", ModelChangeListener.class);
10+
11+
void modelChanged(PanelModel newModel);
12+
13+
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
package org.digma.intellij.plugin.common.usageStatusChange;
2+
3+
import org.digma.intellij.plugin.model.rest.usage.UsageStatusResult;
4+
5+
public class UsageStatusChangeHandler implements UsageStatusChangeListener {
6+
@Override
7+
public void usageStatusChanged(UsageStatusResult newUsageStatusResult) {
8+
//nothing to do here
9+
}
10+
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
package org.digma.intellij.plugin.common.usageStatusChange;
2+
3+
import com.intellij.util.messages.Topic;
4+
import org.digma.intellij.plugin.model.rest.usage.UsageStatusResult;
5+
6+
public interface UsageStatusChangeListener {
7+
8+
@Topic.ProjectLevel
9+
Topic<UsageStatusChangeListener> USAGE_STATUS_CHANGED_TOPIC = Topic.create("USAGE_STATUS_CHANGED_TOPIC", UsageStatusChangeListener.class);
10+
11+
void usageStatusChanged(UsageStatusResult newUsageStatusResult);
12+
13+
}

ide-common/src/main/kotlin/org/digma/intellij/plugin/ui/service/InsightsViewService.kt

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ package org.digma.intellij.plugin.ui.service
33
import com.intellij.openapi.diagnostic.Logger
44
import com.intellij.openapi.project.Project
55
import org.digma.intellij.plugin.common.Backgroundable
6+
import org.digma.intellij.plugin.common.modelChangeListener.ModelChangeListener
67
import org.digma.intellij.plugin.document.DocumentInfoContainer
78
import org.digma.intellij.plugin.insights.InsightsProvider
89
import org.digma.intellij.plugin.log.Log
@@ -59,7 +60,7 @@ class InsightsViewService(project: Project) : AbstractViewService(project) {
5960
model.insightsCount = insightsListContainer.count
6061
model.card = InsightsTabCard.INSIGHTS
6162

62-
updateUi()
63+
notifyModelChangedAndUpdateUi()
6364
} finally {
6465
if (lock.isHeldByCurrentThread) {
6566
lock.unlock()
@@ -80,7 +81,7 @@ class InsightsViewService(project: Project) : AbstractViewService(project) {
8081
model.insightsCount = 0
8182
model.card = InsightsTabCard.INSIGHTS
8283

83-
updateUi()
84+
notifyModelChangedAndUpdateUi()
8485
}
8586

8687

@@ -95,7 +96,7 @@ class InsightsViewService(project: Project) : AbstractViewService(project) {
9596
model.insightsCount = 0
9697
model.card = InsightsTabCard.INSIGHTS
9798

98-
updateUi()
99+
notifyModelChangedAndUpdateUi()
99100
}
100101

101102
fun emptyNonSupportedFile(fileUri: String) {
@@ -109,7 +110,7 @@ class InsightsViewService(project: Project) : AbstractViewService(project) {
109110
model.insightsCount = 0
110111
model.card = InsightsTabCard.INSIGHTS
111112

112-
updateUi()
113+
notifyModelChangedAndUpdateUi()
113114
}
114115

115116
fun showDocumentPreviewList(
@@ -133,7 +134,8 @@ class InsightsViewService(project: Project) : AbstractViewService(project) {
133134

134135
model.listViewItems = ArrayList()
135136
model.card = InsightsTabCard.PREVIEW
136-
updateUi()
137+
138+
notifyModelChangedAndUpdateUi()
137139
}
138140

139141

@@ -172,4 +174,18 @@ class InsightsViewService(project: Project) : AbstractViewService(project) {
172174
}
173175
}
174176

177+
private fun notifyModelChanged() {
178+
Log.log(logger::debug, "Firing ModelChange event for {}", model)
179+
if (project.isDisposed) {
180+
return
181+
}
182+
val publisher = project.messageBus.syncPublisher(ModelChangeListener.MODEL_CHANGED_TOPIC)
183+
publisher.modelChanged(model)
184+
}
185+
186+
private fun notifyModelChangedAndUpdateUi() {
187+
notifyModelChanged()
188+
updateUi()
189+
}
190+
175191
}

ide-common/src/main/kotlin/org/digma/intellij/plugin/ui/service/ToolWindowTabsHelper.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ class ToolWindowTabsHelper(val project: Project) {
1515
private var errorDetailsOn = false
1616

1717
companion object {
18-
const val INSIGHTS_TAB_NAME = "insights"
19-
const val ERRORS_TAB_NAME = "errors"
20-
const val SUMMARY_TAB_NAME = "summary"
18+
const val INSIGHTS_TAB_NAME = "Insights"
19+
const val ERRORS_TAB_NAME = "Errors"
20+
const val SUMMARY_TAB_NAME = "Summary"
2121

2222
@JvmStatic
2323
fun getInstance(project: Project):ToolWindowTabsHelper{

src/main/java/org/digma/intellij/plugin/toolwindow/CustomResourceHandler.kt renamed to src/main/java/org/digma/intellij/plugin/toolwindow/recentactivity/CustomResourceHandler.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package org.digma.intellij.plugin.toolwindow
1+
package org.digma.intellij.plugin.toolwindow.recentactivity
22

33
import freemarker.template.Configuration
44
import org.cef.callback.CefCallback

0 commit comments

Comments
 (0)