mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
use textMatches instead of getting text
GitOrigin-RevId: 6facdb54840d289469320e143a3936748ae87b23
This commit is contained in:
committed by
intellij-monorepo-bot
parent
e37c0c8f2b
commit
7e14cab4c5
@@ -31,26 +31,19 @@ internal fun processExtensionDeclarations(name: String, project: Project, strict
|
||||
val scope = PluginRelatedLocatorsUtils.getCandidatesScope(project)
|
||||
PsiSearchHelper.getInstance(project).processElementsWithWord(
|
||||
{ element, offsetInElement ->
|
||||
if (element !is XmlTag) {
|
||||
return@processElementsWithWord true
|
||||
val elementAtOffset = (element as? XmlTag)?.findElementAt(offsetInElement) ?: return@processElementsWithWord true
|
||||
if (strictMatch) {
|
||||
if (!elementAtOffset.textMatches(name)) {
|
||||
return@processElementsWithWord true
|
||||
}
|
||||
}
|
||||
|
||||
val elementAtOffset = element.findElementAt(offsetInElement)
|
||||
if (elementAtOffset == null) {
|
||||
return@processElementsWithWord true
|
||||
}
|
||||
|
||||
val foundText = elementAtOffset.text
|
||||
if (!strictMatch && !StringUtil.contains(foundText, name)) {
|
||||
return@processElementsWithWord true
|
||||
}
|
||||
if (strictMatch && !StringUtil.equals(foundText, name)) {
|
||||
else if (!StringUtil.contains(elementAtOffset.text, name)) {
|
||||
return@processElementsWithWord true
|
||||
}
|
||||
|
||||
val extension = DomManager.getDomManager(project).getDomElement(element) as? Extension ?: return@processElementsWithWord true
|
||||
callback(extension, element)
|
||||
}, scope, name, UsageSearchContext.IN_FOREIGN_LANGUAGES, true /* case-sensitive */)
|
||||
}, scope, name, UsageSearchContext.IN_FOREIGN_LANGUAGES, /* case-sensitive = */ true)
|
||||
}
|
||||
|
||||
private fun findExtensionsByClassName(project: Project, className: String): List<ExtensionCandidate> {
|
||||
|
||||
Reference in New Issue
Block a user