File tree Expand file tree Collapse file tree 1 file changed +5
-7
lines changed Expand file tree Collapse file tree 1 file changed +5
-7
lines changed Original file line number Diff line number Diff line change @@ -206,18 +206,16 @@ public Icon getIcon(int flags) {
206206 @ NotNull
207207 @ Override
208208 public SearchScope getUseScope () {
209+ if (this instanceof GoVarDefinition || this instanceof GoConstDefinition ) {
210+ GoBlock block = PsiTreeUtil .getParentOfType (this , GoBlock .class );
211+ if (block != null ) return new LocalSearchScope (block );
212+ }
209213 if (isPublic ()) {
210214 // it's important to ask module on file, otherwise module won't be found for elements in libraries files [zolotov]
211215 Module module = ModuleUtilCore .findModuleForPsiElement (getContainingFile ());
212216 return module != null ? GoUtil .moduleScope (getProject (), module ) : super .getUseScope ();
213217 }
214- else {
215- if (this instanceof GoVarDefinition || this instanceof GoConstDefinition ) {
216- GoBlock block = PsiTreeUtil .getParentOfType (this , GoBlock .class );
217- if (block != null ) return new LocalSearchScope (block );
218- }
219- return GoPsiImplUtil .packageScope (getContainingFile ());
220- }
218+ return GoPsiImplUtil .packageScope (getContainingFile ());
221219 }
222220
223221 @ Override
You can’t perform that action at this time.
0 commit comments