Fix for a problem that caused all files to be analyzed completely in js analyzing facade.
This commit is contained in:
@@ -46,7 +46,7 @@ public enum JSAnalyzerFacadeForIDEA implements AnalyzerFacade {
|
|||||||
@NotNull Collection<JetFile> files,
|
@NotNull Collection<JetFile> files,
|
||||||
@NotNull Predicate<PsiFile> filesToAnalyzeCompletely,
|
@NotNull Predicate<PsiFile> filesToAnalyzeCompletely,
|
||||||
@NotNull JetControlFlowDataTraceFactory flowDataTraceFactory) {
|
@NotNull JetControlFlowDataTraceFactory flowDataTraceFactory) {
|
||||||
BindingContext context = AnalyzerFacadeForJS.analyzeFiles(files, new IDEAConfig(project));
|
BindingContext context = AnalyzerFacadeForJS.analyzeFiles(files, filesToAnalyzeCompletely, new IDEAConfig(project));
|
||||||
return AnalyzeExhaust.success(context, JetStandardLibrary.getInstance());
|
return AnalyzeExhaust.success(context, JetStandardLibrary.getInstance());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -54,21 +54,22 @@ public final class AnalyzerFacadeForJS {
|
|||||||
@NotNull
|
@NotNull
|
||||||
public static BindingContext analyzeFilesAndCheckErrors(@NotNull List<JetFile> files,
|
public static BindingContext analyzeFilesAndCheckErrors(@NotNull List<JetFile> files,
|
||||||
@NotNull Config config) {
|
@NotNull Config config) {
|
||||||
BindingContext bindingContext = analyzeFiles(files, config);
|
BindingContext bindingContext = analyzeFiles(files, Predicates.<PsiFile>alwaysTrue(), config);
|
||||||
checkForErrors(withJsLibAdded(files, config), bindingContext);
|
checkForErrors(withJsLibAdded(files, config), bindingContext);
|
||||||
return bindingContext;
|
return bindingContext;
|
||||||
}
|
}
|
||||||
|
|
||||||
@NotNull
|
@NotNull
|
||||||
public static BindingContext analyzeFiles(@NotNull Collection<JetFile> files,
|
public static BindingContext analyzeFiles(@NotNull Collection<JetFile> files,
|
||||||
@NotNull Config config) {
|
Predicate<PsiFile> filesToAnalyzeCompletely, @NotNull Config config) {
|
||||||
Project project = config.getProject();
|
Project project = config.getProject();
|
||||||
BindingTraceContext bindingTraceContext = new BindingTraceContext();
|
BindingTraceContext bindingTraceContext = new BindingTraceContext();
|
||||||
|
|
||||||
final ModuleDescriptor owner = new ModuleDescriptor("<module>");
|
final ModuleDescriptor owner = new ModuleDescriptor("<module>");
|
||||||
|
|
||||||
TopDownAnalysisParameters topDownAnalysisParameters = new TopDownAnalysisParameters(
|
Predicate<PsiFile> completely = Predicates.<PsiFile>and(notLibFiles(config.getLibFiles()), filesToAnalyzeCompletely);
|
||||||
notLibFiles(config.getLibFiles()), false, false);
|
|
||||||
|
TopDownAnalysisParameters topDownAnalysisParameters = new TopDownAnalysisParameters(completely, false, false);
|
||||||
|
|
||||||
InjectorForTopDownAnalyzerForJs injector = new InjectorForTopDownAnalyzerForJs(
|
InjectorForTopDownAnalyzerForJs injector = new InjectorForTopDownAnalyzerForJs(
|
||||||
project, topDownAnalysisParameters, new ObservableBindingTrace(bindingTraceContext), owner,
|
project, topDownAnalysisParameters, new ObservableBindingTrace(bindingTraceContext), owner,
|
||||||
|
|||||||
Reference in New Issue
Block a user