From 43ace6c0eab131d82698c29a3b8b345b29eb173e Mon Sep 17 00:00:00 2001 From: Peter Gromov Date: Thu, 24 Sep 2020 16:03:38 +0200 Subject: [PATCH] unify some "Results might be incomplete during indexing" messages, fix grammar in related places GitOrigin-RevId: f4f31dcadaf1945f950fe267e3def63ca623464c --- .../impl/java/JavaClassTreeElementBase.java | 2 +- .../src/com/intellij/openapi/project/DumbService.java | 2 +- .../resources/messages/CodeInsightBundle.properties | 6 ++---- .../searcheverywhere/SearchEverywhereContributor.java | 1 + .../completion/CompletionProgressIndicator.java | 8 ++++++-- .../codeInsight/hint/ParameterInfoComponent.java | 9 +++------ .../searcheverywhere/AbstractGotoSEContributor.java | 3 ++- .../platform-api/resources/messages/IdeBundle.properties | 6 +++--- .../com/intellij/openapi/project/DumbServiceImpl.java | 2 +- .../com/jetbrains/python/psi/resolve/PyResolveUtil.java | 2 +- 10 files changed, 21 insertions(+), 20 deletions(-) diff --git a/java/java-structure-view/src/com/intellij/ide/structureView/impl/java/JavaClassTreeElementBase.java b/java/java-structure-view/src/com/intellij/ide/structureView/impl/java/JavaClassTreeElementBase.java index 702e0d803635..56b532fe2a69 100644 --- a/java/java-structure-view/src/com/intellij/ide/structureView/impl/java/JavaClassTreeElementBase.java +++ b/java/java-structure-view/src/com/intellij/ide/structureView/impl/java/JavaClassTreeElementBase.java @@ -111,7 +111,7 @@ public abstract class JavaClassTreeElementBase extends return isDeprecated() ? CodeInsightColors.DEPRECATED_ATTRIBUTES : null; } catch (IndexNotReadyException ignore) { - return null; // do not show deprecated elements while indexing + return null; // do not show deprecated elements during indexing } } diff --git a/platform/core-api/src/com/intellij/openapi/project/DumbService.java b/platform/core-api/src/com/intellij/openapi/project/DumbService.java index d7ac9c780643..620481480068 100644 --- a/platform/core-api/src/com/intellij/openapi/project/DumbService.java +++ b/platform/core-api/src/com/intellij/openapi/project/DumbService.java @@ -257,7 +257,7 @@ public abstract class DumbService { public abstract JComponent wrapGently(@NotNull JComponent dumbUnawareContent, @NotNull Disposable parentDisposable); /** - * Adds a "Results might be incomplete while indexing." decorator to a given component during dumb mode. + * Adds a "Results might be incomplete during indexing." decorator to a given component during dumb mode. * * @param dumbAwareContent - a component to wrap * @param updateRunnable - an action to execute when dumb mode state changed or user explicitly request reload panel diff --git a/platform/lang-api/resources/messages/CodeInsightBundle.properties b/platform/lang-api/resources/messages/CodeInsightBundle.properties index d49caadb2211..b29edd23b2ef 100644 --- a/platform/lang-api/resources/messages/CodeInsightBundle.properties +++ b/platform/lang-api/resources/messages/CodeInsightBundle.properties @@ -284,7 +284,6 @@ collapse.selection.overlapping.warning.ok=Remove collapse.selection.overlapping.warning.cancel=Cancel parameter.info.progress.title=Calculating parameter info... -parameter.info.incomplete=Information might be incomplete until indexing is finished configurable.PostfixTemplatesConfigurable.display.name=Postfix Completion configurable.InspectionToolsConfigurable.display.name=Inspections @@ -292,8 +291,7 @@ gutter.color.preview=Color preview completion.not.available.during.indexing=Code completion is not available here while indices are being built completion.automatic.command.name=Autocompletion -completion.incomplete.during.indexing=Results might be incomplete while indexing is in progress -completion.incomplete.during.indexing.suffix=; results might be incomplete while indexing is in progress +completion.incomplete.during.indexing.suffix=; results might be incomplete during indexing completion.incomplete.light.edit.suffix=; results might be incomplete in LightEdit mode. Open file in project completion.ad.press.0.to.insert.1.to.replace=Press {0} to insert, {1} to replace @@ -373,7 +371,7 @@ intention.text.edit.0.fragment=Edit {0} Fragment message.file.size.0.exceeds.code.insight.limit.1=The file size ({0}) exceeds configured limit ({1}). Code insight features are not available. command.fix.documentation=Fix documentation label.slow.inspections.progress.report.long.line=Slow inspections progress report long line -notification.navigation.is.not.available.while.indexing=Navigation is not available while indexing +notification.navigation.is.not.available.while.indexing=Navigation is not available during indexing notification.0.is.not.available.during.indexing={0} is not available during indexing comment.use.expr.variable.to.refer.target.expression=Use $EXPR$ variable to refer target expression label.applicable.expression.types=Applicable expression types: diff --git a/platform/lang-api/src/com/intellij/ide/actions/searcheverywhere/SearchEverywhereContributor.java b/platform/lang-api/src/com/intellij/ide/actions/searcheverywhere/SearchEverywhereContributor.java index 4c6e67ebb269..079d5426f77f 100644 --- a/platform/lang-api/src/com/intellij/ide/actions/searcheverywhere/SearchEverywhereContributor.java +++ b/platform/lang-api/src/com/intellij/ide/actions/searcheverywhere/SearchEverywhereContributor.java @@ -60,6 +60,7 @@ public interface SearchEverywhereContributor extends PossiblyDumbAware, Di } @Nullable + @Nls default String getAdvertisement() { return null; } @NotNull diff --git a/platform/lang-impl/src/com/intellij/codeInsight/completion/CompletionProgressIndicator.java b/platform/lang-impl/src/com/intellij/codeInsight/completion/CompletionProgressIndicator.java index 37f14ea03300..4a75b2bdef30 100644 --- a/platform/lang-impl/src/com/intellij/codeInsight/completion/CompletionProgressIndicator.java +++ b/platform/lang-impl/src/com/intellij/codeInsight/completion/CompletionProgressIndicator.java @@ -14,6 +14,7 @@ import com.intellij.codeInsight.lookup.*; import com.intellij.codeInsight.lookup.impl.LookupImpl; import com.intellij.featureStatistics.FeatureUsageTracker; import com.intellij.icons.AllIcons; +import com.intellij.ide.IdeBundle; import com.intellij.ide.lightEdit.LightEdit; import com.intellij.ide.lightEdit.LightEditUtil; import com.intellij.injected.editor.DocumentWindow; @@ -36,8 +37,11 @@ import com.intellij.openapi.progress.util.ProgressWrapper; import com.intellij.openapi.project.DumbService; import com.intellij.openapi.project.IndexNotReadyException; import com.intellij.openapi.project.Project; -import com.intellij.openapi.util.*; +import com.intellij.openapi.util.Disposer; import com.intellij.openapi.util.NlsContexts.HintText; +import com.intellij.openapi.util.Pair; +import com.intellij.openapi.util.Ref; +import com.intellij.openapi.util.TextRange; import com.intellij.openapi.util.registry.Registry; import com.intellij.openapi.util.text.StringUtil; import com.intellij.patterns.ElementPattern; @@ -234,7 +238,7 @@ public class CompletionProgressIndicator extends ProgressIndicatorBase implement private void addDefaultAdvertisements(CompletionParameters parameters) { if (DumbService.isDumb(getProject())) { - addAdvertisement(CodeInsightBundle.message("completion.incomplete.during.indexing"), AllIcons.General.Warning); + addAdvertisement(IdeBundle.message("dumb.mode.results.might.be.incomplete"), AllIcons.General.Warning); return; } diff --git a/platform/lang-impl/src/com/intellij/codeInsight/hint/ParameterInfoComponent.java b/platform/lang-impl/src/com/intellij/codeInsight/hint/ParameterInfoComponent.java index 955442f2778f..c62695c74b41 100644 --- a/platform/lang-impl/src/com/intellij/codeInsight/hint/ParameterInfoComponent.java +++ b/platform/lang-impl/src/com/intellij/codeInsight/hint/ParameterInfoComponent.java @@ -4,6 +4,7 @@ package com.intellij.codeInsight.hint; import com.intellij.codeInsight.CodeInsightBundle; import com.intellij.icons.AllIcons; +import com.intellij.ide.IdeBundle; import com.intellij.injected.editor.EditorWindow; import com.intellij.lang.parameterInfo.ParameterInfoHandler; import com.intellij.lang.parameterInfo.ParameterInfoUIContextEx; @@ -32,11 +33,7 @@ import com.intellij.xml.util.XmlStringUtil; import it.unimi.dsi.fastutil.ints.Int2IntMap; import it.unimi.dsi.fastutil.ints.Int2IntMaps; import it.unimi.dsi.fastutil.ints.Int2IntOpenHashMap; -import org.jetbrains.annotations.Contract; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; -import org.jetbrains.annotations.TestOnly; -import org.jetbrains.annotations.VisibleForTesting; +import org.jetbrains.annotations.*; import javax.swing.*; import javax.swing.border.Border; @@ -61,7 +58,7 @@ public class ParameterInfoComponent extends JPanel { private final JPanel myMainPanel; private OneElementComponent[] myPanels; private JLabel myShortcutLabel; - private final JLabel myDumbLabel = new JLabel(CodeInsightBundle.message("parameter.info.incomplete")); + private final JLabel myDumbLabel = new JLabel(IdeBundle.message("dumb.mode.results.might.be.incomplete")); private final boolean myAllowSwitchLabel; private final Font NORMAL_FONT; diff --git a/platform/lang-impl/src/com/intellij/ide/actions/searcheverywhere/AbstractGotoSEContributor.java b/platform/lang-impl/src/com/intellij/ide/actions/searcheverywhere/AbstractGotoSEContributor.java index 90024cdca32a..b9050dd20196 100644 --- a/platform/lang-impl/src/com/intellij/ide/actions/searcheverywhere/AbstractGotoSEContributor.java +++ b/platform/lang-impl/src/com/intellij/ide/actions/searcheverywhere/AbstractGotoSEContributor.java @@ -3,6 +3,7 @@ package com.intellij.ide.actions.searcheverywhere; import com.intellij.codeInsight.navigation.NavigationUtil; import com.intellij.ide.DataManager; +import com.intellij.ide.IdeBundle; import com.intellij.ide.actions.GotoActionBase; import com.intellij.ide.actions.QualifiedNameProviderUtil; import com.intellij.ide.actions.SearchEverywherePsiRenderer; @@ -140,7 +141,7 @@ public abstract class AbstractGotoSEContributor implements WeightedSearchEverywh @Nullable @Override public String getAdvertisement() { - return DumbService.isDumb(myProject) ? "Results might be incomplete. The project is being indexed." : null; + return DumbService.isDumb(myProject) ? IdeBundle.message("dumb.mode.results.might.be.incomplete") : null; } @NotNull diff --git a/platform/platform-api/resources/messages/IdeBundle.properties b/platform/platform-api/resources/messages/IdeBundle.properties index e9d499ac5bdc..8ddebcbe4554 100644 --- a/platform/platform-api/resources/messages/IdeBundle.properties +++ b/platform/platform-api/resources/messages/IdeBundle.properties @@ -536,7 +536,7 @@ node.projectview.external.libraries=External Libraries tooltip.module.group=Module Group node.projectview.library={0} library node.project.view.bad.link=Invalid symlink -dumb.mode.spoiler.wrapper.text=Results might be incomplete while indexing. +dumb.mode.results.might.be.incomplete=Results might be incomplete during indexing dumb.mode.spoiler.wrapper.reload.text=Reload results node.structureview.invalid= action.next.todo=Next TODO @@ -1888,8 +1888,8 @@ startup.indicator.text.running.startup.activities=Running startup activities... notification.configurable.display.name.notifications=Notifications dumb.balloon.this.action=This action dumb.balloon.none.of.the.following.actions=None of the following actions -dumb.balloon.0.are.not.available.while.indexing={0} are not available while indexing -dumb.balloon.0.is.not.available.while.indexing={0} is not available while indexing +dumb.balloon.0.are.not.available.while.indexing={0} are not available during indexing +dumb.balloon.0.is.not.available.while.indexing={0} is not available during indexing label.chrome.command.line.options=&Command line options: checkbox.use.custom.user.data.directory.for.chrome=&Use custom user data directory: diff --git a/platform/platform-impl/src/com/intellij/openapi/project/DumbServiceImpl.java b/platform/platform-impl/src/com/intellij/openapi/project/DumbServiceImpl.java index c38ddf29c8cd..0d9a1c7a3166 100644 --- a/platform/platform-impl/src/com/intellij/openapi/project/DumbServiceImpl.java +++ b/platform/platform-impl/src/com/intellij/openapi/project/DumbServiceImpl.java @@ -452,7 +452,7 @@ public class DumbServiceImpl extends DumbService implements Disposable, Modifica @Override public JComponent wrapWithSpoiler(@NotNull JComponent dumbAwareContent, @NotNull Runnable updateRunnable, @NotNull Disposable parentDisposable) { //TODO replace with a proper mockup implementation - DeprecationStripePanel stripePanel = new DeprecationStripePanel(IdeBundle.message("dumb.mode.spoiler.wrapper.text"), AllIcons.General.Warning) + DeprecationStripePanel stripePanel = new DeprecationStripePanel(IdeBundle.message("dumb.mode.results.might.be.incomplete"), AllIcons.General.Warning) .withAlternativeAction(IdeBundle.message("dumb.mode.spoiler.wrapper.reload.text"), new DumbAwareAction() { @Override public void actionPerformed(@NotNull AnActionEvent e) { diff --git a/python/python-psi-impl/src/com/jetbrains/python/psi/resolve/PyResolveUtil.java b/python/python-psi-impl/src/com/jetbrains/python/psi/resolve/PyResolveUtil.java index 4bec2dafa46e..0ec3cd72d68b 100644 --- a/python/python-psi-impl/src/com/jetbrains/python/psi/resolve/PyResolveUtil.java +++ b/python/python-psi-impl/src/com/jetbrains/python/psi/resolve/PyResolveUtil.java @@ -371,7 +371,7 @@ public final class PyResolveUtil { @Nullable public static ScopeOwner parentScopeForUnresolvedClassLevelName(@NotNull PyClass cls, @NotNull String name) { // com.jetbrains.python.codeInsight.dataflow.scope.Scope.containsDeclaration could not be used - // because it runs resolve on imports that is forbidden while indexing + // because it runs resolve on imports that is forbidden during indexing return containsDeclaration(cls, name) ? PyUtil.as(cls.getContainingFile(), PyFile.class) : ScopeUtil.getScopeOwner(cls); }