src/edu/clemson/resolve/jetbrains/psi/impl/ResPsiImplUtil.java
/**
     * Note that we don't extend {@link PsiPolyVariantReference} for module references (like we do for
     * {@link ResTypeReference}, and {@link ResReference}), instead we simply represent them in the PSI as a
     * {@link ResReferenceExp}.
     * <p>
     * And since {@link ResReference} is the reference type/resolver for all reference exps, we just need a method to
     * indicate situations where we only expect to resolve to other modules. Accordingly, the only place I can see
     * where we actually use ordinary PSI reference exps to reference a <em>module</em> is within facility decl nodes --
     * so this should really only be needed in
     * {@link ResReference#processUsesImports(ResFile, ResScopeProcessor, ResolveState)}.</p>
     *
     * @param o an arbitrary reference expression.
     *
     * @return whether or not {@code o} should resolve back to some {@link PsiFile} containing a module.
     */
Note that we don't extend  PsiPolyVariantReference for module references (like we do for
ResTypeReference, and  ResReference), instead we simply represent them in the PSI as a
ResReferenceExp.

And since  ResReference is the reference type/resolver for all reference exps, we just need a method to
indicate situations where we only expect to resolve to other modules. Accordingly, the only place I can see
where we actually use ordinary PSI reference exps to reference a module is within facility decl nodes
so this should really only be needed in
ResReference#processUsesImports(ResFile, ResScopeProcessor, ResolveState).

@param o an arbitrary reference expression.

@return whether or not  o should resolve back to some  PsiFile containing a module.
Note that we don ' t extend PsiPolyVariantReference for module references ( like we do for ResTypeReference and ResReference ) instead we simply represent them in the PSI as a ResReferenceExp . And since ResReference is the reference type / resolver for all reference exps we just need a method to indicate situations where we only expect to resolve to other modules . Accordingly the only place I can see where we actually use ordinary PSI reference exps to reference a module is within facility decl nodes so this should really only be needed in ResReference#processUsesImports ( ResFile ResScopeProcessor ResolveState ) . @param o an arbitrary reference expression . @return whether or not o should resolve back to some PsiFile containing a module .
public static boolean shouldReferenceModule(ResReferenceExp o) {
        return PsiTreeUtil.getParentOfType(o, ResFacilityDecl.class) != null &&
                PsiTreeUtil.getParentOfType(o, ResModuleSpecArgList.class) == null &&
                PsiTreeUtil.getParentOfType(o, ResModuleRealizArgList.class) == null;
    }
public static boolean shouldReferenceModule ( ResReferenceExp o ) { return PsiTreeUtil . getParentOfType ( o , ResFacilityDecl . class ) != null && PsiTreeUtil . getParentOfType ( o , ResModuleSpecArgList . class ) == null && PsiTreeUtil . getParentOfType ( o , ResModuleRealizArgList . class ) == null ; }
Note that we don't extend {@link PsiPolyVariantReference} for module references (like we do for
 {@link ResTypeReference}, and {@link ResReference}), instead we simply represent them in the PSI as a
 {@link ResReferenceExp}.
Note that we don ' t extend { @link PsiPolyVariantReference } for module references ( like we do for { @link ResTypeReference } and { @link ResReference } ) instead we simply represent them in the PSI as a { @link ResReferenceExp } .