extracted class BindingTraceContextWithoutScopeRecording

This commit is contained in:
svtk
2013-10-31 22:42:25 +04:00
parent 101b619513
commit d2680bca22
@@ -72,21 +72,7 @@ public class CliLightClassGenerationSupport extends LightClassGenerationSupport
@NotNull
public BindingTrace getTrace() {
if (trace == null) {
trace = new BindingTraceContext() {
@Override
public <K, V> void record(WritableSlice<K, V> slice, K key, V value) {
if (slice == BindingContext.RESOLUTION_SCOPE || slice == BindingContext.TYPE_RESOLUTION_SCOPE) {
// In the compiler there's no need to keep scopes
return;
}
super.record(slice, key, value);
}
@Override
public String toString() {
return "Filtering trace for the CLI compiler: does not save scopes";
}
};
trace = new BindingTraceContextWithoutScopeRecording();
}
return trace;
}
@@ -199,4 +185,20 @@ public class CliLightClassGenerationSupport extends LightClassGenerationSupport
public PsiClass getPsiClass(@NotNull JetClassOrObject classOrObject) {
return KotlinLightClassForExplicitDeclaration.create(classOrObject.getManager(), classOrObject);
}
public static class BindingTraceContextWithoutScopeRecording extends BindingTraceContext {
@Override
public <K, V> void record(WritableSlice<K, V> slice, K key, V value) {
if (slice == BindingContext.RESOLUTION_SCOPE || slice == BindingContext.TYPE_RESOLUTION_SCOPE) {
// In the compiler there's no need to keep scopes
return;
}
super.record(slice, key, value);
}
@Override
public String toString() {
return "Filtering trace for the CLI compiler: does not save scopes";
}
}
}