Getting the module for a PsiElement

I can currently get the project with psiElement.getManager().getProject()
-- now I want to get the module where this psiElement is contained. How
can I do that?

P.S.: I need the module just to construct a GlobalSearchScope that's
restricted to the same module as this psiElement. If there's any other way
to achieve the same effect wihout getting the module for the psiElement,
fine for me.

--
Marcus Brito <pazu@animegaiden.com.br>


2 comments
Comment actions Permalink

ProjectRootManager.getInstance(project).getFileIndex().getModuleForFile(psiE
lement.getContainingFile().getVirtualFile())

--
Olesya Smirnova
Developer
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"

"Marcus Brito" <pazu@animegaiden.com.br> wrote in message
news:pan.2004.05.21.10.23.38.270550@animegaiden.com.br...

I can currently get the project with psiElement.getManager().getProject()
-- now I want to get the module where this psiElement is contained. How
can I do that?

>

P.S.: I need the module just to construct a GlobalSearchScope that's
restricted to the same module as this psiElement. If there's any other way
to achieve the same effect wihout getting the module for the psiElement,
fine for me.

>

--
Marcus Brito <pazu@animegaiden.com.br>

>
>


0
Comment actions Permalink

Em Fri, 21 May 2004 17:58:45 +0400, Olesya Smirnova (JetBrains) escreveu:

ProjectRootManager.getInstance(project).getFileIndex().getModuleForFile(psiE
lement.getContainingFile().getVirtualFile())


Thank you, Olesya -- I've figured it out by myself and promptly created a
helper method that does exactly this :)

...

What makes me ask: any plans about bundling full documentation for OpenAPI
(and PSI) in Pallada? Or this is going to be postponed (again)?

--
Marcus Brito <pazu@animegaiden.com.br>



0

Please sign in to leave a comment.