Skip to content

Commit a7c8a82

Browse files
committed
Polish
1 parent bba1a63 commit a7c8a82

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

rewrite-kotlin/src/main/kotlin/org/openrewrite/kotlin/KotlinTypeMapping.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -779,7 +779,7 @@ class KotlinTypeMapping(
779779
}
780780
} else if (resolvedSymbol.callableId.classId == null) {
781781
methodDeclarationType(resolvedSymbol.fir, null)
782-
declaringType = ShallowClass.build(resolvedSymbol.callableId.packageName.toString() + "." + firFile.name)
782+
declaringType = ShallowClass.build(resolvedSymbol.callableId.packageName.toString() + "." + firFile.name.replaceFirst(".kts", "Kt").replaceFirst(".kt", "Kt"))
783783
//.withMethods(mutableListOf(methodDeclarationType(resolvedSymbol.fir, null)))
784784
//TODO: <need to add methods information here too
785785
}

rewrite-kotlin/src/main/kotlin/org/openrewrite/kotlin/KotlinTypeSignatureBuilder.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -382,7 +382,7 @@ class KotlinTypeSignatureBuilder(private val firSession: FirSession, private val
382382
declaringSig = "kotlin.Library"
383383
}
384384
} else if (resolvedSymbol.callableId.classId == null) {
385-
declaringSig = resolvedSymbol.callableId.packageName.toString() + "." + firFile.name
385+
declaringSig = resolvedSymbol.callableId.packageName.toString() + "." + firFile.name.replaceFirst(".kts", "Kt").replaceFirst(".kt", "Kt")
386386
}
387387
} else if (sym is FirFunctionSymbol<*>) {
388388
declaringSig = signature(function.typeRef)

rewrite-kotlin/src/test/java/org/openrewrite/kotlin/tree/KTSTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ fun two() = "two"
6262
.satisfies(m -> {
6363
assertThat(m.getDeclaringType())
6464
.satisfies(it -> {
65-
assertThat(it.getFullyQualifiedName()).isEqualTo("org.example.openRewriteFile1.kts");
65+
assertThat(it.getFullyQualifiedName()).isEqualTo("org.example.openRewriteFile1Kt");
6666
assertThat(it.getMethods()).hasSize(2);
6767
});
6868
});

0 commit comments

Comments
 (0)