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.NotNull;
|
||||||
import org.jetbrains.annotations.Nullable;
|
import org.jetbrains.annotations.Nullable;
|
||||||
import org.jetbrains.jet.lang.ModuleConfiguration;
|
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.descriptors.NamespaceDescriptor;
|
||||||
import org.jetbrains.jet.lang.psi.JetImportDirective;
|
import org.jetbrains.jet.lang.psi.JetImportDirective;
|
||||||
import org.jetbrains.jet.lang.resolve.BindingContext;
|
import org.jetbrains.jet.lang.resolve.BindingContext;
|
||||||
import org.jetbrains.jet.lang.resolve.BindingTrace;
|
import org.jetbrains.jet.lang.resolve.BindingTrace;
|
||||||
import org.jetbrains.jet.lang.resolve.BodiesResolveContext;
|
import org.jetbrains.jet.lang.resolve.BodiesResolveContext;
|
||||||
|
import org.jetbrains.jet.lang.resolve.name.FqNameUnsafe;
|
||||||
import org.jetbrains.jet.lang.resolve.scopes.WritableScope;
|
import org.jetbrains.jet.lang.resolve.scopes.WritableScope;
|
||||||
|
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
|
import java.util.Collections;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Stepan Koltsov
|
* @author Stepan Koltsov
|
||||||
*/
|
*/
|
||||||
public class AnalyzeExhaust {
|
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 BindingContext bindingContext;
|
||||||
private final Throwable error;
|
private final Throwable error;
|
||||||
private final BodiesResolveContext bodiesResolveContext;
|
private final BodiesResolveContext bodiesResolveContext;
|
||||||
@@ -61,7 +86,7 @@ public class AnalyzeExhaust {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static AnalyzeExhaust error(@NotNull BindingContext bindingContext, @NotNull Throwable error) {
|
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
|
@Nullable
|
||||||
|
|||||||
@@ -45,6 +45,11 @@ public interface ModuleConfiguration {
|
|||||||
public Collection<ClassDescriptor> getKotlinAnalogs(@NotNull FqNameUnsafe className) {
|
public Collection<ClassDescriptor> getKotlinAnalogs(@NotNull FqNameUnsafe className) {
|
||||||
return Collections.emptyList();
|
return Collections.emptyList();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return "EMPTY";
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
void addDefaultImports(@NotNull Collection<JetImportDirective> directives);
|
void addDefaultImports(@NotNull Collection<JetImportDirective> directives);
|
||||||
|
|||||||
Reference in New Issue
Block a user