MultiplePsiFilesPerDocumentFileViewProvider replacement for Diana

I am trying to create a custom language that extends the groovy language.  One way I am exploring is to associate some of the groovy extensions with my new custom language through the extensions section of the plugin.xml.  However, when doing so I receive errors stating that: "Language Language: Groovy doesn't participate in view provider com.intellij.psi.SingleRootFileViewProvider@f43af5: [Language: easyb]".  Looking at how the groovy plugin prior to Diana allowed for multipe languages within GSP files I see that the GroovyLanguage overrides the createViewProvider method and returns a type of GspFileViewProvider which extends MultiplePsiFilesPerDocumentFileViewProvider and adds valid composed languages into a set returned by getRelevantLanguages().

I think that I want to do something like this in my custom language, but can't see the MultiplePsiFilesPerDocumentFileViewProvider file in Diana, or any concrete implementations of FileViewProvider for that matter.  Am I on the right path here?  And if so, what is the replacement for MultiplePsiFilesPerDocumentFileViewProvider in Diana?



Comment actions Permalink

At first, Multiple*Provider is used only when you need several PSI trees
in your PsiFiles. Is it really the case? Which language are you trying
to support? Probably, implementing a language dialect instead would be a
better solution (your language should pass GroovyLanguage as
baseLanguage in calling super constructor).

The Multiple*Provider is still there in Diana, it's in idea.jar, you may
need to add it to your IDEA SDK classpath. It's instantiated now in
another way, see GspFileviewProviderFactory and the way it's registered
in plugin.xml.

Comment actions Permalink

Thanks, Peter!  Those were both helpful responses and got me past my problem.



Please sign in to leave a comment.