src/edu/clemson/resolve/jetbrains/psi/impl/imports/ResModuleReference.java
//OK, here we need to only add the current projects context along with the 'usr/local/resolve/src (STD)' sources.
OK, here we need to only add the current projects context along with the 'usr/local/resolve/src (STD)' sources.
OK here we need to only add the current projects context along with the ' usr / local / resolve / src ( STD ) ' sources .
@NotNull
        @Override
        public Collection<PsiFileSystemItem> computeDefaultContexts() {
            PsiFile file = getContainingFile();
            if (file == null || !file.isValid() || isAbsolutePathReference()) {
                return Collections.emptyList();
            }
            final PsiManager psiManager = file.getManager();
            Module module = ModuleUtilCore.findModuleForPsiElement(file);
            Project project = file.getProject();
            LinkedHashSet<VirtualFile> sourceRoots = newLinkedHashSet();
            PsiElement e = getElement();
            ResModuleLibraryIdentifier desiredLib = null;
            if (e.getParent() instanceof ResModuleIdentifierSpec &&
                    ((ResModuleIdentifierSpec) e.getParent()).getFromLibraryIdentifier() != null) {
                desiredLib = ((ResModuleIdentifierSpec) e.getParent()).getModuleLibraryIdentifier();
            }
            else if (e.getParent() instanceof ResFacilityDecl &&
                    PsiTreeUtil.getNextSiblingOfType(e, ResModuleLibraryIdentifier.class) != null) {
                desiredLib = PsiTreeUtil.getNextSiblingOfType(e, ResModuleLibraryIdentifier.class);
            }
            else if (e.getParent() instanceof ResExtensionPairing &&
                    PsiTreeUtil.getNextSiblingOfType(e, ResModuleLibraryIdentifier.class) != null) {
                desiredLib = PsiTreeUtil.getNextSiblingOfType(e, ResModuleLibraryIdentifier.class);
            }
            if (desiredLib != null) {
                PsiElement ele = desiredLib.resolve();
                if (ele != null && ele instanceof PsiDirectory) {
                    addContexts(sourceRoots, ((PsiDirectory) ele).getVirtualFile());
                }
            }
            else {
                VirtualFile rootSdkDir = RESOLVESdkUtil.getSdkSrcDir(project, module);
                if (rootSdkDir != null) addContexts(sourceRoots, rootSdkDir);
                if (module != null) addContexts(sourceRoots, project.getBaseDir());
            }
            return ContainerUtil.mapNotNull(sourceRoots, psiManager::findDirectory);
        }
@ NotNull @ Override public Collection < PsiFileSystemItem > computeDefaultContexts ( ) { PsiFile file = getContainingFile ( ) ; if ( file == null || ! file . isValid ( ) || isAbsolutePathReference ( ) ) { return Collections . emptyList ( ) ; } final PsiManager psiManager = file . getManager ( ) ; Module module = ModuleUtilCore . findModuleForPsiElement ( file ) ; Project project = file . getProject ( ) ; LinkedHashSet < VirtualFile > sourceRoots = newLinkedHashSet ( ) ; PsiElement e = getElement ( ) ; ResModuleLibraryIdentifier desiredLib = null ; if ( e . getParent ( ) instanceof ResModuleIdentifierSpec && ( ( ResModuleIdentifierSpec ) e . getParent ( ) ) . getFromLibraryIdentifier ( ) != null ) { desiredLib = ( ( ResModuleIdentifierSpec ) e . getParent ( ) ) . getModuleLibraryIdentifier ( ) ; } else if ( e . getParent ( ) instanceof ResFacilityDecl && PsiTreeUtil . getNextSiblingOfType ( e , ResModuleLibraryIdentifier . class ) != null ) { desiredLib = PsiTreeUtil . getNextSiblingOfType ( e , ResModuleLibraryIdentifier . class ) ; } else if ( e . getParent ( ) instanceof ResExtensionPairing && PsiTreeUtil . getNextSiblingOfType ( e , ResModuleLibraryIdentifier . class ) != null ) { desiredLib = PsiTreeUtil . getNextSiblingOfType ( e , ResModuleLibraryIdentifier . class ) ; } if ( desiredLib != null ) { PsiElement ele = desiredLib . resolve ( ) ; if ( ele != null && ele instanceof PsiDirectory ) { addContexts ( sourceRoots , ( ( PsiDirectory ) ele ) . getVirtualFile ( ) ) ; } } else { VirtualFile rootSdkDir = RESOLVESdkUtil . getSdkSrcDir ( project , module ) ; if ( rootSdkDir != null ) addContexts ( sourceRoots , rootSdkDir ) ; if ( module != null ) addContexts ( sourceRoots , project . getBaseDir ( ) ) ; } return ContainerUtil . mapNotNull ( sourceRoots , psiManager :: findDirectory ) ; }
OK, here we need to only add the current projects context along with the 'usr/local/resolve/src (STD)' sources.
OK here we need to only add the current projects context along with the ' usr / local / resolve / src ( STD ) ' sources .
//handle the 'from' clause.. //TODO: technically parent can also now be a facility //sourceRoots.add(((PsiDirectory) ele).getVirtualFile()); //now do the curr proj.