VirtualFileDelegate question
There was the VirtualFileDelegate class (Idea 6, Idea7m2).
Seems, this file did't contain real path so I need to get real virtual file from this delegate.
What files did the VirtualFileDelegate represent earlier? What is replacement for this class?
Please sign in to leave a comment.
Hello Alex,
Why are you asking? VirtualFileDelegate was an implementation detail and
was not supposed to be used externally.
--
Dmitry Jemerov
Development Lead
JetBrains, Inc.
http://www.jetbrains.com/
"Develop with Pleasure!"
The problem is the VirtualFileDelegate.getPath() method doesn't return full path.
So if file is VirtualFileDelegate instance then I get real virtual file through the getDelegate() method (this method is in the VirtualFileDelegate).
Hello Alex,
Where do you get the VirtualFileDelegate instance from?
--
Dmitry Jemerov
Development Lead
JetBrains, Inc.
http://www.jetbrains.com/
"Develop with Pleasure!"
PsiElement from Annotator --> VirtualFile (element.getOriginalElement().getContainingFile())
Idea 6.0.5
The portable between IDEA 6 and 7 way to get the top level file is to check
the getContext() for the PsiFile element:
if (psiFile.getContext() != null) psiFile =
psiFile.getContext().getContainingFile();
--
regards,
Alexey Kudravtsev
Software Developer
JetBrains, Inc, http://www.jetbrains.com
"Develop with pleasure!"
"Alex Orishchenko" <no_reply@jetbrains.com> wrote in message
news:18404575.1194452440303.JavaMail.itn@is.intellij.net...
So I need to get the PsiFile in the Annotator as described above? And the VirtualFile (for the PsiFile) will not a VirtualFileDelegate instance (and contain full path)?