improved type inference in plugin
This commit is contained in:
1 parent
f6deabaa38
commit
1efa96a990
12 files changed
+276
-125
No files matched your search
@@ -170,16 +170,9 @@ fun ReferencePage() {
|
||||
}
|
||||
|
||||
// --- helpers (mirror IDE provider minimal renderers) ---
|
||||
private fun typeOf(t: MiniTypeRef?): String = when (t) {
|
||||
is MiniTypeName -> ": " + t.segments.joinToString(".") { it.name } + if (t.nullable) "?" else ""
|
||||
is MiniGenericType -> {
|
||||
val base = typeOf(t.base).removePrefix(": ")
|
||||
val args = t.args.joinToString(", ") { typeOf(it).removePrefix(": ") }
|
||||
": ${base}<${args}>" + if (t.nullable) "?" else ""
|
||||
}
|
||||
is MiniFunctionType -> ": (..) -> .." + if (t.nullable) "?" else ""
|
||||
is MiniTypeVar -> ": ${t.name}" + if (t.nullable) "?" else ""
|
||||
null -> ""
|
||||
private fun typeOf(t: MiniTypeRef?): String {
|
||||
val s = DocLookupUtils.typeOf(t)
|
||||
return if (s.isEmpty()) "" else ": $s"
|
||||
}
|
||||
|
||||
private fun signatureOf(fn: MiniFunDecl): String {
|
||||
|
||||
Reference in new issue
Block a user