FIR IDE: move analysis api fir generator to the analysis directory

This commit is contained in:
Ilya Kirillov
2021-09-14 17:21:29 +02:00
parent b43e664985
commit 4d52b354af
12 changed files with 36 additions and 36 deletions
@@ -29,7 +29,7 @@ val writeCopyright by task<tasks.WriteCopyrightToFile> {
} }
application { application {
mainClassName = "org.jetbrains.kotlin.idea.frontend.api.fir.generator.MainKt" mainClassName = "org.jetbrains.kotlin.analysis.api.fir.generator.MainKt"
} }
val processResources by tasks val processResources by tasks
@@ -3,13 +3,13 @@
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. * 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.frontend.api.fir.generator package org.jetbrains.kotlin.analysis.api.fir.generator
import org.jetbrains.kotlin.fir.checkers.generator.diagnostics.model.DiagnosticList import org.jetbrains.kotlin.fir.checkers.generator.diagnostics.model.DiagnosticList
import org.jetbrains.kotlin.fir.checkers.generator.getGenerationPath import org.jetbrains.kotlin.fir.checkers.generator.getGenerationPath
import org.jetbrains.kotlin.idea.frontend.api.fir.generator.rendererrs.FirDiagnosticToKtDiagnosticConverterRenderer import org.jetbrains.kotlin.analysis.api.fir.generator.rendererrs.FirDiagnosticToKtDiagnosticConverterRenderer
import org.jetbrains.kotlin.idea.frontend.api.fir.generator.rendererrs.KtDiagnosticClassImplementationRenderer import org.jetbrains.kotlin.analysis.api.fir.generator.rendererrs.KtDiagnosticClassImplementationRenderer
import org.jetbrains.kotlin.idea.frontend.api.fir.generator.rendererrs.KtDiagnosticClassRenderer import org.jetbrains.kotlin.analysis.api.fir.generator.rendererrs.KtDiagnosticClassRenderer
import java.nio.file.Path import java.nio.file.Path
object DiagnosticClassGenerator { object DiagnosticClassGenerator {
@@ -3,7 +3,7 @@
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. * 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.frontend.api.fir.generator package org.jetbrains.kotlin.analysis.api.fir.generator
import org.jetbrains.kotlin.diagnostics.Severity import org.jetbrains.kotlin.diagnostics.Severity
import org.jetbrains.kotlin.fir.checkers.generator.diagnostics.model.DiagnosticData import org.jetbrains.kotlin.fir.checkers.generator.diagnostics.model.DiagnosticData
@@ -3,7 +3,7 @@
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. * 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.frontend.api.fir.generator package org.jetbrains.kotlin.analysis.api.fir.generator
import com.intellij.psi.PsiElement import com.intellij.psi.PsiElement
import org.jetbrains.kotlin.config.LanguageFeature import org.jetbrains.kotlin.config.LanguageFeature
@@ -23,8 +23,8 @@ import org.jetbrains.kotlin.fir.symbols.FirBasedSymbol
import org.jetbrains.kotlin.fir.symbols.impl.* import org.jetbrains.kotlin.fir.symbols.impl.*
import org.jetbrains.kotlin.fir.types.ConeKotlinType import org.jetbrains.kotlin.fir.types.ConeKotlinType
import org.jetbrains.kotlin.fir.types.FirTypeRef import org.jetbrains.kotlin.fir.types.FirTypeRef
import org.jetbrains.kotlin.idea.frontend.api.symbols.* import org.jetbrains.kotlin.analysis.api.symbols.*
import org.jetbrains.kotlin.idea.frontend.api.types.KtType import org.jetbrains.kotlin.analysis.api.types.KtType
import org.jetbrains.kotlin.lexer.KtKeywordToken import org.jetbrains.kotlin.lexer.KtKeywordToken
import org.jetbrains.kotlin.lexer.KtModifierKeywordToken import org.jetbrains.kotlin.lexer.KtModifierKeywordToken
import org.jetbrains.kotlin.name.ClassId import org.jetbrains.kotlin.name.ClassId
@@ -204,7 +204,7 @@ private object FirToKtConversionCreator {
KtNamedClassOrObjectSymbol::class.createType(), KtNamedClassOrObjectSymbol::class.createType(),
importsToAdd = listOf( importsToAdd = listOf(
"org.jetbrains.kotlin.fir.declarations.FirRegularClass", "org.jetbrains.kotlin.fir.declarations.FirRegularClass",
"org.jetbrains.kotlin.idea.frontend.api.symbols.KtNamedClassOrObjectSymbol" "org.jetbrains.kotlin.analysis.api.symbols.KtNamedClassOrObjectSymbol"
) )
), ),
FirExpression::class to HLFunctionCallConversion( FirExpression::class to HLFunctionCallConversion(
@@ -3,7 +3,7 @@
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. * 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.frontend.api.fir.generator package org.jetbrains.kotlin.analysis.api.fir.generator
import kotlin.reflect.KType import kotlin.reflect.KType
import kotlin.reflect.KTypeProjection import kotlin.reflect.KTypeProjection
@@ -3,7 +3,7 @@
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. * 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.frontend.api.fir.generator package org.jetbrains.kotlin.analysis.api.fir.generator
import org.jetbrains.kotlin.fir.checkers.generator.diagnostics.DIAGNOSTICS_LIST import org.jetbrains.kotlin.fir.checkers.generator.diagnostics.DIAGNOSTICS_LIST
import org.jetbrains.kotlin.fir.checkers.generator.diagnostics.JVM_DIAGNOSTICS_LIST import org.jetbrains.kotlin.fir.checkers.generator.diagnostics.JVM_DIAGNOSTICS_LIST
@@ -11,6 +11,6 @@ import java.nio.file.Paths
fun main() { fun main() {
val rootPath = Paths.get("idea/idea-frontend-fir/src").toAbsolutePath() val rootPath = Paths.get("idea/idea-frontend-fir/src").toAbsolutePath()
val packageName = "org.jetbrains.kotlin.idea.frontend.api.fir.diagnostics" val packageName = "org.jetbrains.kotlin.analysis.api.fir.diagnostics"
DiagnosticClassGenerator.generate(rootPath, DIAGNOSTICS_LIST + JVM_DIAGNOSTICS_LIST, packageName) DiagnosticClassGenerator.generate(rootPath, DIAGNOSTICS_LIST + JVM_DIAGNOSTICS_LIST, packageName)
} }
@@ -3,7 +3,7 @@
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. * 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.frontend.api.fir.generator package org.jetbrains.kotlin.analysis.api.fir.generator
import org.jetbrains.kotlin.util.SmartPrinter import org.jetbrains.kotlin.util.SmartPrinter
import kotlin.reflect.KClass import kotlin.reflect.KClass
@@ -3,7 +3,7 @@
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. * 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.frontend.api.fir.generator.rendererrs package org.jetbrains.kotlin.analysis.api.fir.generator.rendererrs
import org.jetbrains.kotlin.fir.checkers.generator.collectClassNamesTo import org.jetbrains.kotlin.fir.checkers.generator.collectClassNamesTo
import org.jetbrains.kotlin.fir.checkers.generator.diagnostics.model.DiagnosticList import org.jetbrains.kotlin.fir.checkers.generator.diagnostics.model.DiagnosticList
@@ -12,10 +12,10 @@ import org.jetbrains.kotlin.fir.checkers.generator.printImports
import org.jetbrains.kotlin.fir.tree.generator.printer.printCopyright import org.jetbrains.kotlin.fir.tree.generator.printer.printCopyright
import org.jetbrains.kotlin.fir.tree.generator.printer.printGeneratedMessage import org.jetbrains.kotlin.fir.tree.generator.printer.printGeneratedMessage
import org.jetbrains.kotlin.fir.tree.generator.util.writeToFileUsingSmartPrinterIfFileContentChanged import org.jetbrains.kotlin.fir.tree.generator.util.writeToFileUsingSmartPrinterIfFileContentChanged
import org.jetbrains.kotlin.idea.frontend.api.fir.generator.HLDiagnosticConverter import org.jetbrains.kotlin.analysis.api.fir.generator.HLDiagnosticConverter
import org.jetbrains.kotlin.idea.frontend.api.fir.generator.HLDiagnosticList import org.jetbrains.kotlin.analysis.api.fir.generator.HLDiagnosticList
import org.jetbrains.kotlin.idea.frontend.api.fir.generator.HLDiagnosticParameter import org.jetbrains.kotlin.analysis.api.fir.generator.HLDiagnosticParameter
import org.jetbrains.kotlin.idea.frontend.api.fir.generator.simpleName import org.jetbrains.kotlin.analysis.api.fir.generator.simpleName
import org.jetbrains.kotlin.util.SmartPrinter import org.jetbrains.kotlin.util.SmartPrinter
import java.io.File import java.io.File
import kotlin.reflect.KType import kotlin.reflect.KType
@@ -3,13 +3,13 @@
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. * 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.frontend.api.fir.generator.rendererrs package org.jetbrains.kotlin.analysis.api.fir.generator.rendererrs
import org.jetbrains.kotlin.fir.checkers.generator.inBracketsWithIndent import org.jetbrains.kotlin.fir.checkers.generator.inBracketsWithIndent
import org.jetbrains.kotlin.idea.frontend.api.fir.generator.ConversionContext import org.jetbrains.kotlin.analysis.api.fir.generator.ConversionContext
import org.jetbrains.kotlin.idea.frontend.api.fir.generator.HLDiagnostic import org.jetbrains.kotlin.analysis.api.fir.generator.HLDiagnostic
import org.jetbrains.kotlin.idea.frontend.api.fir.generator.HLDiagnosticList import org.jetbrains.kotlin.analysis.api.fir.generator.HLDiagnosticList
import org.jetbrains.kotlin.idea.frontend.api.fir.generator.HLDiagnosticParameter import org.jetbrains.kotlin.analysis.api.fir.generator.HLDiagnosticParameter
import org.jetbrains.kotlin.util.SmartPrinter import org.jetbrains.kotlin.util.SmartPrinter
import org.jetbrains.kotlin.util.withIndent import org.jetbrains.kotlin.util.withIndent
@@ -3,14 +3,14 @@
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. * 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.frontend.api.fir.generator.rendererrs package org.jetbrains.kotlin.analysis.api.fir.generator.rendererrs
import org.jetbrains.kotlin.fir.checkers.generator.collectClassNamesTo import org.jetbrains.kotlin.fir.checkers.generator.collectClassNamesTo
import org.jetbrains.kotlin.fir.checkers.generator.inBracketsWithIndent import org.jetbrains.kotlin.fir.checkers.generator.inBracketsWithIndent
import org.jetbrains.kotlin.idea.frontend.api.fir.generator.HLDiagnostic import org.jetbrains.kotlin.analysis.api.fir.generator.HLDiagnostic
import org.jetbrains.kotlin.idea.frontend.api.fir.generator.HLDiagnosticList import org.jetbrains.kotlin.analysis.api.fir.generator.HLDiagnosticList
import org.jetbrains.kotlin.idea.frontend.api.fir.generator.HLDiagnosticParameter import org.jetbrains.kotlin.analysis.api.fir.generator.HLDiagnosticParameter
import org.jetbrains.kotlin.idea.frontend.api.fir.generator.printTypeWithShortNames import org.jetbrains.kotlin.analysis.api.fir.generator.printTypeWithShortNames
import org.jetbrains.kotlin.util.SmartPrinter import org.jetbrains.kotlin.util.SmartPrinter
import org.jetbrains.kotlin.util.withIndent import org.jetbrains.kotlin.util.withIndent
@@ -62,8 +62,8 @@ object KtDiagnosticClassImplementationRenderer : AbstractDiagnosticsDataClassRen
} }
override val defaultImports = listOf( override val defaultImports = listOf(
"org.jetbrains.kotlin.idea.frontend.api.fir.utils.weakRef", "org.jetbrains.kotlin.analysis.api.fir.utils.weakRef",
"org.jetbrains.kotlin.fir.analysis.diagnostics.FirPsiDiagnostic", "org.jetbrains.kotlin.fir.analysis.diagnostics.FirPsiDiagnostic",
"org.jetbrains.kotlin.idea.frontend.api.tokens.ValidityToken", "org.jetbrains.kotlin.analysis.api.tokens.ValidityToken",
) )
} }
@@ -3,12 +3,12 @@
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. * 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.frontend.api.fir.generator.rendererrs package org.jetbrains.kotlin.analysis.api.fir.generator.rendererrs
import org.jetbrains.kotlin.fir.checkers.generator.collectClassNamesTo import org.jetbrains.kotlin.fir.checkers.generator.collectClassNamesTo
import org.jetbrains.kotlin.fir.checkers.generator.inBracketsWithIndent import org.jetbrains.kotlin.fir.checkers.generator.inBracketsWithIndent
import org.jetbrains.kotlin.idea.frontend.api.fir.generator.* import org.jetbrains.kotlin.analysis.api.fir.generator.*
import org.jetbrains.kotlin.idea.frontend.api.fir.generator.printTypeWithShortNames import org.jetbrains.kotlin.analysis.api.fir.generator.printTypeWithShortNames
import org.jetbrains.kotlin.util.SmartPrinter import org.jetbrains.kotlin.util.SmartPrinter
object KtDiagnosticClassRenderer : AbstractDiagnosticsDataClassRenderer() { object KtDiagnosticClassRenderer : AbstractDiagnosticsDataClassRenderer() {
@@ -52,7 +52,7 @@ object KtDiagnosticClassRenderer : AbstractDiagnosticsDataClassRenderer() {
} }
override val defaultImports = listOf( override val defaultImports = listOf(
"org.jetbrains.kotlin.idea.frontend.api.diagnostics.KtDiagnosticWithPsi", "org.jetbrains.kotlin.analysis.api.diagnostics.KtDiagnosticWithPsi",
"com.intellij.psi.PsiElement", "com.intellij.psi.PsiElement",
) )
} }
@@ -15,7 +15,7 @@ dependencies {
testCompile(projectTests(":compiler:tests-common")) testCompile(projectTests(":compiler:tests-common"))
testCompile(projectTests(":compiler:tests-spec")) testCompile(projectTests(":compiler:tests-spec"))
testCompile(projectTests("::analysis:low-level-api-fir")) testCompile(projectTests("::analysis:low-level-api-fir"))
testCompile(projectTests(":idea-frontend-fir")) testCompile(projectTests(":analysis:analysis-api-fir"))
testCompile(intellijCoreDep()) { includeJars("intellij-core", "guava", rootProject = rootProject) } testCompile(intellijCoreDep()) { includeJars("intellij-core", "guava", rootProject = rootProject) }
testApiJUnit5() testApiJUnit5()
} }