From 33ce59871856d8b274c5111c8dfd457bc4b6bf77 Mon Sep 17 00:00:00 2001 From: Dmitry Batkovich Date: Fri, 30 Jul 2021 09:40:42 +0300 Subject: [PATCH] add force index rescanning action GitOrigin-RevId: 6d24e2bc175375d9738d4bdb6ac10eb2e81f9e30 --- .../indexing/ForceIndexRescanningAction.java | 21 +++++++++++++++++++ .../src/messages/ActionsBundle.properties | 2 ++ .../src/idea/LangActions.xml | 2 ++ 3 files changed, 25 insertions(+) create mode 100644 platform/lang-impl/src/com/intellij/util/indexing/ForceIndexRescanningAction.java 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 @@ + +