diff --git a/idea/idea-analysis/src/org/jetbrains/kotlin/idea/caches/resolve/LibraryDependenciesCache.kt b/idea/idea-analysis/src/org/jetbrains/kotlin/idea/caches/project/LibraryDependenciesCache.kt similarity index 87% rename from idea/idea-analysis/src/org/jetbrains/kotlin/idea/caches/resolve/LibraryDependenciesCache.kt rename to idea/idea-analysis/src/org/jetbrains/kotlin/idea/caches/project/LibraryDependenciesCache.kt index f089551f35b..eb00b1363ee 100644 --- a/idea/idea-analysis/src/org/jetbrains/kotlin/idea/caches/resolve/LibraryDependenciesCache.kt +++ b/idea/idea-analysis/src/org/jetbrains/kotlin/idea/caches/project/LibraryDependenciesCache.kt @@ -1,20 +1,9 @@ /* - * Copyright 2010-2015 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license + * that can be found in the license/LICENSE.txt file. */ -package org.jetbrains.kotlin.idea.caches.resolve +package org.jetbrains.kotlin.idea.caches.project import com.intellij.openapi.components.ServiceManager import com.intellij.openapi.module.Module @@ -46,7 +35,6 @@ interface LibraryDependenciesCache { } class LibraryDependenciesCacheImpl(private val project: Project) : LibraryDependenciesCache { - val cache by CachedValue(project) { CachedValueProvider.Result( ContainerUtil.createConcurrentWeakMap(), diff --git a/idea/idea-analysis/src/org/jetbrains/kotlin/idea/caches/resolve/LibraryModificationTracker.kt b/idea/idea-analysis/src/org/jetbrains/kotlin/idea/caches/project/LibraryModificationTracker.kt similarity index 85% rename from idea/idea-analysis/src/org/jetbrains/kotlin/idea/caches/resolve/LibraryModificationTracker.kt rename to idea/idea-analysis/src/org/jetbrains/kotlin/idea/caches/project/LibraryModificationTracker.kt index f18a6c47513..9dd668307c0 100644 --- a/idea/idea-analysis/src/org/jetbrains/kotlin/idea/caches/resolve/LibraryModificationTracker.kt +++ b/idea/idea-analysis/src/org/jetbrains/kotlin/idea/caches/project/LibraryModificationTracker.kt @@ -1,20 +1,9 @@ /* - * Copyright 2010-2015 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license + * that can be found in the license/LICENSE.txt file. */ -package org.jetbrains.kotlin.idea.caches.resolve +package org.jetbrains.kotlin.idea.caches.project import com.intellij.ide.highlighter.ArchiveFileType import com.intellij.openapi.application.ApplicationManager diff --git a/idea/idea-analysis/src/org/jetbrains/kotlin/idea/caches/resolve/ModuleIndexCache.kt b/idea/idea-analysis/src/org/jetbrains/kotlin/idea/caches/project/ModuleIndexCache.kt similarity index 81% rename from idea/idea-analysis/src/org/jetbrains/kotlin/idea/caches/resolve/ModuleIndexCache.kt rename to idea/idea-analysis/src/org/jetbrains/kotlin/idea/caches/project/ModuleIndexCache.kt index 2c45b6ddb59..fef47f29835 100644 --- a/idea/idea-analysis/src/org/jetbrains/kotlin/idea/caches/resolve/ModuleIndexCache.kt +++ b/idea/idea-analysis/src/org/jetbrains/kotlin/idea/caches/project/ModuleIndexCache.kt @@ -1,20 +1,9 @@ /* - * Copyright 2010-2015 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license + * that can be found in the license/LICENSE.txt file. */ -package org.jetbrains.kotlin.idea.caches.resolve +package org.jetbrains.kotlin.idea.caches.project import com.intellij.openapi.module.Module import com.intellij.util.containers.MultiMap @@ -27,6 +16,10 @@ import com.intellij.util.containers.Queue import com.intellij.psi.util.CachedValuesManager import com.intellij.psi.util.CachedValueProvider import com.intellij.openapi.roots.ProjectRootModificationTracker +import org.jetbrains.kotlin.idea.caches.resolve.ModuleSourceInfo +import org.jetbrains.kotlin.idea.caches.resolve.correspondingModuleInfos +import org.jetbrains.kotlin.idea.caches.resolve.isTests +import org.jetbrains.kotlin.idea.caches.resolve.testSourceInfo import java.util.HashSet //NOTE: this is an approximation that may contain more module infos then the exact solution diff --git a/idea/idea-analysis/src/org/jetbrains/kotlin/idea/caches/resolve/IdeaModuleInfos.kt b/idea/idea-analysis/src/org/jetbrains/kotlin/idea/caches/resolve/IdeaModuleInfos.kt index bd3ff7446e7..bb0c1073084 100644 --- a/idea/idea-analysis/src/org/jetbrains/kotlin/idea/caches/resolve/IdeaModuleInfos.kt +++ b/idea/idea-analysis/src/org/jetbrains/kotlin/idea/caches/resolve/IdeaModuleInfos.kt @@ -28,6 +28,7 @@ import org.jetbrains.kotlin.analyzer.ModuleInfo import org.jetbrains.kotlin.analyzer.TrackableModuleInfo import org.jetbrains.kotlin.caches.resolve.LibraryModuleInfo import org.jetbrains.kotlin.descriptors.ModuleDescriptor +import org.jetbrains.kotlin.idea.caches.project.LibraryDependenciesCache import org.jetbrains.kotlin.idea.configuration.BuildSystemType import org.jetbrains.kotlin.idea.configuration.getBuildSystemType import org.jetbrains.kotlin.idea.facet.KotlinFacetType diff --git a/idea/idea-analysis/src/org/jetbrains/kotlin/idea/caches/resolve/KotlinCacheServiceImpl.kt b/idea/idea-analysis/src/org/jetbrains/kotlin/idea/caches/resolve/KotlinCacheServiceImpl.kt index 638d6bec027..8f6fc3e106f 100644 --- a/idea/idea-analysis/src/org/jetbrains/kotlin/idea/caches/resolve/KotlinCacheServiceImpl.kt +++ b/idea/idea-analysis/src/org/jetbrains/kotlin/idea/caches/resolve/KotlinCacheServiceImpl.kt @@ -35,6 +35,8 @@ import org.jetbrains.kotlin.config.LanguageFeature import org.jetbrains.kotlin.context.GlobalContext import org.jetbrains.kotlin.context.GlobalContextImpl import org.jetbrains.kotlin.descriptors.annotations.AnnotationDescriptor +import org.jetbrains.kotlin.idea.caches.project.LibraryModificationTracker +import org.jetbrains.kotlin.idea.caches.project.getDependentModules import org.jetbrains.kotlin.idea.caches.resolve.util.contextWithNewLockAndCompositeExceptionTracker import org.jetbrains.kotlin.idea.compiler.IDELanguageSettingsProvider import org.jetbrains.kotlin.idea.core.script.ScriptDependenciesModificationTracker diff --git a/idea/idea-completion/tests/org/jetbrains/kotlin/idea/completion/test/KotlinFixtureCompletionBaseTestCase.kt b/idea/idea-completion/tests/org/jetbrains/kotlin/idea/completion/test/KotlinFixtureCompletionBaseTestCase.kt index 5c976e30aa6..3ba40ada813 100644 --- a/idea/idea-completion/tests/org/jetbrains/kotlin/idea/completion/test/KotlinFixtureCompletionBaseTestCase.kt +++ b/idea/idea-completion/tests/org/jetbrains/kotlin/idea/completion/test/KotlinFixtureCompletionBaseTestCase.kt @@ -19,8 +19,7 @@ package org.jetbrains.kotlin.idea.completion.test import com.intellij.codeInsight.completion.CompletionType import com.intellij.codeInsight.lookup.LookupElement import com.intellij.openapi.util.io.FileUtil -import com.intellij.testFramework.LightProjectDescriptor -import org.jetbrains.kotlin.idea.caches.resolve.LibraryModificationTracker +import org.jetbrains.kotlin.idea.caches.project.LibraryModificationTracker import org.jetbrains.kotlin.idea.test.KotlinLightCodeInsightFixtureTestCase import org.jetbrains.kotlin.idea.test.configureLanguageVersion import org.jetbrains.kotlin.resolve.TargetPlatform diff --git a/idea/idea-test-framework/src/org/jetbrains/kotlin/idea/test/testUtils.kt b/idea/idea-test-framework/src/org/jetbrains/kotlin/idea/test/testUtils.kt index b0a964ca560..e45837ff465 100644 --- a/idea/idea-test-framework/src/org/jetbrains/kotlin/idea/test/testUtils.kt +++ b/idea/idea-test-framework/src/org/jetbrains/kotlin/idea/test/testUtils.kt @@ -31,7 +31,7 @@ import com.intellij.testFramework.LightPlatformTestCase import com.intellij.util.Consumer import org.jetbrains.kotlin.diagnostics.Severity import org.jetbrains.kotlin.diagnostics.rendering.DefaultErrorMessages -import org.jetbrains.kotlin.idea.caches.resolve.LibraryModificationTracker +import org.jetbrains.kotlin.idea.caches.project.LibraryModificationTracker import org.jetbrains.kotlin.idea.caches.resolve.analyzeWithContent import org.jetbrains.kotlin.idea.decompiler.KotlinDecompiledFileViewProvider import org.jetbrains.kotlin.idea.decompiler.KtDecompiledFile diff --git a/idea/src/META-INF/plugin.xml b/idea/src/META-INF/plugin.xml index c3ef37d8447..88560955cf1 100644 --- a/idea/src/META-INF/plugin.xml +++ b/idea/src/META-INF/plugin.xml @@ -303,8 +303,8 @@ - + @@ -329,8 +329,8 @@ - + diff --git a/idea/tests/org/jetbrains/kotlin/idea/caches/resolve/IdeaModuleInfoTest.kt b/idea/tests/org/jetbrains/kotlin/idea/caches/resolve/IdeaModuleInfoTest.kt index 44cfabfd840..d5a8955954f 100644 --- a/idea/tests/org/jetbrains/kotlin/idea/caches/resolve/IdeaModuleInfoTest.kt +++ b/idea/tests/org/jetbrains/kotlin/idea/caches/resolve/IdeaModuleInfoTest.kt @@ -26,6 +26,7 @@ import com.intellij.testFramework.ModuleTestCase import com.intellij.testFramework.PsiTestUtil import com.intellij.testFramework.UsefulTestCase import org.jetbrains.kotlin.codegen.forTestCompile.ForTestCompileRuntime +import org.jetbrains.kotlin.idea.caches.project.getDependentModules import org.jetbrains.kotlin.idea.framework.CommonLibraryKind import org.jetbrains.kotlin.idea.framework.JSLibraryKind import org.jetbrains.kotlin.test.util.addDependency