From 7f2d9cb9fb944e35cbf5d1081c531c91b5c8a313 Mon Sep 17 00:00:00 2001 From: Dmitry Jemerov Date: Fri, 6 Mar 2020 11:40:05 +0100 Subject: [PATCH] Remove "optimization" in Java structure view which makes things strictly worse (IDEA-234691) GitOrigin-RevId: b8f96a385a5f1d2e20ad7ce07c2062726aa67c62 --- .../structureView/impl/java/PsiMethodTreeElement.java | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/java/java-structure-view/src/com/intellij/ide/structureView/impl/java/PsiMethodTreeElement.java b/java/java-structure-view/src/com/intellij/ide/structureView/impl/java/PsiMethodTreeElement.java index fe14a8b3e9cf..ef85518919ca 100644 --- a/java/java-structure-view/src/com/intellij/ide/structureView/impl/java/PsiMethodTreeElement.java +++ b/java/java-structure-view/src/com/intellij/ide/structureView/impl/java/PsiMethodTreeElement.java @@ -1,4 +1,4 @@ -// 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. +// 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.ide.structureView.impl.java; import com.intellij.ide.structureView.StructureViewTreeElement; @@ -7,7 +7,6 @@ import com.intellij.openapi.editor.colors.CodeInsightColors; import com.intellij.openapi.editor.colors.TextAttributesKey; import com.intellij.openapi.project.DumbService; import com.intellij.openapi.project.IndexNotReadyException; -import com.intellij.openapi.util.TextRange; import com.intellij.openapi.util.registry.Registry; import com.intellij.openapi.util.text.StringUtil; import com.intellij.psi.*; @@ -41,14 +40,6 @@ public class PsiMethodTreeElement extends JavaClassTreeElementBase im final PsiFile psiFile = element.getContainingFile(); if (psiFile == null || psiFile instanceof PsiCompiledElement) return emptyResult; - final TextRange range = element.getTextRange(); - if (range == null) return emptyResult; - - final String fileText = psiFile.getText(); - if (fileText == null) return emptyResult; - - if (!range.substring(fileText).contains(PsiKeyword.CLASS)) return emptyResult; - final ArrayList result = new ArrayList<>(); element.accept(new JavaRecursiveElementWalkingVisitor(){