Skip to content

Commit 97ed7ac

Browse files
committed
remove annotation linemarker as its also catched by resources linemarker now
1 parent dabb8f4 commit 97ed7ac

File tree

3 files changed

+0
-60
lines changed

3 files changed

+0
-60
lines changed

src/main/java/fr/adrienbrault/idea/symfony2plugin/config/ServiceLineMarkerProvider.java

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@
3333
import fr.adrienbrault.idea.symfony2plugin.util.PhpElementsUtil;
3434
import fr.adrienbrault.idea.symfony2plugin.util.dict.DoctrineModel;
3535
import fr.adrienbrault.idea.symfony2plugin.util.dict.ServiceUtil;
36-
import fr.adrienbrault.idea.symfony2plugin.util.resource.FileResourceUtil;
3736
import icons.ExternalSystemIcons;
3837
import org.apache.commons.lang.StringUtils;
3938
import org.jetbrains.annotations.NotNull;
@@ -86,10 +85,6 @@ public void collectSlowLineMarkers(@NotNull List<? extends PsiElement> psiElemen
8685
this.autowireConstructorMarker(psiElement, results);
8786
}
8887

89-
if(psiElement instanceof PhpFile) {
90-
routeAnnotationFileResource((PhpFile) psiElement, results);
91-
}
92-
9388
// public $message = 'This value should not be blank.';
9489
if (ConstraintMessageGotoCompletionRegistrar.getConstraintPropertyMessagePattern().accepts(psiElement)) {
9590
this.constraintMessagePropertyMarker(psiElement, results);
@@ -259,13 +254,6 @@ private void formNameMarker(PsiElement psiElement, Collection<? super RelatedIte
259254

260255
}
261256

262-
private void routeAnnotationFileResource(@NotNull PsiFile psiFile, Collection<? super RelatedItemLineMarkerInfo<?>> results) {
263-
RelatedItemLineMarkerInfo<PsiElement> lineMarker = FileResourceUtil.getFileImplementsLineMarkerInFolderScope(psiFile);
264-
if(lineMarker != null) {
265-
results.add(lineMarker);
266-
}
267-
}
268-
269257
/**
270258
* Constraints in same namespace and validateBy service name
271259
*/

src/main/java/fr/adrienbrault/idea/symfony2plugin/util/resource/FileResourceUtil.java

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -213,27 +213,6 @@ public static RelatedItemLineMarkerInfo<PsiElement> getFileImplementsLineMarker(
213213
return null;
214214
}
215215

216-
/**
217-
* On route annotations we can have folder scope so: "@FooBundle/Controller/foo.php" can be equal "@FooBundle/Controller/"
218-
*/
219-
@Nullable
220-
public static RelatedItemLineMarkerInfo<PsiElement> getFileImplementsLineMarkerInFolderScope(@NotNull PsiFile psiFile) {
221-
if (!hasFileResources(psiFile.getProject(), psiFile)) {
222-
return null;
223-
}
224-
225-
VirtualFile virtualFile = psiFile.getVirtualFile();
226-
if (virtualFile == null) {
227-
return null;
228-
}
229-
230-
NavigationGutterIconBuilder<PsiElement> builder = NavigationGutterIconBuilder.create(PlatformIcons.ANNOTATION_TYPE_ICON)
231-
.setTargets(NotNullLazyValue.lazy(new FileResourceNotNullLazyValue(psiFile.getProject(), virtualFile)))
232-
.setTooltipText("Symfony: <a href=\"https://symfony.com/doc/current/routing.html#creating-routes-as-annotations\">Annotation Routing</a>");
233-
234-
return builder.createLineMarkerInfo(psiFile);
235-
}
236-
237216
/**
238217
* Gives targets to files on Bundle locate syntax. "@FooBundle/.../foo.yml"
239218
*/

src/test/java/fr/adrienbrault/idea/symfony2plugin/tests/config/ServiceLineMarkerProviderTest.java

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -76,33 +76,6 @@ public void testDoctrineRepositoryDefinitionLineMarker() {
7676
), new LineMarker.ToolTipEqualsAssert("Navigate to metadata"));
7777
}
7878

79-
public void testThatResourceProvidesLineMarker() {
80-
myFixture.copyFileToProject("BundleScopeLineMarkerProvider.php");
81-
82-
String[] providers = new String[] {"@FooBundle/foo.php", "@FooBundle", "@FooBundle/"};
83-
84-
for (String provider : providers) {
85-
myFixture.configureByText(
86-
XmlFileType.INSTANCE,
87-
String.format("<routes><import resource=\"%s\" /></routes>", provider)
88-
);
89-
90-
PsiFile psiFile = myFixture.configureByText("foo.php", "");
91-
assertLineMarker(
92-
psiFile,
93-
new LineMarker.ToolTipEqualsAssert("Symfony: <a href=\"https://symfony.com/doc/current/routing.html#creating-routes-as-annotations\">Annotation Routing</a>")
94-
);
95-
96-
assertLineMarker(
97-
psiFile,
98-
new LineMarker.TargetAcceptsPattern(
99-
"Symfony: <a href=\"https://symfony.com/doc/current/routing.html#creating-routes-as-annotations\">Annotation Routing</a>",
100-
XmlPatterns.xmlTag().withName("import").withAttributeValue("resource", provider)
101-
)
102-
);
103-
}
104-
}
105-
10679
public void testXmlServiceLineMarker() {
10780
myFixture.configureByText(XmlFileType.INSTANCE,
10881
"<container>\n" +

0 commit comments

Comments
 (0)