ceylon-ide-intellij icon indicating copy to clipboard operation
ceylon-ide-intellij copied to clipboard

Consider simplifying our PSI classes

Open bjansen opened this issue 9 years ago • 1 comments

Most of the interfaces in CeylonPsi could be removed, and instead of doing:

if (is CeylonPsi.DeclarationPsi psiElement) {
    Tree.Declaration decl = psiElement.ceylonNode;
}

we could simply do

if (is CeylonCompositeElement psiElement,
    is Tree.Declaration decl = psiElement.ceylonNode) {
}

We could leave a few exceptions:

  • AnyMethodPsi would satisfy PsiMethod
  • AnyClassPsi would satisfy PsiClass

to be able to use our own PSI elements in APIs that expect PsiClasses and PsiMethods (see https://github.com/ceylon/ceylon-ide-intellij/issues/418#issuecomment-245893644 for example).

bjansen avatar Sep 09 '16 12:09 bjansen

+1.

All the value of the XxxxPsi classes is already available via the ElementType, AFAICT.

gavinking avatar Sep 09 '16 12:09 gavinking