Oh yeah, this ROCKS! Woo Hoo! High quality documentation of the Plug-in architecture.... get your fork, because you're going to eat it, Eclipse.
"Also, document instances not linked to any virtual files can be created temporarily, for example, to represent the contents of a text editor field in a dialog."
What's the recommended method to do this (both 5.1 and 6.0 API)?
EditorFactory.createDocument(). That hasn't changed between 5.1 and 6.0.
Any changes done to the content of PSI files are reflected in documents,
I think I've seen a change between the behavior in 5.x and 6.0: In 5.0, inside a WriteAction, PSI changes have been directly commited to the document, whereas in 6.0 the changes (and their formatting) seem to be deferred until the WriteAction completes. Which means, that e.g. if doing some PSI manipulation, the offsets returned from PSI elements will not be correct Document offsets until after the WriteAction, and after it, the PSI elements may not be valid any more (due to formatting). Did I get this right?
This is correct, and this will be documented in detail in the section covering PSI elements (currently unwritten).
If you need to commit a change to the document prior to the write action being complete (like if you need to make multiple edits and need to recalculate the offsets of subsequent elements) use this code after each edit (like a call to insertString())
I only want to say that this really important and awaited documentation was last updated more than 4 months ago.
Dear Dmitry, please continue!
Please write how do we create new PSI elements, and how do we move them. When I try to remove XmlTag elements from parent tag, sort them and add them again I get assertion error, because they are not valid anymore.
Please ask plugin development questions in the forum at http://devnet.jetbrains.net/community/idea/open_api_and_plugin_development
Is it worth mentioning in the threading section that the performAction method of AnAction runs on the EVT?
Also, is there a way to detect if the current thread is the EVT? Something like SwingUtilities.isEventDispatchThread or SWT's display.getThread()?
Sorry, let me rephrase...
I think it would benifit the documentation if you added performAction method of AnAction runs on the EVT in the threading section and how to check if your running on the EVT.
Am I right that if 2 PSIFile's represent one file in one project, then it'll the same object? If not will they equal?
If both are valid, then it should be the same object. If one of them is obsolete (has become invalid), then it will be different from the currently valid PsiFile.