I'm developing a plugin for IDEA to support specific files with xml-like syntax.
They just provide some tree of elements, and I want to show them in project tree (with expandable tree node for the file).
So, from my point of view - it's not a language, even the file is actually xml. I don't want to allow manual editing of these files.
For the first, my assumption is that PSI tree will be perfect for the case.
So I made class SchemaFile (that extends PsiFile) - it's being created by custom FileViewProvider (extended from SingleRootFileViewProvider).
And I stuck here :)
So, the question is: how do I create psi-childs for that SchemaFile? For instance, each schema file contains several SchemaModel.
PsiBuilder requires language lexer and parser - but it's impossible for that file format, it can even be binary of free format. So some psi elements (like SchemaModel and descendants) will be virtual, without textual representation. And I need an ability to alter those psi elements and flush changes to the schema file (that's not a point right now - I'll create custom designer for SchemaModel later).
Am I going wrong with all this PSI structure? Future plan is to map some Java classes to SchemaModel elements, so imho it's a good start.
Thanks a lot