mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
todo index cleanup
This commit is contained in:
+1
-15
@@ -50,27 +50,18 @@ import org.jetbrains.annotations.Nullable;
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
/**
|
||||
* Author: dmitrylomov
|
||||
*/
|
||||
public abstract class PlatformIdTableBuilding {
|
||||
public static final Key<EditorHighlighter> EDITOR_HIGHLIGHTER = new Key<EditorHighlighter>("Editor");
|
||||
private static final Map<FileType, DataIndexer<TodoIndexEntry, Integer, FileContent>> ourTodoIndexers = new HashMap<FileType, DataIndexer<TodoIndexEntry, Integer, FileContent>>();
|
||||
private static final TokenSet ABSTRACT_FILE_COMMENT_TOKENS = TokenSet.create(CustomHighlighterTokenType.LINE_COMMENT, CustomHighlighterTokenType.MULTI_LINE_COMMENT);
|
||||
|
||||
private PlatformIdTableBuilding() {}
|
||||
|
||||
@Nullable
|
||||
public static DataIndexer<TodoIndexEntry, Integer, FileContent> getTodoIndexer(FileType fileType, final VirtualFile virtualFile) {
|
||||
final DataIndexer<TodoIndexEntry, Integer, FileContent> indexer = ourTodoIndexers.get(fileType);
|
||||
|
||||
if (indexer != null) {
|
||||
return indexer;
|
||||
}
|
||||
|
||||
final DataIndexer<TodoIndexEntry, Integer, FileContent> extIndexer;
|
||||
if (fileType instanceof SubstitutedFileType && !((SubstitutedFileType)fileType).isSameFileType()) {
|
||||
SubstitutedFileType sft = (SubstitutedFileType)fileType;
|
||||
@@ -110,13 +101,8 @@ public abstract class PlatformIdTableBuilding {
|
||||
return b;
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public static void registerTodoIndexer(@NotNull FileType fileType, DataIndexer<TodoIndexEntry, Integer, FileContent> indexer) {
|
||||
ourTodoIndexers.put(fileType, indexer);
|
||||
}
|
||||
|
||||
public static boolean isTodoIndexerRegistered(@NotNull FileType fileType) {
|
||||
return ourTodoIndexers.containsKey(fileType) || TodoIndexers.INSTANCE.forFileType(fileType) != null || fileType instanceof InternalFileType;
|
||||
return TodoIndexers.INSTANCE.forFileType(fileType) != null || fileType instanceof InternalFileType;
|
||||
}
|
||||
|
||||
private static class CompositeTodoIndexer extends VersionedTodoIndexer {
|
||||
|
||||
+1
-1
@@ -24,7 +24,7 @@ import com.intellij.util.indexing.FileContent;
|
||||
* @author yole
|
||||
*/
|
||||
public class TodoIndexers extends FileTypeExtension<DataIndexer<TodoIndexEntry, Integer, FileContent>> {
|
||||
public static TodoIndexers INSTANCE = new TodoIndexers();
|
||||
public static final TodoIndexers INSTANCE = new TodoIndexers();
|
||||
|
||||
private TodoIndexers() {
|
||||
super("com.intellij.todoIndexer");
|
||||
|
||||
Reference in New Issue
Block a user