mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Move DumpIndexAction to lang-impl (there is not need for it to be in Java modules)
GitOrigin-RevId: 2b789a9865f89865526c1f23f5b42eddad170065
This commit is contained in:
committed by
intellij-monorepo-bot
parent
3a215fb792
commit
ff0b24139e
@@ -19,6 +19,7 @@ import com.intellij.openapi.roots.OrderRootType
|
||||
import com.intellij.openapi.roots.ProjectRootManager
|
||||
import com.intellij.openapi.util.io.FileUtil
|
||||
import com.intellij.openapi.util.text.StringUtil
|
||||
import com.intellij.util.indexing.hash.DumpIndexAction
|
||||
import com.intellij.util.io.*
|
||||
import com.intellij.util.lang.JavaVersion
|
||||
import java.io.File
|
||||
|
||||
@@ -1,7 +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.
|
||||
package com.intellij.util.indexing
|
||||
|
||||
import com.intellij.internal.DumpIndexAction
|
||||
import com.intellij.util.indexing.hash.DumpIndexAction
|
||||
import com.intellij.openapi.application.ApplicationManager
|
||||
import com.intellij.openapi.application.PathManager
|
||||
import com.intellij.openapi.progress.EmptyProgressIndicator
|
||||
|
||||
+7
-69
@@ -1,9 +1,7 @@
|
||||
// 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.
|
||||
package com.intellij.internal;
|
||||
// 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.
|
||||
package com.intellij.util.indexing.hash;
|
||||
|
||||
import com.intellij.codeInspection.bytecodeAnalysis.BytecodeAnalysisIndex;
|
||||
import com.intellij.concurrency.JobLauncher;
|
||||
import com.intellij.find.ngrams.TrigramIndex;
|
||||
import com.intellij.openapi.actionSystem.AnAction;
|
||||
import com.intellij.openapi.actionSystem.AnActionEvent;
|
||||
import com.intellij.openapi.application.ReadAction;
|
||||
@@ -24,21 +22,11 @@ import com.intellij.openapi.vfs.VfsUtilCore;
|
||||
import com.intellij.openapi.vfs.VirtualFile;
|
||||
import com.intellij.openapi.vfs.VirtualFileVisitor;
|
||||
import com.intellij.psi.SingleRootFileViewProvider;
|
||||
import com.intellij.psi.impl.JavaSimplePropertyIndex;
|
||||
import com.intellij.psi.impl.cache.impl.id.IdIndex;
|
||||
import com.intellij.psi.impl.cache.impl.todo.TodoIndex;
|
||||
import com.intellij.psi.impl.java.JavaBinaryPlusExpressionIndex;
|
||||
import com.intellij.psi.impl.java.JavaFunctionalExpressionIndex;
|
||||
import com.intellij.psi.impl.java.stubs.index.JavaAutoModuleNameIndex;
|
||||
import com.intellij.psi.impl.search.JavaNullMethodArgumentIndex;
|
||||
import com.intellij.psi.stubs.StubUpdatingIndex;
|
||||
import com.intellij.util.containers.ContainerUtil;
|
||||
import com.intellij.util.hash.ContentHashEnumerator;
|
||||
import com.intellij.util.indexing.FileBasedIndexExtension;
|
||||
import com.intellij.util.indexing.ID;
|
||||
import com.intellij.util.indexing.IndexableSetContributor;
|
||||
import com.intellij.util.indexing.hash.HashBasedIndexGenerator;
|
||||
import com.intellij.util.indexing.hash.StubHashBasedIndexGenerator;
|
||||
import com.intellij.util.io.PathKt;
|
||||
import com.intellij.util.io.zip.JBZipEntry;
|
||||
import com.intellij.util.io.zip.JBZipFile;
|
||||
@@ -135,7 +123,11 @@ public class DumpIndexAction extends AnAction {
|
||||
indicator.setText("Indexing chunk " + chunk.getName());
|
||||
Path chunkRoot = indexRoot.resolve(chunk.getName());
|
||||
ReadAction.run(() -> {
|
||||
List<HashBasedIndexGenerator<?, ?>> fileBasedGenerators = getExportableIndices(true)
|
||||
List<HashBasedIndexGenerator<?, ?>> fileBasedGenerators = FileBasedIndexExtension
|
||||
.EXTENSION_POINT_NAME
|
||||
.extensions()
|
||||
.filter(ex -> ex.dependsOnFileContent())
|
||||
.filter(ex -> !(ex instanceof StubUpdatingIndex))
|
||||
.map(extension -> getGenerator(chunkRoot, extension))
|
||||
.collect(Collectors.toList());
|
||||
|
||||
@@ -290,60 +282,6 @@ public class DumpIndexAction extends AnAction {
|
||||
stringBuilder.append("\n");
|
||||
}
|
||||
|
||||
@NotNull
|
||||
private static Stream<FileBasedIndexExtension<?, ?>> getExportableIndices(boolean all) {
|
||||
if (all) {
|
||||
return FileBasedIndexExtension
|
||||
.EXTENSION_POINT_NAME
|
||||
.extensions()
|
||||
.filter(ex -> ex.dependsOnFileContent())
|
||||
.filter(ex -> !(ex instanceof StubUpdatingIndex));
|
||||
}
|
||||
|
||||
//kt
|
||||
Stream<FileBasedIndexExtension<?, ?>> ktIndices =
|
||||
FileBasedIndexExtension
|
||||
.EXTENSION_POINT_NAME
|
||||
.extensions()
|
||||
.filter(id -> id.getName().getName().contains("kotlin"));
|
||||
|
||||
Set<ID<Object, Object>> xmlIndexIds = ContainerUtil.set(ID.findByName("XmlTagNames"),
|
||||
ID.findByName("XmlNamespaces"),
|
||||
ID.findByName("SchemaTypeInheritance"),
|
||||
ID.findByName("DomFileIndex"),
|
||||
ID.findByName("xmlProperties"));
|
||||
//xml
|
||||
Stream<FileBasedIndexExtension<?, ?>> xmlIndices =
|
||||
FileBasedIndexExtension
|
||||
.EXTENSION_POINT_NAME
|
||||
.extensions()
|
||||
.filter(id -> xmlIndexIds.contains(id.getName()));
|
||||
|
||||
//base
|
||||
Stream<FileBasedIndexExtension<?, ?>> coreIndices =
|
||||
FileBasedIndexExtension
|
||||
.EXTENSION_POINT_NAME
|
||||
.extensions()
|
||||
.filter(ex -> ex.getName().equals(TrigramIndex.INDEX_ID) ||
|
||||
ex.getName().equals(TodoIndex.NAME) ||
|
||||
ex.getName().equals(IdIndex.NAME) ||
|
||||
ex.getName().getName().equals("HashFragmentIndex"));
|
||||
|
||||
//java
|
||||
Stream<FileBasedIndexExtension<?, ?>> javaIndices =
|
||||
FileBasedIndexExtension
|
||||
.EXTENSION_POINT_NAME
|
||||
.extensions()
|
||||
.filter(ex -> ex instanceof BytecodeAnalysisIndex ||
|
||||
ex instanceof JavaAutoModuleNameIndex ||
|
||||
ex instanceof JavaFunctionalExpressionIndex ||
|
||||
ex instanceof JavaSimplePropertyIndex ||
|
||||
ex instanceof JavaNullMethodArgumentIndex ||
|
||||
ex instanceof JavaBinaryPlusExpressionIndex);
|
||||
|
||||
return Stream.concat(Stream.concat(Stream.concat(coreIndices, javaIndices), xmlIndices), ktIndices);
|
||||
}
|
||||
|
||||
public static final class IndexChunk {
|
||||
private final Set<VirtualFile> myRoots;
|
||||
private final String myName;
|
||||
@@ -2319,7 +2319,8 @@ action.SendEventLogStatistics.text=Send Feature Usage Event Log
|
||||
action.SendEventLogStatistics.description=Sends event log files to qa server
|
||||
group.FeatureUsage.Internal.text=Feature Usages Statistics
|
||||
action.InspectStubIndex.text=Inspect Stub Index
|
||||
action.DumpIndex.text=Dump Index
|
||||
group.Internal.SharedIndexes.text=Shared Indexes
|
||||
action.SharedIndexes.DumpIndex.text=Dump Index
|
||||
action.StaticIconFields.text=List Static Field Initializers
|
||||
action.ExpressionStatistics.text=Collect Java Expression Statistics
|
||||
action.UsedIconsListing.text=List Used Icons
|
||||
|
||||
@@ -21,6 +21,12 @@
|
||||
<reference ref="RunContextGroup"/>
|
||||
</group>
|
||||
|
||||
<group id="Internal.SharedIndexes" popup="true" internal="true" compact="true">
|
||||
<action id="SharedIndexes.DumpIndex" internal="true" class="com.intellij.util.indexing.hash.DumpIndexAction"/>
|
||||
|
||||
<add-to-group group-id="Internal"/>
|
||||
</group>
|
||||
|
||||
<group id="LangCodeInsightActions">
|
||||
<action id="EditorSelectWord" class="com.intellij.openapi.editor.actions.SelectWordAtCaretAction"/>
|
||||
<action id="EditorUnSelectWord" class="com.intellij.openapi.editor.actions.UnselectWordAtCaretAction"/>
|
||||
|
||||
@@ -435,8 +435,6 @@
|
||||
|
||||
<action id="StaticIconFields" internal="true" class="com.intellij.internal.StaticIconFieldsAction"/>
|
||||
|
||||
<action id="DumpIndex" internal="true" class="com.intellij.internal.DumpIndexAction"/>
|
||||
|
||||
<action id="InspectStubIndex" internal="true" class="com.intellij.internal.InspectStubIndexAction"/>
|
||||
|
||||
<add-to-group group-id="Internal"/>
|
||||
|
||||
Reference in New Issue
Block a user