Skip to content

Commit cee2893

Browse files
committed
2491: Prevent URN map generation during indexing.
Added a check to avoid URN map generation when the project is in indexing (dumb) mode. A warning notification is shown to inform users that they need to wait until indexing is complete. This prevents potential errors or performance issues.
1 parent cb6e815 commit cee2893

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

src/main/java/com/magento/idea/magento2plugin/project/RegenerateUrnMapListener.java

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
import com.intellij.notification.NotificationGroupManager;
1111
import com.intellij.notification.NotificationType;
1212
import com.intellij.openapi.application.ApplicationManager;
13+
import com.intellij.openapi.project.DumbService;
1314
import com.intellij.openapi.project.Project;
1415
import com.intellij.openapi.vfs.VirtualFile;
1516
import com.intellij.psi.PsiDirectory;
@@ -53,6 +54,20 @@ public void mouseClicked(final MouseEvent event) {
5354
final MagentoComponentManager componentManager =
5455
MagentoComponentManager.getInstance(project);
5556

57+
if (DumbService.getInstance(project).isDumb()) {
58+
NotificationGroupManager.getInstance()
59+
.getNotificationGroup("Magento Notifications")
60+
.createNotification(
61+
"URN map generation unavailable",
62+
"Indexing is in progress." +
63+
" Please wait for it to complete" +
64+
" before running URN mapping generation.",
65+
NotificationType.WARNING
66+
)
67+
.notify(project);
68+
return;
69+
}
70+
5671
ApplicationManager.getApplication().runWriteAction(
5772
new Runnable() {
5873
@Override

0 commit comments

Comments
 (0)