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?

6 comments

Hello Alex,

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?


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!"


0

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).

0

Hello Alex,

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).


Where do you get the VirtualFileDelegate instance from?

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


0

PsiElement from Annotator --> VirtualFile (element.getOriginalElement().getContainingFile())

Idea 6.0.5

0

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...

PsiElement from Annotator --> VirtualFile
(element.getOriginalElement().getContainingFile())



0

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();


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)?

0

Please sign in to leave a comment.