Using extends to trigger Pratt Parser and extending NamedStubbedPsiElementBase<?> for resolving references

I currently have stub indexing working for aliases in intellij-elixir, but I can't figure out how to get MatchedQualifiedAliases to support stubs, because the tutorial on stub indexing had me create org.elixir_lang.psi.impl.NamedStubbedPsiElementBase<?>, which alias then had to extend, but matchedQualifiedAlias is already extending matchedExpression to trigger the Pratt Parser generator in Grammar Kit, so I can't extend NamedStubbedPsiElementBase<?> as I did with alias.

So, how do I use NamedStubbedPsiElementBase<?> (or more low-level, subclass StubBasedPsiElementBase) when the parent class is fixed due to the Pratt Parser trigger?  Do I have to make matchedExpression subclass NamedStubbedPsiElementBase because some of its descendent classes need it?

1 comment
Comment actions Permalink

Grammar Kit does actually support pseudo-multiple inheritance using the mixin rule option, so instead of extending org.elixir_lang.psi.impl.NamedStubbedPsiElementBase<?> as I did for alias I mixed in org.elixir_lang.psi.impl.NamedStubbedPsiElementBase<org.elixir_lang.psi.stub.MatchedQualifiedAlias>.  Note: when using `extend`, I could use `?` for the parameterized type and it would be filled in correctly by GrammarKit, but when using `mixin` I needed to explicitly fill the parameterized type.


Please sign in to leave a comment.