file = DummyHolder
That's what is returned from the valid PsiStatement I named nextStatement
nextStatement.getContainingFile();
printing it to the screen says its name is "DummyHolder". Not any project I created....
at any rate, the Project reference is needed for any number of things including getting access to a Document reference...
So in other words, the file returned from my PsiStatement identifies itsel (through its "toString() method ) as "DummyHolder" and this DummyHolder file is useless as a parameter to further method calls such as:
Document document = PsiDocumentManager.getInstance(project ).getDocument(dummyHolderReference);
where the Document this will return is "null".
:(
Message was edited by:
softwarevisualization
Please sign in to leave a comment.
Hello softwarevisualization,
Calling PsiElement.add(newElement) returns a copy of the newElement element
which has actually been added. That copy will return correct values from
getContainingFile() and all other methods.
--
Dmitry Jemerov
Development Lead
JetBrains, Inc.
http://www.jetbrains.com/
"Develop with Pleasure!"
thanks Dmitry!