Module from VirtualFile

There is at least one place where I need to find the module a file belongs to.
(Do you support a file being in >1 module?)
Is there a method where this can be found?
--

Erb

==============================================================
"Most of you are familiar with the virtues of a programmer.
There are three, of course: laziness, impatience, and hubris."
- Larry Wall
==============================================================

1 comment

OK, I found
Module module = ProjectRootManager.getInstance(project).getFileIndex().getModuleForFile(file);


Erb wrote:

There is at least one place where I need to find the module a file
belongs to.
(Do you support a file being in >1 module?)
Is there a method where this can be found?


--

Erb

==============================================================
"Most of you are familiar with the virtues of a programmer.
There are three, of course: laziness, impatience, and hubris."
- Larry Wall
==============================================================

0

Please sign in to leave a comment.