From 81c17b518f54a1109b6a8245e546815e4fa72e75 Mon Sep 17 00:00:00 2001 From: Ting-Yuan Huang Date: Tue, 5 Dec 2023 13:06:03 -0800 Subject: [PATCH] Update comments and copyrights --- .../devtools/ksp/IncrementalWrapperBase.kt | 17 +++++++++++++++++ .../google/devtools/ksp/IncrementalContext.kt | 17 +++++++++++++++++ .../com/google/devtools/ksp/gradle/KspAATask.kt | 17 +++++++++++++++++ .../devtools/ksp/impl/KotlinSymbolProcessing.kt | 5 +++-- .../impl/symbol/kotlin/KSTypeReferenceImpl.kt | 1 + 5 files changed, 55 insertions(+), 2 deletions(-) diff --git a/common-util/src/main/kotlin/com/google/devtools/ksp/IncrementalWrapperBase.kt b/common-util/src/main/kotlin/com/google/devtools/ksp/IncrementalWrapperBase.kt index 88accbec8e..d06b3508c5 100644 --- a/common-util/src/main/kotlin/com/google/devtools/ksp/IncrementalWrapperBase.kt +++ b/common-util/src/main/kotlin/com/google/devtools/ksp/IncrementalWrapperBase.kt @@ -1,3 +1,20 @@ +/* + * Copyright 2023 Google LLC + * Copyright 2010-2023 JetBrains s.r.o. and Kotlin Programming Language contributors. + * + * 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. + */ + package com.google.devtools.ksp import com.intellij.util.containers.MultiMap diff --git a/compiler-plugin/src/main/kotlin/com/google/devtools/ksp/IncrementalContext.kt b/compiler-plugin/src/main/kotlin/com/google/devtools/ksp/IncrementalContext.kt index 831586d77a..54fb52b40f 100644 --- a/compiler-plugin/src/main/kotlin/com/google/devtools/ksp/IncrementalContext.kt +++ b/compiler-plugin/src/main/kotlin/com/google/devtools/ksp/IncrementalContext.kt @@ -1,3 +1,20 @@ +/* + * Copyright 2023 Google LLC + * Copyright 2010-2023 JetBrains s.r.o. and Kotlin Programming Language contributors. + * + * 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. + */ + package com.google.devtools.ksp import com.google.devtools.ksp.symbol.KSDeclaration diff --git a/gradle-plugin/src/main/kotlin/com/google/devtools/ksp/gradle/KspAATask.kt b/gradle-plugin/src/main/kotlin/com/google/devtools/ksp/gradle/KspAATask.kt index a5f77f86af..4a6d79dfa3 100644 --- a/gradle-plugin/src/main/kotlin/com/google/devtools/ksp/gradle/KspAATask.kt +++ b/gradle-plugin/src/main/kotlin/com/google/devtools/ksp/gradle/KspAATask.kt @@ -1,3 +1,20 @@ +/* + * Copyright 2023 Google LLC + * Copyright 2010-2023 JetBrains s.r.o. and Kotlin Programming Language contributors. + * + * 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. + */ + package com.google.devtools.ksp.gradle import com.google.devtools.ksp.impl.KotlinSymbolProcessing diff --git a/kotlin-analysis-api/src/main/kotlin/com/google/devtools/ksp/impl/KotlinSymbolProcessing.kt b/kotlin-analysis-api/src/main/kotlin/com/google/devtools/ksp/impl/KotlinSymbolProcessing.kt index 9877322727..1e10421a3c 100644 --- a/kotlin-analysis-api/src/main/kotlin/com/google/devtools/ksp/impl/KotlinSymbolProcessing.kt +++ b/kotlin-analysis-api/src/main/kotlin/com/google/devtools/ksp/impl/KotlinSymbolProcessing.kt @@ -469,8 +469,9 @@ class KotlinSymbolProcessing( // 2) there is no more new files. while (!logger.hasError) { logger.logging("round ${++rounds} of processing") - // FirSession in AA is created lazily. Getting it instantiates module providers, which requires source roots to - // be resolved. Therefore, due to the implementation + // FirSession in AA is created lazily. Getting it instantiates module providers, which requires source roots + // to be resolved. Therefore, due to the implementation, it has to be registered repeatedly after the files + // are created. val firSession = ResolverAAImpl.ktModule.getFirResolveSession(project) firSession.useSiteFirSession.registerResolveComponents(dualLookupTracker) diff --git a/kotlin-analysis-api/src/main/kotlin/com/google/devtools/ksp/impl/symbol/kotlin/KSTypeReferenceImpl.kt b/kotlin-analysis-api/src/main/kotlin/com/google/devtools/ksp/impl/symbol/kotlin/KSTypeReferenceImpl.kt index e4e764ea0a..d1f043f13a 100644 --- a/kotlin-analysis-api/src/main/kotlin/com/google/devtools/ksp/impl/symbol/kotlin/KSTypeReferenceImpl.kt +++ b/kotlin-analysis-api/src/main/kotlin/com/google/devtools/ksp/impl/symbol/kotlin/KSTypeReferenceImpl.kt @@ -48,6 +48,7 @@ class KSTypeReferenceImpl( } } + // Remember to recordLookup if the usage is beyond a type reference. private val ktType: KtType by lazy { analyze { ktTypeReference.getKtType() } }