SSR: remove unnecessary profile method

GitOrigin-RevId: 64cf62260e366c9e6b58d3c7067a4aec3f1b92d1
This commit is contained in:
Bas Leijdekkers
2021-08-01 09:58:23 +00:00
committed by intellij-monorepo-bot
parent bd9a24ab61
commit 2e0a90a168
3 changed files with 3 additions and 19 deletions
@@ -195,15 +195,6 @@ public final class JavaStructuralSearchProfile extends StructuralSearchProfile {
return targetNode;
}
@Override
public @NotNull PsiElement extendMatchOnePsiFile(@NotNull PsiElement file) {
if (file instanceof PsiIdentifier) {
// Searching in previous results
file = file.getParent();
}
return file;
}
@NotNull
@Override
public PsiElement getPresentableElement(@NotNull PsiElement element) {
@@ -1,4 +1,4 @@
// Copyright 2000-2021 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.
// 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.structuralsearch;
import com.intellij.dupLocator.iterators.NodeIterator;
@@ -547,9 +547,7 @@ public class Matcher {
ReadAction.nonBlocking(
() -> {
if (!file.isValid()) return;
final StructuralSearchProfile profile = StructuralSearchUtil.getProfileByPsiElement(file);
if (profile == null) return;
match(profile.extendMatchOnePsiFile(file));
match(file);
}
).inSmartMode(project).executeSynchronously();
}
@@ -1,4 +1,4 @@
// Copyright 2000-2021 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.
// 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.structuralsearch;
import com.intellij.codeInsight.template.TemplateContextType;
@@ -286,11 +286,6 @@ public abstract class StructuralSearchProfile {
return node;
}
@NotNull
public PsiElement extendMatchOnePsiFile(@NotNull PsiElement file) {
return file;
}
public LanguageFileType getDefaultFileType(@Nullable LanguageFileType fileType) {
return fileType;
}