mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Move inspect starter from edt thread. Cleanup.
GitOrigin-RevId: ca5a8127664004b5bfa934d4aea5a74e3019883e
This commit is contained in:
committed by
intellij-monorepo-bot
parent
7430e68195
commit
1f7b08bfc6
+3
-5
@@ -3,7 +3,7 @@ package com.intellij.codeInspection;
|
||||
|
||||
import com.intellij.ide.CommandLineInspectionProgressReporter;
|
||||
import com.intellij.ide.CommandLineInspectionProjectConfigurator;
|
||||
import com.intellij.openapi.application.ApplicationManager;
|
||||
import com.intellij.openapi.application.WriteAction;
|
||||
import com.intellij.openapi.projectRoots.JavaSdk;
|
||||
import com.intellij.openapi.projectRoots.JavaSdkVersion;
|
||||
import com.intellij.openapi.projectRoots.ProjectJdkTable;
|
||||
@@ -59,10 +59,8 @@ public class JavaCommandLineInspectionProjectConfigurator implements CommandLine
|
||||
String name = javaSdk.suggestSdkName(null, path);
|
||||
logger.reportMessage(2, "Detected JDK with name " + name + " at " + path);
|
||||
Sdk jdk = javaSdk.createJdk(name, path, false);
|
||||
ApplicationManager.getApplication().invokeAndWait(() -> {
|
||||
ApplicationManager.getApplication().runWriteAction(
|
||||
() -> ProjectJdkTable.getInstance().addJdk(jdk));
|
||||
});
|
||||
|
||||
WriteAction.runAndWait(() -> ProjectJdkTable.getInstance().addJdk(jdk));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -114,21 +114,21 @@ public final class InspectionApplication implements CommandLineInspectionProgres
|
||||
}
|
||||
|
||||
public void execute() throws Exception {
|
||||
final ApplicationInfoEx appInfo = (ApplicationInfoEx)ApplicationInfo.getInstance();
|
||||
reportMessageNoLineBreak(1, InspectionsBundle.message("inspection.application.starting.up",
|
||||
appInfo.getFullApplicationName() +
|
||||
" (build " +
|
||||
appInfo.getBuild().asString() +
|
||||
")"));
|
||||
reportMessage(1, InspectionsBundle.message("inspection.done"));
|
||||
final ApplicationInfoEx appInfo = (ApplicationInfoEx)ApplicationInfo.getInstance();
|
||||
reportMessageNoLineBreak(1, InspectionsBundle.message("inspection.application.starting.up",
|
||||
appInfo.getFullApplicationName() +
|
||||
" (build " +
|
||||
appInfo.getBuild().asString() +
|
||||
")"));
|
||||
reportMessage(1, InspectionsBundle.message("inspection.done"));
|
||||
|
||||
Disposable disposable = Disposer.newDisposable();
|
||||
try {
|
||||
run(Paths.get(FileUtil.toCanonicalPath(myProjectPath)), disposable);
|
||||
}
|
||||
finally {
|
||||
Disposer.dispose(disposable);
|
||||
}
|
||||
Disposable disposable = Disposer.newDisposable();
|
||||
try {
|
||||
run(Paths.get(FileUtil.toCanonicalPath(myProjectPath)), disposable);
|
||||
}
|
||||
finally {
|
||||
Disposer.dispose(disposable);
|
||||
}
|
||||
}
|
||||
|
||||
private void printHelp() {
|
||||
@@ -177,8 +177,6 @@ public final class InspectionApplication implements CommandLineInspectionProgres
|
||||
myInspectionProfile = loadInspectionProfile(project);
|
||||
if (myInspectionProfile == null) return;
|
||||
|
||||
GlobalInspectionContextEx context = createGlobalInspectionContext(project);
|
||||
|
||||
final AnalysisScope scope;
|
||||
if (myAnalyzeChanges) {
|
||||
ChangeListManager changeListManager = ChangeListManager.getInstance(project);
|
||||
|
||||
+6
-7
@@ -5,7 +5,7 @@ import com.intellij.analysis.AnalysisScope;
|
||||
import com.intellij.ide.CommandLineInspectionProgressReporter;
|
||||
import com.intellij.ide.CommandLineInspectionProjectConfigurator;
|
||||
import com.intellij.facet.FacetManager;
|
||||
import com.intellij.openapi.application.ApplicationManager;
|
||||
import com.intellij.openapi.application.WriteAction;
|
||||
import com.intellij.openapi.fileTypes.FileTypeRegistry;
|
||||
import com.intellij.openapi.module.Module;
|
||||
import com.intellij.openapi.module.ModuleUtilCore;
|
||||
@@ -62,12 +62,11 @@ public class PythonPluginCommandLineInspectionProjectConfigurator implements Com
|
||||
logger.reportMessage(3, sdk.getHomePath());
|
||||
}
|
||||
final Sdk sdk = detectedSdks.get(0);
|
||||
ApplicationManager.getApplication().invokeAndWait(() -> {
|
||||
ApplicationManager.getApplication().runWriteAction(() -> {
|
||||
logger.reportMessage(1, "Settings up interpreter " + sdk.getName());
|
||||
ProjectJdkTable.getInstance().addJdk(sdk);
|
||||
});
|
||||
WriteAction.runAndWait(() -> {
|
||||
logger.reportMessage(1, "Settings up interpreter " + sdk.getName());
|
||||
ProjectJdkTable.getInstance().addJdk(sdk);
|
||||
});
|
||||
|
||||
PythonSdkUpdater.update(sdk, null, null, null);
|
||||
}
|
||||
else {
|
||||
@@ -88,7 +87,7 @@ public class PythonPluginCommandLineInspectionProjectConfigurator implements Com
|
||||
|
||||
Module m = ModuleUtilCore.findModuleForFile(f, project);
|
||||
if (m != null && FacetManager.getInstance(m).getFacetByType(facetType.getId()) == null) {
|
||||
ApplicationManager.getApplication().invokeAndWait(() -> {
|
||||
WriteAction.runAndWait(() -> {
|
||||
FacetManager.getInstance(m).addFacet(facetType, facetType.getPresentableName(), null);
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user