Module for deleted file?
Can anyone tell me how to get the module for a deleted file during its
commit? I'm accessing it's File object in a CommitHandler, and so have a
FilePath, but it appears that there is no VirtualFile for a deleted file
that I could pass to ModuleUtil.findModuleForFile().
Cheers,
N.
Please sign in to leave a comment.
Hello Nathan,
You can walk up the FilePath.getParentPath() chain until you find a FilePath
with a not-null VirtualFile, and then get the module for that file.
--
Dmitry Jemerov
Software Developer
JetBrains, Inc.
http://www.jetbrains.com/
"Develop with Pleasure!"
Ah, of course! Thanks Dmitry!
N.
Dmitry Jemerov wrote:
>> Can anyone tell me how to get the module for a deleted file during its
>> commit? I'm accessing it's File object in a CommitHandler, and so have
>> a FilePath, but it appears that there is no VirtualFile for a deleted
>> file that I could pass to ModuleUtil.findModuleForFile().