kysely icon indicating copy to clipboard operation
kysely copied to clipboard

Autocomplete issue with TS 5.0.2

Open wirekang opened this issue 4 months ago • 4 comments

In Typescript 5.0.2, autocomplete is not working with certain form of selecting:

db.selectFrom("table").select((e) => [
  "", // HERE
]);

Type checking works well, only autocomplete(suggestion) is disabled.

ts kysely works?
5.0.2 0.27.2 X playground
5.0.2 0.27.1 X
5.0.2 0.27.0 X
5.0.2 0.26.3 X
5.0.2 0.26.2 O playground
5.0.2 0.26.1 O

This is probably an issue of Typescript itself since it's gone with latest version of Typescript:

ts kysely works?
5.3.3 0.27.2 O
5.3.3 0.27.1 O
5.3.3 0.27.0 O
5.3.3 0.26.3 O
5.3.3 0.26.2 O
5.3.3 0.26.1 O

But it would be great if Kysely has a type backward compatibility. I'm getting trouble with Monaco Editor because they are strongly bonded with fixed version of TS: current stable one is 5.0.2.

tsconfig.json

{
  "compilerOptions": {
    "strict": true,
    "noImplicitAny": true
  }
}

wirekang avatar Feb 09 '24 12:02 wirekang

Looks like this commit is related.

wirekang avatar Feb 09 '24 12:02 wirekang

The ironic thing is that that specific commit fixed the same issue for the newer typescript versions. These autocompletion things can't be automatically tested. Manually checking against a bunch of typescript versions is too much work.

koskimas avatar Feb 09 '24 13:02 koskimas

Ok, it would be better to close this issue. I hate monaco editor.

wirekang avatar Feb 15 '24 05:02 wirekang

I could try to figure out a way to support two versions: the latest and the one monaco is using. But I'm not sure I'll succeed. It was a shitload of trial and error to fix this for the latest versions already 😅

I'll reopen this for now.

koskimas avatar Feb 15 '24 10:02 koskimas