File tree Expand file tree Collapse file tree 3 files changed +16
-5
lines changed
src/main/java/ai/deepcode/jbplugin Expand file tree Collapse file tree 3 files changed +16
-5
lines changed Original file line number Diff line number Diff line change @@ -90,7 +90,7 @@ static boolean addProjectToCache(@NotNull Project project) {
9090 return mapProject2BundleId .putIfAbsent (project , "" ) == null ;
9191 }
9292
93- static Set <Project > getAllCachedProject () {
93+ public static Set <Project > getAllCachedProject () {
9494 return mapProject2BundleId .keySet ();
9595 }
9696
@@ -201,8 +201,8 @@ public static void updateCachedResultsForFiles(
201201 } else {
202202 warn ("Nothing to update for " + psiFiles .size () + " files: " + psiFiles .toString ());
203203 }
204- ServiceManager .getService (project , myTodoView .class ).refresh ();
205204 updateInProgress = false ;
205+ ServiceManager .getService (project , myTodoView .class ).refresh ();
206206 } finally {
207207 // if (filesToProceed != null && !filesToProceed.isEmpty())
208208 info ("MUTEX RELEASED" );
Original file line number Diff line number Diff line change @@ -266,6 +266,7 @@ public void fileTypesChanged(@NotNull FileTypeEvent e) {
266266
267267 public void refresh () {
268268 Map <TodoPanel , Set <VirtualFile >> files = new HashMap <>();
269+ Icon [] summaryIcon = {DeepCodeUIUtils .EMPTY_EWI_ICON };
269270 ReadAction .nonBlocking (() -> {
270271 if (myAllTodos == null ) {
271272 return ;
@@ -276,6 +277,7 @@ public void refresh() {
276277 return true ;
277278 });
278279 }
280+ summaryIcon [0 ] = DeepCodeUIUtils .getSummaryIcon (myProject );
279281 })
280282 .finishOnUiThread (ModalityState .NON_MODAL , (__ ) -> {
281283 for (TodoPanel panel : myPanels ) {
@@ -284,7 +286,9 @@ public void refresh() {
284286 notifyUpdateFinished ();
285287 }
286288 ToolWindow myToolWindow = ToolWindowManager .getInstance (myProject ).getToolWindow ("DeepCode" );
287- if (myToolWindow != null ) myToolWindow .setIcon (DeepCodeUIUtils .getSummaryIcon (myProject ));
289+ if (myToolWindow != null ) {
290+ myToolWindow .setIcon (summaryIcon [0 ]);
291+ }
288292 })
289293 .inSmartMode (myProject )
290294 .submit (NonUrgentExecutor .getInstance ());
Original file line number Diff line number Diff line change 11package ai .deepcode .jbplugin .ui .utils ;
22
33import ai .deepcode .jbplugin .core .AnalysisData ;
4+ import ai .deepcode .jbplugin .core .DCLogger ;
45import ai .deepcode .jbplugin .core .DeepCodeUtils ;
56import ai .deepcode .jbplugin .core .LoginUtils ;
67import com .intellij .execution .process .ConsoleHighlighter ;
@@ -103,8 +104,14 @@ private static Icon scaleIcon(Icon sourceIcon) {
103104 IconUtil .textToIcon ("?" , new JLabel (), fontToScale ));
104105
105106 public static Icon getSummaryIcon (@ NotNull Project project ) {
106- if (!LoginUtils .isLogged (project , false ) || AnalysisData .isUpdateAnalysisInProgress ())
107- return EMPTY_EWI_ICON ;
107+ final boolean projectWasNotAnalysed = !AnalysisData .getAllCachedProject ().contains (project );
108+ DCLogger .info (
109+ "SummaryIcon request:"
110+ + " projectWasNotAnalysed="
111+ + projectWasNotAnalysed
112+ + " isUpdateAnalysisInProgress="
113+ + AnalysisData .isUpdateAnalysisInProgress ());
114+ if (projectWasNotAnalysed || AnalysisData .isUpdateAnalysisInProgress ()) return EMPTY_EWI_ICON ;
108115
109116 DeepCodeUtils .ErrorsWarningsInfos ewi =
110117 DeepCodeUtils .getEWI (AnalysisData .getAllFilesWithSuggestions (project ));
You can’t perform that action at this time.
0 commit comments