From 97ed7ac4d70c9460b13c2ff022526e51fbf53f83 Mon Sep 17 00:00:00 2001 From: Daniel Espendiller Date: Fri, 3 Jun 2022 17:42:31 +0200 Subject: [PATCH] remove annotation linemarker as its also catched by resources linemarker now --- .../config/ServiceLineMarkerProvider.java | 12 --------- .../util/resource/FileResourceUtil.java | 21 --------------- .../config/ServiceLineMarkerProviderTest.java | 27 ------------------- 3 files changed, 60 deletions(-) diff --git a/src/main/java/fr/adrienbrault/idea/symfony2plugin/config/ServiceLineMarkerProvider.java b/src/main/java/fr/adrienbrault/idea/symfony2plugin/config/ServiceLineMarkerProvider.java index 671cc4932..61a6a314b 100644 --- a/src/main/java/fr/adrienbrault/idea/symfony2plugin/config/ServiceLineMarkerProvider.java +++ b/src/main/java/fr/adrienbrault/idea/symfony2plugin/config/ServiceLineMarkerProvider.java @@ -33,7 +33,6 @@ import fr.adrienbrault.idea.symfony2plugin.util.PhpElementsUtil; import fr.adrienbrault.idea.symfony2plugin.util.dict.DoctrineModel; import fr.adrienbrault.idea.symfony2plugin.util.dict.ServiceUtil; -import fr.adrienbrault.idea.symfony2plugin.util.resource.FileResourceUtil; import icons.ExternalSystemIcons; import org.apache.commons.lang.StringUtils; import org.jetbrains.annotations.NotNull; @@ -86,10 +85,6 @@ public void collectSlowLineMarkers(@NotNull List psiElemen this.autowireConstructorMarker(psiElement, results); } - if(psiElement instanceof PhpFile) { - routeAnnotationFileResource((PhpFile) psiElement, results); - } - // public $message = 'This value should not be blank.'; if (ConstraintMessageGotoCompletionRegistrar.getConstraintPropertyMessagePattern().accepts(psiElement)) { this.constraintMessagePropertyMarker(psiElement, results); @@ -259,13 +254,6 @@ private void formNameMarker(PsiElement psiElement, Collection> results) { - RelatedItemLineMarkerInfo lineMarker = FileResourceUtil.getFileImplementsLineMarkerInFolderScope(psiFile); - if(lineMarker != null) { - results.add(lineMarker); - } - } - /** * Constraints in same namespace and validateBy service name */ diff --git a/src/main/java/fr/adrienbrault/idea/symfony2plugin/util/resource/FileResourceUtil.java b/src/main/java/fr/adrienbrault/idea/symfony2plugin/util/resource/FileResourceUtil.java index f4d224bd8..540289329 100644 --- a/src/main/java/fr/adrienbrault/idea/symfony2plugin/util/resource/FileResourceUtil.java +++ b/src/main/java/fr/adrienbrault/idea/symfony2plugin/util/resource/FileResourceUtil.java @@ -213,27 +213,6 @@ public static RelatedItemLineMarkerInfo getFileImplementsLineMarker( return null; } - /** - * On route annotations we can have folder scope so: "@FooBundle/Controller/foo.php" can be equal "@FooBundle/Controller/" - */ - @Nullable - public static RelatedItemLineMarkerInfo getFileImplementsLineMarkerInFolderScope(@NotNull PsiFile psiFile) { - if (!hasFileResources(psiFile.getProject(), psiFile)) { - return null; - } - - VirtualFile virtualFile = psiFile.getVirtualFile(); - if (virtualFile == null) { - return null; - } - - NavigationGutterIconBuilder builder = NavigationGutterIconBuilder.create(PlatformIcons.ANNOTATION_TYPE_ICON) - .setTargets(NotNullLazyValue.lazy(new FileResourceNotNullLazyValue(psiFile.getProject(), virtualFile))) - .setTooltipText("Symfony: Annotation Routing"); - - return builder.createLineMarkerInfo(psiFile); - } - /** * Gives targets to files on Bundle locate syntax. "@FooBundle/.../foo.yml" */ diff --git a/src/test/java/fr/adrienbrault/idea/symfony2plugin/tests/config/ServiceLineMarkerProviderTest.java b/src/test/java/fr/adrienbrault/idea/symfony2plugin/tests/config/ServiceLineMarkerProviderTest.java index 6eb8a7b0f..2fcbc972e 100644 --- a/src/test/java/fr/adrienbrault/idea/symfony2plugin/tests/config/ServiceLineMarkerProviderTest.java +++ b/src/test/java/fr/adrienbrault/idea/symfony2plugin/tests/config/ServiceLineMarkerProviderTest.java @@ -76,33 +76,6 @@ public void testDoctrineRepositoryDefinitionLineMarker() { ), new LineMarker.ToolTipEqualsAssert("Navigate to metadata")); } - public void testThatResourceProvidesLineMarker() { - myFixture.copyFileToProject("BundleScopeLineMarkerProvider.php"); - - String[] providers = new String[] {"@FooBundle/foo.php", "@FooBundle", "@FooBundle/"}; - - for (String provider : providers) { - myFixture.configureByText( - XmlFileType.INSTANCE, - String.format("", provider) - ); - - PsiFile psiFile = myFixture.configureByText("foo.php", ""); - assertLineMarker( - psiFile, - new LineMarker.ToolTipEqualsAssert("Symfony: Annotation Routing") - ); - - assertLineMarker( - psiFile, - new LineMarker.TargetAcceptsPattern( - "Symfony: Annotation Routing", - XmlPatterns.xmlTag().withName("import").withAttributeValue("resource", provider) - ) - ); - } - } - public void testXmlServiceLineMarker() { myFixture.configureByText(XmlFileType.INSTANCE, "\n" +