diff --git a/platform/lang-impl/src/com/intellij/util/indexing/ForceIndexRescanningAction.java b/platform/lang-impl/src/com/intellij/util/indexing/ForceIndexRescanningAction.java new file mode 100644 index 000000000000..2f15526eb22c --- /dev/null +++ b/platform/lang-impl/src/com/intellij/util/indexing/ForceIndexRescanningAction.java @@ -0,0 +1,21 @@ +// 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. +package com.intellij.util.indexing; + +import com.intellij.openapi.actionSystem.AnActionEvent; +import com.intellij.openapi.project.DumbAwareAction; +import com.intellij.openapi.project.DumbService; +import com.intellij.openapi.project.Project; +import org.jetbrains.annotations.NotNull; + +final class ForceIndexRescanningAction extends DumbAwareAction { + @Override + public void actionPerformed(@NotNull AnActionEvent e) { + Project project = e.getProject(); + if (project == null) return; + UnindexedFilesUpdater task = new UnindexedFilesUpdater(project, + false, + null, + "Force re-scanning"); + DumbService.getInstance(project).queueTask(task); + } +} diff --git a/platform/platform-resources-en/src/messages/ActionsBundle.properties b/platform/platform-resources-en/src/messages/ActionsBundle.properties index 6700354c1811..02f4094ce99e 100644 --- a/platform/platform-resources-en/src/messages/ActionsBundle.properties +++ b/platform/platform-resources-en/src/messages/ActionsBundle.properties @@ -2481,3 +2481,5 @@ action.RunToolbarMainMultipleStopAction.text=Stop action.RunToolbarResumeAction.text=Resume action.RunToolbarPauseAction.text=Pause action.RunToolbarHotSwapAction.text=HotSwap + +action.ForceIndexRescanning.text=Synchronize Indexes diff --git a/platform/platform-resources/src/idea/LangActions.xml b/platform/platform-resources/src/idea/LangActions.xml index 75208771f0e7..e0ab3254bb9a 100644 --- a/platform/platform-resources/src/idea/LangActions.xml +++ b/platform/platform-resources/src/idea/LangActions.xml @@ -1590,5 +1590,7 @@ + +