Drop package facades: code cleanup in Kotlin project.

This commit is contained in:
Dmitry Petrov
2015-10-13 14:50:49 +03:00
parent 57869d85e8
commit 8cd624a58a
301 changed files with 1285 additions and 1362 deletions
@@ -16,20 +16,17 @@
package org.jetbrains.kotlin.js.analyze;
import com.google.common.collect.ImmutableList;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.kotlin.context.ContextPackage;
import org.jetbrains.kotlin.context.ContextKt;
import org.jetbrains.kotlin.context.ModuleContext;
import org.jetbrains.kotlin.context.MutableModuleContext;
import org.jetbrains.kotlin.descriptors.ModuleParameters;
import org.jetbrains.kotlin.descriptors.PackageFragmentProvider;
import org.jetbrains.kotlin.descriptors.impl.ModuleDescriptorImpl;
import org.jetbrains.kotlin.frontend.js.di.DiPackage;
import org.jetbrains.kotlin.frontend.js.di.InjectionKt;
import org.jetbrains.kotlin.js.analyzer.JsAnalysisResult;
import org.jetbrains.kotlin.js.config.Config;
import org.jetbrains.kotlin.js.resolve.JsPlatform;
import org.jetbrains.kotlin.name.Name;
import org.jetbrains.kotlin.platform.PlatformToKotlinClassMap;
import org.jetbrains.kotlin.psi.JetFile;
import org.jetbrains.kotlin.resolve.*;
import org.jetbrains.kotlin.resolve.lazy.declarations.FileBasedDeclarationProviderFactory;
@@ -50,7 +47,7 @@ public final class TopDownAnalyzerFacadeForJS {
) {
BindingTrace trace = new BindingTraceContext();
MutableModuleContext newModuleContext = ContextPackage.ContextForNewModule(
MutableModuleContext newModuleContext = ContextKt.ContextForNewModule(
config.getProject(), Name.special("<" + config.getModuleId() + ">"), JsPlatform.INSTANCE$
);
newModuleContext.setDependencies(computeDependencies(newModuleContext.getModule(), config));
@@ -75,7 +72,7 @@ public final class TopDownAnalyzerFacadeForJS {
) {
Collection<JetFile> allFiles = Config.withJsLibAdded(files, config);
LazyTopDownAnalyzerForTopLevel analyzerForJs = DiPackage.createTopDownAnalyzerForJs(
LazyTopDownAnalyzerForTopLevel analyzerForJs = InjectionKt.createTopDownAnalyzerForJs(
moduleContext, trace,
new FileBasedDeclarationProviderFactory(moduleContext.getStorageManager(), allFiles)
);
@@ -20,6 +20,7 @@ import com.google.common.collect.Lists;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.jetbrains.kotlin.descriptors.*;
import org.jetbrains.kotlin.js.descriptorUtils.DescriptorUtilsKt;
import org.jetbrains.kotlin.name.Name;
import org.jetbrains.kotlin.idea.KotlinLanguage;
import org.jetbrains.kotlin.resolve.DescriptorUtils;
@@ -28,9 +29,6 @@ import org.jetbrains.kotlin.resolve.OverrideResolver;
import java.util.Arrays;
import java.util.List;
import static org.jetbrains.kotlin.js.descriptorUtils.DescriptorUtilsPackage.getNameIfStandardType;
import static org.jetbrains.kotlin.js.descriptorUtils.DescriptorUtilsPackage.getJetTypeFqName;
public final class PatternBuilder {
@NotNull
@@ -162,7 +160,7 @@ public final class PatternBuilder {
}
for (int i = 0; i < valueParameterDescriptors.size(); i++) {
ValueParameterDescriptor valueParameterDescriptor = valueParameterDescriptors.get(i);
Name name = getNameIfStandardType(valueParameterDescriptor.getType());
Name name = DescriptorUtilsKt.getNameIfStandardType(valueParameterDescriptor.getType());
NamePredicate namePredicate = argumentCheckers.get(i);
if (!namePredicate.apply(name)) return false;
}
@@ -242,7 +240,7 @@ public final class PatternBuilder {
if (actualReceiver != null) {
if (receiverFqName == null) return false;
String actualReceiverFqName = getJetTypeFqName(actualReceiver.getType(), false);
String actualReceiverFqName = DescriptorUtilsKt.getJetTypeFqName(actualReceiver.getType(), false);
if (!actualReceiverFqName.equals(receiverFqName)) return false;
}