|
5 | 5 | import java.util.Objects;
|
6 | 6 | import java.util.Set;
|
7 | 7 | import java.util.stream.Collectors;
|
8 |
| -import java.util.stream.Stream; |
9 | 8 |
|
10 |
| -import com.intellij.openapi.application.ApplicationInfo; |
11 | 9 | import com.intellij.openapi.diagnostic.Logger;
|
12 | 10 | import com.intellij.openapi.editor.Document;
|
13 | 11 | import com.intellij.openapi.fileEditor.FileDocumentManager;
|
@@ -43,12 +41,6 @@ public void beforeAllDocumentsSaving()
|
43 | 41 | LOGGER.debug(
|
44 | 42 | "[+] Start SaveActionsDocumentManagerListener#beforeAllDocumentsSaving, " + this.project.getName());
|
45 | 43 |
|
46 |
| - if(REQUIRES_PROJECT_LOAD_IGNORE_WORKAROUND && isInvokedFromProjectLoadBefore243()) |
47 |
| - { |
48 |
| - LOGGER.debug("Ignoring due to PROJECT_LOAD_IGNORE_WORKAROUND"); |
49 |
| - return; |
50 |
| - } |
51 |
| - |
52 | 44 | final List<Document> unsavedDocuments = Arrays.asList(FileDocumentManager.getInstance().getUnsavedDocuments());
|
53 | 45 | if(!unsavedDocuments.isEmpty())
|
54 | 46 | {
|
@@ -83,38 +75,4 @@ private synchronized void initPsiDocManager()
|
83 | 75 | this.psiDocumentManager = PsiDocumentManager.getInstance(this.project);
|
84 | 76 | }
|
85 | 77 | }
|
86 |
| - |
87 |
| - // region PROJECT_LOAD_IGNORE_WORKAROUND |
88 |
| - // https://github.com/xdev-software/intellij-plugin-save-actions/issues/145 |
89 |
| - private static final boolean REQUIRES_PROJECT_LOAD_IGNORE_WORKAROUND = |
90 |
| - determineIfRequiresProjectLoadIgnoreWorkaround(); |
91 |
| - |
92 |
| - @SuppressWarnings("checkstyle:MagicNumber") |
93 |
| - static boolean determineIfRequiresProjectLoadIgnoreWorkaround() |
94 |
| - { |
95 |
| - try |
96 |
| - { |
97 |
| - // Problem was fixed in 2024.3 |
98 |
| - return ApplicationInfo.getInstance().getBuild().getBaselineVersion() < 243; |
99 |
| - } |
100 |
| - catch(final Exception ex) |
101 |
| - { |
102 |
| - LOGGER.warn("Failed to determine IDE version", ex); |
103 |
| - return false; |
104 |
| - } |
105 |
| - } |
106 |
| - |
107 |
| - @SuppressWarnings("checkstyle:MagicNumber") |
108 |
| - static boolean isInvokedFromProjectLoadBefore243() |
109 |
| - { |
110 |
| - // The invoking method ProjectSettingsTracker$submitSettingsFilesRefresh is usually at index 17 and 18 |
111 |
| - return Stream.of(Thread.currentThread().getStackTrace()) |
112 |
| - .map(StackTraceElement::getClassName) |
113 |
| - .skip(16) |
114 |
| - .limit(5) |
115 |
| - .anyMatch(s -> s.startsWith( |
116 |
| - "com.intellij.openapi.externalSystem.autoimport.ProjectSettingsTracker$submitSettingsFilesRefresh")); |
117 |
| - } |
118 |
| - |
119 |
| - // endregion |
120 | 78 | }
|
0 commit comments