mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
[devkit] RegistrationIndexer: skip fast if not plugin descriptor
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2000-2017 JetBrains s.r.o.
|
||||
* Copyright 2000-2018 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -23,6 +23,7 @@ import com.intellij.util.Function;
|
||||
import com.intellij.util.SmartList;
|
||||
import com.intellij.util.containers.FactoryMap;
|
||||
import com.intellij.util.indexing.FileContent;
|
||||
import com.intellij.util.text.CharArrayUtil;
|
||||
import com.intellij.util.xml.DomElement;
|
||||
import com.intellij.util.xml.DomFileElement;
|
||||
import com.intellij.util.xml.DomUtil;
|
||||
@@ -46,6 +47,11 @@ class RegistrationIndexer {
|
||||
|
||||
@NotNull
|
||||
Map<String, List<RegistrationEntry>> indexFile() {
|
||||
CharSequence text = myContent.getContentAsText();
|
||||
if (CharArrayUtil.indexOf(text, "<idea-plugin", 0) == -1) {
|
||||
return Collections.emptyMap();
|
||||
}
|
||||
|
||||
final PsiFile file = myContent.getPsiFile();
|
||||
if (!(file instanceof XmlFile)) return Collections.emptyMap();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user