File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed 
src/fr/adrienbrault/idea/symfony2plugin/templating Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change 77import  com .intellij .psi .PsiElement ;
88import  com .intellij .psi .PsiFile ;
99import  com .intellij .psi .util .PsiTreeUtil ;
10+ import  com .jetbrains .php .PhpIndex ;
1011import  com .jetbrains .php .lang .psi .elements .Field ;
1112import  com .jetbrains .php .lang .psi .elements .Method ;
1213import  com .jetbrains .php .lang .psi .elements .PhpClass ;
@@ -111,10 +112,17 @@ private Collection<PsiElement> getConstantGoto(PsiElement psiElement) {
111112 Collection <PsiElement > targetPsiElements  = new  ArrayList <PsiElement >();
112113
113114 String  contents  = psiElement .getText ();
114-  if (StringUtils .isBlank (contents ) || ! contents . contains ( ":" ) ) {
115+  if (StringUtils .isBlank (contents )) {
115116 return  targetPsiElements ;
116117 }
117118
119+  // global constant 
120+  if (!contents .contains (":" )) {
121+  targetPsiElements .addAll (PhpIndex .getInstance (psiElement .getProject ()).getConstantsByName (contents ));
122+  return  targetPsiElements ;
123+  }
124+ 
125+  // resolve class constants 
118126 String [] parts  = contents .split ("::" );
119127 if (parts .length  != 2 ) {
120128 return  targetPsiElements ;
                                 You can’t perform that action at this time. 
               
                  
0 commit comments