8000 2020.3 support: removed go_to_declaration_handler for sets because no… · SylApps/idea-php-symfony2-plugin@2c507c1 · GitHub
[go: up one dir, main page]

Skip to content

Commit 2c507c1

Browse files
committed
2020.3 support: removed go_to_declaration_handler for sets because now it works out of the box
1 parent 4bc1115 commit 2c507c1

File tree

1 file changed

+0
-28
lines changed

1 file changed

+0
-28
lines changed

src/main/java/fr/adrienbrault/idea/symfony2plugin/templating/TwigTemplateGoToDeclarationHandler.java

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -127,17 +127,6 @@ public PsiElement[] getGotoDeclarationTargets(PsiElement psiElement, int offset,
127127
targets.addAll(this.getMacros(psiElement));
128128
}
129129

130-
// {% set foo %}
131-
// {% set foo = bar %}
132-
if (PlatformPatterns
133-
.psiElement(TwigTokenTypes.IDENTIFIER)
134-
.withParent(
135-
PlatformPatterns.psiElement(TwigElementTypes.PRINT_BLOCK)
136-
).withLanguage(TwigLanguage.INSTANCE).accepts(psiElement)) {
137-
138-
targets.addAll(getSets(psiElement));
139-
}
140-
141130
// {{ foo.fo<caret>o }}
142131
if (TwigPattern.getTypeCompletionPattern().accepts(psiElement)
143132
|| TwigPattern.getPrintBlockFunctionPattern().accepts(psiElement)
@@ -466,23 +455,6 @@ private Collection<PsiElement> getFunctions(@NotNull PsiElement psiElement) {
466455
return Arrays.asList(PhpElementsUtil.getPsiElementsBySignature(psiElement.getProject(), functions.get(funcName).getSignature()));
467456
}
468457

469-
@NotNull
470-
private Collection<PsiElement> getSets(@NotNull PsiElement psiElement) {
471-
String funcName = psiElement.getText();
472-
for(String twigSet: TwigUtil.getSetDeclaration(psiElement.getContainingFile())) {
473-
if(twigSet.equals(funcName)) {
474-
// @TODO: drop regex
475-
return Arrays.asList(PsiTreeUtil.collectElements(psiElement.getContainingFile(), psiElement1 ->
476-
PlatformPatterns.psiElement(TwigTagWithFileReference.class)
477-
.accepts(psiElement1) && psiElement1.getText()
478-
.matches("\\{%\\s?set\\s?" + Pattern.quote(funcName) + "\\s?.*"))
479-
);
480-
}
481-
}
482-
483-
return Collections.emptyList();
484-
}
485-
486458
@NotNull
487459
private Collection<PsiElement> getMacros(@NotNull PsiElement psiElement) {
488460
String funcName = psiElement.getText();

0 commit comments

Comments
 (0)
0