Completion's file copy missed "whole project" analysis train
This commit is contained in:
@@ -27,8 +27,8 @@ import java.util.Set;
|
|||||||
public class WholeProjectAnalyzerFacade {
|
public class WholeProjectAnalyzerFacade {
|
||||||
public static final Function<JetFile, Collection<JetDeclaration>> WHOLE_PROJECT_DECLARATION_PROVIDER = new Function<JetFile, Collection<JetDeclaration>>() {
|
public static final Function<JetFile, Collection<JetDeclaration>> WHOLE_PROJECT_DECLARATION_PROVIDER = new Function<JetFile, Collection<JetDeclaration>>() {
|
||||||
@Override
|
@Override
|
||||||
public Collection<JetDeclaration> fun(JetFile file) {
|
public Collection<JetDeclaration> fun(final JetFile rootFile) {
|
||||||
final Project project = file.getProject();
|
final Project project = rootFile.getProject();
|
||||||
final Set<JetDeclaration> namespaces = Sets.newLinkedHashSet();
|
final Set<JetDeclaration> namespaces = Sets.newLinkedHashSet();
|
||||||
ProjectRootManager rootManager = ProjectRootManager.getInstance(project);
|
ProjectRootManager rootManager = ProjectRootManager.getInstance(project);
|
||||||
if (rootManager != null && !ApplicationManager.getApplication().isUnitTestMode()) {
|
if (rootManager != null && !ApplicationManager.getApplication().isUnitTestMode()) {
|
||||||
@@ -41,16 +41,18 @@ public class WholeProjectAnalyzerFacade {
|
|||||||
if (fileType != JetFileType.INSTANCE) return;
|
if (fileType != JetFileType.INSTANCE) return;
|
||||||
PsiFile psiFile = PsiManager.getInstance(project).findFile(file);
|
PsiFile psiFile = PsiManager.getInstance(project).findFile(file);
|
||||||
if (psiFile instanceof JetFile) {
|
if (psiFile instanceof JetFile) {
|
||||||
namespaces.add(((JetFile) psiFile).getRootNamespace());
|
if (rootFile.getOriginalFile() != psiFile) {
|
||||||
|
namespaces.add(((JetFile) psiFile).getRootNamespace());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
else {
|
|
||||||
namespaces.add(file.getRootNamespace());
|
namespaces.add(rootFile.getRootNamespace());
|
||||||
}
|
|
||||||
return namespaces;
|
return namespaces;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@NotNull
|
@NotNull
|
||||||
|
|||||||
Reference in New Issue
Block a user