Skip to content

Commit

Permalink
Do not index classpath in declaration provider
Browse files Browse the repository at this point in the history
It was a workaround where symbol provider depended on declaration
provider. It is no longer needed after KT-66689 was fixed.
  • Loading branch information
ting-yuan committed May 7, 2024
1 parent 6b8a9ed commit 2338e70
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -370,12 +370,7 @@ class KotlinSymbolProcessing(
project.getService(
KotlinDeclarationProviderFactory::class.java
) as IncrementalKotlinDeclarationProviderFactory
)
.update(
ktFiles,
StandaloneProjectFactory.getAllBinaryRoots(modules, kotlinCoreProjectEnvironment).map { it.file } +
listOfNotNull(VirtualFileManager.getInstance().findFileByNioPath(kspConfig.classOutputDir.toPath()))
)
).update(ktFiles)
(
project.getService(
KotlinPackageProviderFactory::class.java
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package com.google.devtools.ksp.standalone

import com.intellij.openapi.project.Project
import com.intellij.openapi.vfs.VirtualFile
import com.intellij.psi.search.GlobalSearchScope
import org.jetbrains.kotlin.analysis.project.structure.KtModule
import org.jetbrains.kotlin.analysis.providers.KotlinDeclarationProvider
Expand Down Expand Up @@ -94,11 +93,9 @@ class IncrementalKotlinDeclarationProviderFactory(
}
}

fun update(files: Collection<KtFile>, moduleRoots: List<VirtualFile>) {
fun update(files: Collection<KtFile>) {
this.files = files
this.staticFactory = KotlinStaticDeclarationProviderFactory(
project, files, sharedBinaryRoots = moduleRoots, shouldBuildStubsForBinaryLibraries = true
)
this.staticFactory = KotlinStaticDeclarationProviderFactory(project, files)
provider?.let {
it.del = createDelegateProvider()
}
Expand Down

0 comments on commit 2338e70

Please sign in to comment.