Move LSP semantics into typed analysis

This commit is contained in:
pavel 2026-08-27 21:28:11 +02:00
commit bac1183593
26 changed files with 1232 additions and 637 deletions

View file

@ -82,7 +82,7 @@ for (const declaration of [
const prefixes = new Set(Object.values(snippets).map((snippet) => snippet.prefix));
for (const prefix of [
"dataclass", "tablerow", "embed", "coroutinescope", "launch", "async", "enum", "match", "matchvalue", "mapto", "safe", "nonnull", "resultfun", "resultmatch", "defer", "foreach", "sqlfetch",
"dataclass", "genericfun", "genericclass", "tablerow", "embed", "coroutinescope", "launch", "async", "enum", "match", "matchvalue", "mapto", "safe", "nonnull", "resultfun", "resultmatch", "defer", "foreach", "sqlfetch",
"sqlsingle", "sqliterator", "sqlinsertnothing", "sqlinsertupdate", "sqlupdatereturning"
]) {
assert(prefixes.has(prefix), `snippets are missing prefix ${prefix}`);

View file

@ -36,6 +36,22 @@
],
"description": "Gotlin data class"
},
"Generic Function": {
"prefix": "genericfun",
"body": [
"fun ${1:identity}<${2:T}>(${3:value}: ${2:T}): ${2:T} {",
" return ${3:value}",
"}"
],
"description": "Gotlin generic function"
},
"Generic Data Class": {
"prefix": "genericclass",
"body": [
"data class ${1:Box}<${2:T}>(var ${3:value}: ${2:T})"
],
"description": "Gotlin generic data class"
},
"SQL Table Row": {
"prefix": "tablerow",
"body": [