diff --git a/java/java-impl/src/com/intellij/cyclicDependencies/actions/CyclicDependenciesAction.java b/java/java-impl/src/com/intellij/cyclicDependencies/actions/CyclicDependenciesAction.java index bb7db6267e91..58ff9a6a9f18 100644 --- a/java/java-impl/src/com/intellij/cyclicDependencies/actions/CyclicDependenciesAction.java +++ b/java/java-impl/src/com/intellij/cyclicDependencies/actions/CyclicDependenciesAction.java @@ -1,18 +1,4 @@ -/* - * Copyright 2000-2015 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +// Copyright 2000-2022 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. package com.intellij.cyclicDependencies.actions; import com.intellij.analysis.AnalysisScope; @@ -55,6 +41,11 @@ public class CyclicDependenciesAction extends AnAction{ event.getData(CommonDataKeys.PROJECT) != null); } + @Override + public @NotNull ActionUpdateThread getActionUpdateThread() { + return ActionUpdateThread.BGT; + } + @Override public void actionPerformed(@NotNull AnActionEvent e) { DataContext dataContext = e.getDataContext(); diff --git a/platform/execution-impl/src/com/intellij/execution/actions/RunConfigurationsComboBoxAction.java b/platform/execution-impl/src/com/intellij/execution/actions/RunConfigurationsComboBoxAction.java index eeac0fbdd9fa..2ad03e348574 100644 --- a/platform/execution-impl/src/com/intellij/execution/actions/RunConfigurationsComboBoxAction.java +++ b/platform/execution-impl/src/com/intellij/execution/actions/RunConfigurationsComboBoxAction.java @@ -65,6 +65,11 @@ public class RunConfigurationsComboBoxAction extends ComboBoxAction implements D return Registry.is("run.current.file.item.in.run.configurations.combobox"); } + @Override + public @NotNull ActionUpdateThread getActionUpdateThread() { + return ActionUpdateThread.BGT; + } + @Override public void update(@NotNull AnActionEvent e) { Presentation presentation = e.getPresentation(); diff --git a/platform/lang-impl/src/com/intellij/analysis/problemsView/toolWindow/ProblemFilter.kt b/platform/lang-impl/src/com/intellij/analysis/problemsView/toolWindow/ProblemFilter.kt index 9287c05c6a10..261e4cca8832 100644 --- a/platform/lang-impl/src/com/intellij/analysis/problemsView/toolWindow/ProblemFilter.kt +++ b/platform/lang-impl/src/com/intellij/analysis/problemsView/toolWindow/ProblemFilter.kt @@ -5,6 +5,7 @@ import com.intellij.analysis.problemsView.Problem import com.intellij.codeInsight.daemon.impl.SeverityRegistrar import com.intellij.lang.annotation.HighlightSeverity import com.intellij.openapi.actionSystem.ActionGroup +import com.intellij.openapi.actionSystem.ActionUpdateThread import com.intellij.openapi.actionSystem.AnAction import com.intellij.openapi.actionSystem.AnActionEvent import com.intellij.openapi.project.DumbAware @@ -34,6 +35,10 @@ internal class SeverityFiltersActionGroup : DumbAware, ActionGroup() { actions.add(OtherSeveritiesFilterAction(otherSeverities.map { it.myVal }, panel)) return actions.toTypedArray() } + + override fun getActionUpdateThread(): ActionUpdateThread { + return ActionUpdateThread.EDT + } } private abstract class SeverityFilterActionBase(name: @Nls String, protected val panel: HighlightingPanel): DumbAwareToggleAction(name) { diff --git a/platform/lang-impl/src/com/intellij/codeInsight/actions/OptimizeImportsAction.java b/platform/lang-impl/src/com/intellij/codeInsight/actions/OptimizeImportsAction.java index 8e01f8e7043a..ced4221b646b 100644 --- a/platform/lang-impl/src/com/intellij/codeInsight/actions/OptimizeImportsAction.java +++ b/platform/lang-impl/src/com/intellij/codeInsight/actions/OptimizeImportsAction.java @@ -1,4 +1,4 @@ -// Copyright 2000-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. +// Copyright 2000-2022 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. package com.intellij.codeInsight.actions; @@ -146,6 +146,11 @@ public class OptimizeImportsAction extends AnAction { } } + @Override + public @NotNull ActionUpdateThread getActionUpdateThread() { + return ActionUpdateThread.BGT; + } + @Override public void update(@NotNull AnActionEvent event) { if (!LanguageImportStatements.INSTANCE.hasAnyExtensions()) { diff --git a/platform/lang-impl/src/com/intellij/codeInsight/actions/ReformatCodeAction.java b/platform/lang-impl/src/com/intellij/codeInsight/actions/ReformatCodeAction.java index 99c41c190595..c5cda711f3ca 100644 --- a/platform/lang-impl/src/com/intellij/codeInsight/actions/ReformatCodeAction.java +++ b/platform/lang-impl/src/com/intellij/codeInsight/actions/ReformatCodeAction.java @@ -1,4 +1,4 @@ -// Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. +// Copyright 2000-2022 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. package com.intellij.codeInsight.actions; @@ -250,7 +250,10 @@ public class ReformatCodeAction extends AnAction implements DumbAware, LightEdit return PsiUtilCore.toPsiFileArray(list); } - + @Override + public @NotNull ActionUpdateThread getActionUpdateThread() { + return ActionUpdateThread.BGT; + } @Override public void update(@NotNull AnActionEvent event){ diff --git a/platform/lang-impl/src/com/intellij/codeInsight/actions/ShowReformatFileDialog.java b/platform/lang-impl/src/com/intellij/codeInsight/actions/ShowReformatFileDialog.java index c39f685f8640..f5f697900c63 100644 --- a/platform/lang-impl/src/com/intellij/codeInsight/actions/ShowReformatFileDialog.java +++ b/platform/lang-impl/src/com/intellij/codeInsight/actions/ShowReformatFileDialog.java @@ -1,18 +1,4 @@ -/* - * Copyright 2000-2014 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +// Copyright 2000-2022 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. package com.intellij.codeInsight.actions; import com.intellij.lang.LanguageFormatting; @@ -28,6 +14,11 @@ import org.jetbrains.annotations.NotNull; public class ShowReformatFileDialog extends AnAction implements DumbAware { private static final @NonNls String HELP_ID = "editing.codeReformatting"; + @Override + public @NotNull ActionUpdateThread getActionUpdateThread() { + return ActionUpdateThread.BGT; + } + @Override public void update(@NotNull AnActionEvent event) { Presentation presentation = event.getPresentation(); @@ -52,18 +43,15 @@ public class ShowReformatFileDialog extends AnAction implements DumbAware { @Override public void actionPerformed(@NotNull AnActionEvent event) { - Presentation presentation = event.getPresentation(); DataContext dataContext = event.getDataContext(); Project project = CommonDataKeys.PROJECT.getData(dataContext); Editor editor = CommonDataKeys.EDITOR.getData(dataContext); if (project == null || editor == null) { - presentation.setEnabled(false); return; } PsiFile file = PsiDocumentManager.getInstance(project).getPsiFile(editor.getDocument()); if (file == null || file.getVirtualFile() == null) { - presentation.setEnabled(false); return; } diff --git a/platform/lang-impl/src/com/intellij/codeInsight/codeVision/ShowCodeVisionPopupAction.kt b/platform/lang-impl/src/com/intellij/codeInsight/codeVision/ShowCodeVisionPopupAction.kt index 6d1f4f924168..3f44f736cccd 100644 --- a/platform/lang-impl/src/com/intellij/codeInsight/codeVision/ShowCodeVisionPopupAction.kt +++ b/platform/lang-impl/src/com/intellij/codeInsight/codeVision/ShowCodeVisionPopupAction.kt @@ -1,10 +1,16 @@ +// Copyright 2000-2022 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. package com.intellij.codeInsight.codeVision +import com.intellij.openapi.actionSystem.ActionUpdateThread import com.intellij.openapi.actionSystem.AnAction import com.intellij.openapi.actionSystem.AnActionEvent import com.intellij.openapi.actionSystem.PlatformDataKeys class ShowCodeVisionPopupAction : AnAction(CodeVisionBundle.message("ShowCodeVisionPopupAction.action.show.code.vision.text")) { + override fun getActionUpdateThread(): ActionUpdateThread { + return ActionUpdateThread.BGT + } + override fun update(e: AnActionEvent) { e.presentation.isEnabled = e.getData(PlatformDataKeys.EDITOR) != null } diff --git a/platform/lang-impl/src/com/intellij/codeInsight/daemon/impl/ConfigureHighlightingLevel.kt b/platform/lang-impl/src/com/intellij/codeInsight/daemon/impl/ConfigureHighlightingLevel.kt index a04022700c35..6273a9ad8abc 100644 --- a/platform/lang-impl/src/com/intellij/codeInsight/daemon/impl/ConfigureHighlightingLevel.kt +++ b/platform/lang-impl/src/com/intellij/codeInsight/daemon/impl/ConfigureHighlightingLevel.kt @@ -1,4 +1,4 @@ -// Copyright 2000-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. +// Copyright 2000-2022 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. package com.intellij.codeInsight.daemon.impl import com.intellij.codeInsight.daemon.DaemonBundle.message @@ -78,6 +78,9 @@ private class LevelAction(val level: InspectionsLevel, val provider: FileViewPro internal class ConfigureHighlightingLevelAction : DumbAwareAction() { + override fun getActionUpdateThread(): ActionUpdateThread { + return ActionUpdateThread.BGT + } override fun update(event: AnActionEvent) { val enabled = event.getData(PSI_FILE)?.viewProvider?.languages?.isNotEmpty() diff --git a/platform/lang-impl/src/com/intellij/codeInsight/daemon/impl/TogglePopupHintsAction.java b/platform/lang-impl/src/com/intellij/codeInsight/daemon/impl/TogglePopupHintsAction.java index 14f1cf467454..d825dfb759ad 100644 --- a/platform/lang-impl/src/com/intellij/codeInsight/daemon/impl/TogglePopupHintsAction.java +++ b/platform/lang-impl/src/com/intellij/codeInsight/daemon/impl/TogglePopupHintsAction.java @@ -1,26 +1,9 @@ -/* - * Copyright 2000-2017 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +// Copyright 2000-2022 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. package com.intellij.codeInsight.daemon.impl; import com.intellij.codeInsight.daemon.DaemonCodeAnalyzer; -import com.intellij.openapi.actionSystem.AnAction; -import com.intellij.openapi.actionSystem.AnActionEvent; -import com.intellij.openapi.actionSystem.CommonDataKeys; -import com.intellij.openapi.actionSystem.DataContext; +import com.intellij.openapi.actionSystem.*; import com.intellij.openapi.diagnostic.Logger; import com.intellij.openapi.fileEditor.FileEditorManager; import com.intellij.openapi.project.Project; @@ -32,6 +15,11 @@ import org.jetbrains.annotations.NotNull; public class TogglePopupHintsAction extends AnAction { private static final Logger LOG = Logger.getInstance(TogglePopupHintsAction.class); + @Override + public @NotNull ActionUpdateThread getActionUpdateThread() { + return ActionUpdateThread.EDT; + } + @Override public void update(@NotNull AnActionEvent e) { PsiFile psiFile = getTargetFile(e.getDataContext()); diff --git a/platform/lang-impl/src/com/intellij/codeInsight/documentation/render/ToggleRenderAllDocs.java b/platform/lang-impl/src/com/intellij/codeInsight/documentation/render/ToggleRenderAllDocs.java index e060f715607e..520456d10d50 100644 --- a/platform/lang-impl/src/com/intellij/codeInsight/documentation/render/ToggleRenderAllDocs.java +++ b/platform/lang-impl/src/com/intellij/codeInsight/documentation/render/ToggleRenderAllDocs.java @@ -1,6 +1,7 @@ -// Copyright 2000-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. +// Copyright 2000-2022 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. package com.intellij.codeInsight.documentation.render; +import com.intellij.openapi.actionSystem.ActionUpdateThread; import com.intellij.openapi.actionSystem.AnActionEvent; import com.intellij.openapi.actionSystem.ToggleAction; import com.intellij.openapi.editor.ex.EditorSettingsExternalizable; @@ -8,6 +9,11 @@ import com.intellij.openapi.project.DumbAware; import org.jetbrains.annotations.NotNull; public class ToggleRenderAllDocs extends ToggleAction implements DumbAware { + @Override + public @NotNull ActionUpdateThread getActionUpdateThread() { + return ActionUpdateThread.BGT; + } + @Override public boolean isSelected(@NotNull AnActionEvent e) { return EditorSettingsExternalizable.getInstance().isDocCommentRenderingEnabled(); diff --git a/platform/lang-impl/src/com/intellij/codeInsight/highlighting/actions/HighlightUsagesAction.java b/platform/lang-impl/src/com/intellij/codeInsight/highlighting/actions/HighlightUsagesAction.java index f2c10b597615..02e6c96705f3 100644 --- a/platform/lang-impl/src/com/intellij/codeInsight/highlighting/actions/HighlightUsagesAction.java +++ b/platform/lang-impl/src/com/intellij/codeInsight/highlighting/actions/HighlightUsagesAction.java @@ -1,4 +1,4 @@ -// Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. +// Copyright 2000-2022 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. package com.intellij.codeInsight.highlighting.actions; import com.intellij.codeInsight.highlighting.HighlightUsagesHandler; @@ -19,6 +19,11 @@ public class HighlightUsagesAction extends AnAction implements DumbAware { setInjectedContext(true); } + @Override + public @NotNull ActionUpdateThread getActionUpdateThread() { + return ActionUpdateThread.BGT; + } + @Override public void update(@NotNull AnActionEvent e) { Presentation presentation = e.getPresentation(); diff --git a/platform/lang-impl/src/com/intellij/codeInsight/hint/actions/QuickPreviewAction.java b/platform/lang-impl/src/com/intellij/codeInsight/hint/actions/QuickPreviewAction.java index 59f6910165e9..8a6744f8dcca 100644 --- a/platform/lang-impl/src/com/intellij/codeInsight/hint/actions/QuickPreviewAction.java +++ b/platform/lang-impl/src/com/intellij/codeInsight/hint/actions/QuickPreviewAction.java @@ -1,12 +1,9 @@ -// Copyright 2000-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. +// Copyright 2000-2022 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. package com.intellij.codeInsight.hint.actions; import com.intellij.codeInsight.hint.ImplementationViewSession; import com.intellij.codeInsight.hint.ImplementationViewSessionFactory; -import com.intellij.openapi.actionSystem.AnActionEvent; -import com.intellij.openapi.actionSystem.CommonDataKeys; -import com.intellij.openapi.actionSystem.DataContext; -import com.intellij.openapi.actionSystem.PlatformCoreDataKeys; +import com.intellij.openapi.actionSystem.*; import com.intellij.openapi.project.Project; import com.intellij.openapi.vfs.VirtualFile; import com.intellij.psi.PsiElement; @@ -39,6 +36,11 @@ public class QuickPreviewAction extends ShowImplementationsAction { } } + @Override + public @NotNull ActionUpdateThread getActionUpdateThread() { + return ActionUpdateThread.OLD_EDT; + } + protected boolean isQuickPreviewAvailableFor(AnActionEvent e) { Component component = e.getData(PlatformCoreDataKeys.CONTEXT_COMPONENT); if (component instanceof JTree || component instanceof JList) { diff --git a/platform/lang-impl/src/com/intellij/codeInsight/hint/actions/ShowImplementationsAction.java b/platform/lang-impl/src/com/intellij/codeInsight/hint/actions/ShowImplementationsAction.java index 877c81cadf5e..5aedf7b5e9a3 100644 --- a/platform/lang-impl/src/com/intellij/codeInsight/hint/actions/ShowImplementationsAction.java +++ b/platform/lang-impl/src/com/intellij/codeInsight/hint/actions/ShowImplementationsAction.java @@ -1,9 +1,10 @@ -// Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. +// Copyright 2000-2022 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. package com.intellij.codeInsight.hint.actions; import com.intellij.codeInsight.CodeInsightBundle; import com.intellij.codeInsight.hint.ImplementationViewSession; import com.intellij.codeInsight.hint.ImplementationViewSessionFactory; +import com.intellij.openapi.actionSystem.ActionUpdateThread; import com.intellij.openapi.project.Project; import org.jetbrains.annotations.NonNls; import org.jetbrains.annotations.NotNull; @@ -14,6 +15,11 @@ public class ShowImplementationsAction extends ShowRelatedElementsActionBase { @NonNls public static final String CODEASSISTS_QUICKDEFINITION_LOOKUP_FEATURE = "codeassists.quickdefinition.lookup"; @NonNls public static final String CODEASSISTS_QUICKDEFINITION_FEATURE = "codeassists.quickdefinition"; + @Override + public @NotNull ActionUpdateThread getActionUpdateThread() { + return ActionUpdateThread.BGT; + } + @Override @NotNull protected List getSessionFactories() { diff --git a/platform/lang-impl/src/com/intellij/codeInsight/hint/actions/ShowTypeDefinitionAction.kt b/platform/lang-impl/src/com/intellij/codeInsight/hint/actions/ShowTypeDefinitionAction.kt index 9933c879659a..d84a2e7f7bc3 100644 --- a/platform/lang-impl/src/com/intellij/codeInsight/hint/actions/ShowTypeDefinitionAction.kt +++ b/platform/lang-impl/src/com/intellij/codeInsight/hint/actions/ShowTypeDefinitionAction.kt @@ -1,4 +1,4 @@ -// Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. +// Copyright 2000-2022 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. package com.intellij.codeInsight.hint.actions import com.intellij.codeInsight.CodeInsightBundle @@ -6,6 +6,7 @@ import com.intellij.codeInsight.documentation.DocumentationManager import com.intellij.codeInsight.hint.* import com.intellij.codeInsight.navigation.actions.TypeDeclarationProvider import com.intellij.ide.DataManager +import com.intellij.openapi.actionSystem.ActionUpdateThread import com.intellij.openapi.actionSystem.CommonDataKeys import com.intellij.openapi.actionSystem.DataContext import com.intellij.openapi.application.ReadAction @@ -25,6 +26,10 @@ import java.awt.Component import kotlin.streams.asSequence open class ShowTypeDefinitionAction : ShowRelatedElementsActionBase() { + override fun getActionUpdateThread(): ActionUpdateThread { + return ActionUpdateThread.BGT + } + override fun getSessionFactories(): List = listOf(TypeDefinitionsViewSessionFactory) override fun getPopupTitle(session: ImplementationViewSession): String { diff --git a/platform/lang-impl/src/com/intellij/codeInsight/hints/ToggleCompletionHintsAction.java b/platform/lang-impl/src/com/intellij/codeInsight/hints/ToggleCompletionHintsAction.java index 35f7b84b56de..fc823155074a 100644 --- a/platform/lang-impl/src/com/intellij/codeInsight/hints/ToggleCompletionHintsAction.java +++ b/platform/lang-impl/src/com/intellij/codeInsight/hints/ToggleCompletionHintsAction.java @@ -1,21 +1,8 @@ -/* - * Copyright 2000-2017 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +// Copyright 2000-2022 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. package com.intellij.codeInsight.hints; import com.intellij.codeInsight.CodeInsightSettings; +import com.intellij.openapi.actionSystem.ActionUpdateThread; import com.intellij.openapi.actionSystem.AnActionEvent; import com.intellij.openapi.actionSystem.CommonDataKeys; import com.intellij.openapi.actionSystem.ToggleAction; @@ -23,6 +10,11 @@ import com.intellij.psi.PsiFile; import org.jetbrains.annotations.NotNull; public class ToggleCompletionHintsAction extends ToggleAction { + @Override + public @NotNull ActionUpdateThread getActionUpdateThread() { + return ActionUpdateThread.BGT; + } + @Override public void update(@NotNull AnActionEvent e) { super.update(e); diff --git a/platform/lang-impl/src/com/intellij/codeInsight/hints/ToggleInlayHintsGloballyAction.kt b/platform/lang-impl/src/com/intellij/codeInsight/hints/ToggleInlayHintsGloballyAction.kt index 1bad7917585c..9ec7a1433030 100644 --- a/platform/lang-impl/src/com/intellij/codeInsight/hints/ToggleInlayHintsGloballyAction.kt +++ b/platform/lang-impl/src/com/intellij/codeInsight/hints/ToggleInlayHintsGloballyAction.kt @@ -1,7 +1,8 @@ -// Copyright 2000-2021 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. +// Copyright 2000-2022 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. package com.intellij.codeInsight.hints import com.intellij.codeInsight.CodeInsightBundle +import com.intellij.openapi.actionSystem.ActionUpdateThread import com.intellij.openapi.actionSystem.AnActionEvent import com.intellij.openapi.actionSystem.ToggleAction import com.intellij.openapi.actionSystem.Toggleable @@ -11,6 +12,10 @@ class ToggleInlayHintsGloballyAction : ToggleAction(CodeInsightBundle.message("i return InlayHintsSettings.instance().hintsEnabledGlobally() } + override fun getActionUpdateThread(): ActionUpdateThread { + return ActionUpdateThread.BGT + } + override fun setSelected(e: AnActionEvent, state: Boolean) { InlayHintsSettings.instance().setEnabledGlobally(state) InlayHintsPassFactory.forceHintsUpdateOnNextPass() diff --git a/platform/lang-impl/src/com/intellij/codeInsight/navigation/actions/IncrementalSearchAction.java b/platform/lang-impl/src/com/intellij/codeInsight/navigation/actions/IncrementalSearchAction.java index cb53884e968b..91f1d7a354a2 100644 --- a/platform/lang-impl/src/com/intellij/codeInsight/navigation/actions/IncrementalSearchAction.java +++ b/platform/lang-impl/src/com/intellij/codeInsight/navigation/actions/IncrementalSearchAction.java @@ -1,26 +1,12 @@ -/* - * Copyright 2000-2009 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +// Copyright 2000-2022 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. package com.intellij.codeInsight.navigation.actions; import com.intellij.codeInsight.navigation.IncrementalSearchHandler; import com.intellij.openapi.actionSystem.*; import com.intellij.openapi.editor.Editor; -import com.intellij.openapi.project.Project; import com.intellij.openapi.project.DumbAware; +import com.intellij.openapi.project.Project; import org.jetbrains.annotations.NotNull; public class IncrementalSearchAction extends AnAction implements DumbAware { @@ -38,6 +24,11 @@ public class IncrementalSearchAction extends AnAction implements DumbAware { new IncrementalSearchHandler().invoke(project, editor); } + @Override + public @NotNull ActionUpdateThread getActionUpdateThread() { + return ActionUpdateThread.BGT; + } + @Override public void update(@NotNull AnActionEvent event){ Presentation presentation = event.getPresentation(); diff --git a/platform/lang-impl/src/com/intellij/codeInspection/actions/CodeInspectionOnEditorAction.java b/platform/lang-impl/src/com/intellij/codeInspection/actions/CodeInspectionOnEditorAction.java index 622d7d16280f..280a84519d24 100644 --- a/platform/lang-impl/src/com/intellij/codeInspection/actions/CodeInspectionOnEditorAction.java +++ b/platform/lang-impl/src/com/intellij/codeInspection/actions/CodeInspectionOnEditorAction.java @@ -1,18 +1,4 @@ -/* - * Copyright 2000-2016 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +// Copyright 2000-2022 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. package com.intellij.codeInspection.actions; import com.intellij.analysis.AnalysisScope; @@ -20,10 +6,7 @@ import com.intellij.codeInsight.daemon.DaemonCodeAnalyzer; import com.intellij.codeInspection.InspectionManager; import com.intellij.codeInspection.ex.GlobalInspectionContextImpl; import com.intellij.codeInspection.ex.InspectionManagerEx; -import com.intellij.openapi.actionSystem.AnAction; -import com.intellij.openapi.actionSystem.AnActionEvent; -import com.intellij.openapi.actionSystem.CommonDataKeys; -import com.intellij.openapi.actionSystem.DataContext; +import com.intellij.openapi.actionSystem.*; import com.intellij.openapi.fileEditor.FileDocumentManager; import com.intellij.openapi.project.Project; import com.intellij.profile.codeInspection.InspectionProjectProfileManager; @@ -54,6 +37,11 @@ public class CodeInspectionOnEditorAction extends AnAction { inspectionContext.doInspections(scope); } + @Override + public @NotNull ActionUpdateThread getActionUpdateThread() { + return ActionUpdateThread.BGT; + } + @Override public void update(@NotNull AnActionEvent e) { final DataContext dataContext = e.getDataContext(); diff --git a/platform/lang-impl/src/com/intellij/codeInspection/actions/ViewOfflineResultsAction.java b/platform/lang-impl/src/com/intellij/codeInspection/actions/ViewOfflineResultsAction.java index 12841c0ddbb7..18a00a62c344 100644 --- a/platform/lang-impl/src/com/intellij/codeInspection/actions/ViewOfflineResultsAction.java +++ b/platform/lang-impl/src/com/intellij/codeInspection/actions/ViewOfflineResultsAction.java @@ -15,10 +15,7 @@ import com.intellij.codeInspection.offlineViewer.OfflineViewParseUtil; import com.intellij.codeInspection.reference.RefManagerImpl; import com.intellij.codeInspection.ui.InspectionResultsView; import com.intellij.icons.AllIcons; -import com.intellij.openapi.actionSystem.ActionPlaces; -import com.intellij.openapi.actionSystem.AnAction; -import com.intellij.openapi.actionSystem.AnActionEvent; -import com.intellij.openapi.actionSystem.Presentation; +import com.intellij.openapi.actionSystem.*; import com.intellij.openapi.application.ApplicationManager; import com.intellij.openapi.application.ReadAction; import com.intellij.openapi.diagnostic.Logger; @@ -57,6 +54,11 @@ public class ViewOfflineResultsAction extends AnAction { presentation.setVisible(ActionPlaces.isMainMenuOrActionSearch(event.getPlace())); } + @Override + public @NotNull ActionUpdateThread getActionUpdateThread() { + return ActionUpdateThread.BGT; + } + @Override public void actionPerformed(@NotNull AnActionEvent event) { final Project project = event.getProject(); diff --git a/platform/lang-impl/src/com/intellij/codeInspection/ex/SeverityEditorDialogAction.java b/platform/lang-impl/src/com/intellij/codeInspection/ex/SeverityEditorDialogAction.java index 213f809a9f14..e79e3537b3ac 100644 --- a/platform/lang-impl/src/com/intellij/codeInspection/ex/SeverityEditorDialogAction.java +++ b/platform/lang-impl/src/com/intellij/codeInspection/ex/SeverityEditorDialogAction.java @@ -1,8 +1,9 @@ -// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. +// Copyright 2000-2022 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. package com.intellij.codeInspection.ex; import com.intellij.codeInsight.daemon.impl.SeverityRegistrar; import com.intellij.idea.ActionsBundle; +import com.intellij.openapi.actionSystem.ActionUpdateThread; import com.intellij.openapi.actionSystem.AnAction; import com.intellij.openapi.actionSystem.AnActionEvent; import com.intellij.openapi.project.DumbAware; @@ -17,6 +18,11 @@ public class SeverityEditorDialogAction extends AnAction implements DumbAware { super(ActionsBundle.messagePointer("action.SeverityEditorDialogAction.text")); } + @Override + public @NotNull ActionUpdateThread getActionUpdateThread() { + return ActionUpdateThread.BGT; + } + @Override public void actionPerformed(@NotNull AnActionEvent e) { Project project = e.getProject(); diff --git a/platform/lang-impl/src/com/intellij/codeInspection/ui/actions/QuickFixesViewActionGroup.java b/platform/lang-impl/src/com/intellij/codeInspection/ui/actions/QuickFixesViewActionGroup.java index 022f2730b847..22bcf2e60338 100644 --- a/platform/lang-impl/src/com/intellij/codeInspection/ui/actions/QuickFixesViewActionGroup.java +++ b/platform/lang-impl/src/com/intellij/codeInspection/ui/actions/QuickFixesViewActionGroup.java @@ -1,12 +1,11 @@ -/* - * Copyright 2000-2017 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. - */ +// Copyright 2000-2022 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. package com.intellij.codeInspection.ui.actions; import com.intellij.codeInspection.ex.InspectionToolWrapper; import com.intellij.codeInspection.ex.QuickFixAction; import com.intellij.codeInspection.ui.InspectionResultsView; import com.intellij.openapi.actionSystem.ActionGroup; +import com.intellij.openapi.actionSystem.ActionUpdateThread; import com.intellij.openapi.actionSystem.AnAction; import com.intellij.openapi.actionSystem.AnActionEvent; import org.jetbrains.annotations.NotNull; @@ -18,6 +17,11 @@ import static com.intellij.codeInspection.ui.actions.InspectionViewActionBase.ge * @author Dmitry Batkovich */ public class QuickFixesViewActionGroup extends ActionGroup { + @Override + public @NotNull ActionUpdateThread getActionUpdateThread() { + return ActionUpdateThread.EDT; + } + @Override public AnAction @NotNull [] getChildren(@Nullable AnActionEvent e) { InspectionResultsView view = getView(e); diff --git a/platform/lang-impl/src/com/intellij/codeInspection/ui/actions/suppress/SuppressActionWrapper.java b/platform/lang-impl/src/com/intellij/codeInspection/ui/actions/suppress/SuppressActionWrapper.java index 63a725dfdd37..901fee813cde 100644 --- a/platform/lang-impl/src/com/intellij/codeInspection/ui/actions/suppress/SuppressActionWrapper.java +++ b/platform/lang-impl/src/com/intellij/codeInspection/ui/actions/suppress/SuppressActionWrapper.java @@ -1,4 +1,4 @@ -// Copyright 2000-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. +// Copyright 2000-2022 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. package com.intellij.codeInspection.ui.actions.suppress; @@ -39,6 +39,11 @@ public class SuppressActionWrapper extends ActionGroup implements CompactActionG super(InspectionsBundle.messagePointer("suppress.inspection.problem"), false); } + @Override + public @NotNull ActionUpdateThread getActionUpdateThread() { + return ActionUpdateThread.EDT; + } + @Override public AnAction @NotNull [] getChildren(@Nullable final AnActionEvent e) { final InspectionResultsView view = getView(e); diff --git a/platform/lang-impl/src/com/intellij/ide/actions/GotoActionBase.java b/platform/lang-impl/src/com/intellij/ide/actions/GotoActionBase.java index b8be33e4c907..fb074ace1ed9 100644 --- a/platform/lang-impl/src/com/intellij/ide/actions/GotoActionBase.java +++ b/platform/lang-impl/src/com/intellij/ide/actions/GotoActionBase.java @@ -1,4 +1,4 @@ -// Copyright 2000-2021 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. +// Copyright 2000-2022 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. package com.intellij.ide.actions; @@ -67,6 +67,11 @@ public abstract class GotoActionBase extends AnAction { protected abstract void gotoActionPerformed(@NotNull AnActionEvent e); + @Override + public @NotNull ActionUpdateThread getActionUpdateThread() { + return ActionUpdateThread.BGT; + } + @Override public void update(@NotNull final AnActionEvent event) { final Presentation presentation = event.getPresentation();