Find Usages / Scope Not Including Libraries For Custom Language

For my custom language I want to be able to add libraries to the scope. Even though I can add a library, and it will index all the files, and references/go to declaration all work. Find usages doesn't work because the library is not considered "in scope". When I work with the scope tool, I have not found a way to include the library files in the search scope.

Does this questions make sense? How can I include the source files in a library in the search scope?

I have even tried implementing the various Library extensions. They did provide a nice icon for libraries of my custom language, but didn't help the search scope issue.

1 comment
Comment actions Permalink

Hello Jon,

You should override PsiElement.getUseScope() and return the appropriate scope.
Note that in IntelliJ IDEA, libraries are (pretty much by definition) something
that cannot access the project code, so you may run into other obstacles
with this approach.

For my custom language I want to be able to add libraries to the
scope. Even though I can add a library, and it will index all the
files, and references/go to declaration all work. Find usages doesn't
work because the library is not considered "in scope". When I work
with the scope tool, I have not found a way to include the library
files in the search scope.

Does this questions make sense? How can I include the source files in
a library in the search scope?


--
Dmitry Jemerov
Development Lead
JetBrains, Inc.
http://www.jetbrains.com/
"Develop with Pleasure!"


0

Please sign in to leave a comment.