added ERROR_CONFIGURATION to not to confuse it with empty configuration
This commit is contained in:
@@ -19,19 +19,44 @@ package org.jetbrains.jet.analyzer;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import org.jetbrains.jet.lang.ModuleConfiguration;
|
||||
import org.jetbrains.jet.lang.descriptors.ClassDescriptor;
|
||||
import org.jetbrains.jet.lang.descriptors.NamespaceDescriptor;
|
||||
import org.jetbrains.jet.lang.psi.JetImportDirective;
|
||||
import org.jetbrains.jet.lang.resolve.BindingContext;
|
||||
import org.jetbrains.jet.lang.resolve.BindingTrace;
|
||||
import org.jetbrains.jet.lang.resolve.BodiesResolveContext;
|
||||
import org.jetbrains.jet.lang.resolve.name.FqNameUnsafe;
|
||||
import org.jetbrains.jet.lang.resolve.scopes.WritableScope;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
|
||||
/**
|
||||
* @author Stepan Koltsov
|
||||
*/
|
||||
public class AnalyzeExhaust {
|
||||
private static final ModuleConfiguration ERROR_CONFIGURATION = new ModuleConfiguration() {
|
||||
@Override
|
||||
public void addDefaultImports(@NotNull Collection<JetImportDirective> directives) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void extendNamespaceScope(@NotNull BindingTrace trace, @NotNull NamespaceDescriptor namespaceDescriptor, @NotNull WritableScope namespaceMemberScope) {
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public Collection<ClassDescriptor> getKotlinAnalogs(@NotNull FqNameUnsafe className) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "ERROR_CONFIGURATION";
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
private final BindingContext bindingContext;
|
||||
private final Throwable error;
|
||||
private final BodiesResolveContext bodiesResolveContext;
|
||||
@@ -61,7 +86,7 @@ public class AnalyzeExhaust {
|
||||
}
|
||||
|
||||
public static AnalyzeExhaust error(@NotNull BindingContext bindingContext, @NotNull Throwable error) {
|
||||
return new AnalyzeExhaust(bindingContext, ModuleConfiguration.EMPTY, null, error);
|
||||
return new AnalyzeExhaust(bindingContext, ERROR_CONFIGURATION, null, error);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
|
||||
@@ -45,6 +45,11 @@ public interface ModuleConfiguration {
|
||||
public Collection<ClassDescriptor> getKotlinAnalogs(@NotNull FqNameUnsafe className) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "EMPTY";
|
||||
}
|
||||
};
|
||||
|
||||
void addDefaultImports(@NotNull Collection<JetImportDirective> directives);
|
||||
|
||||
Reference in New Issue
Block a user