Description
π Search Terms
region diagnostics auto complete
π Version & Regression Information
- This changed between versions 5.5 and 5.6
I suspect this is a regression caused by #57842
β― Playground Link
No response
π» Code
Any code that auto-completes an identifier should trigger the bug (sometimes)
π Actual behavior
Typing an identifier that TS recognizes, then selecting one of the possible completions, may cause the server to see the source in a way that's inconsistent with the currently opened buffer.
For example, some hours ago, I tried
import { Typog/*cursor*/ } from "@mui/material";
Completed to Typography
succesfully, but the LSP said
Module '"@mui/material"' has no exported member 'Tyraphypog'.
Sometimes, instead of a permutation of chars, it's a duplicate substring (example: useState
-> useStState
)
I can assure you this is not an ESM-specific issue, it happens with regular variables, and object properties too, even on minimal projects with 0 dependencies.
I have to restart the LSP multiple times during a coding session. However, as I said, this is non-deterministic, sometimes it's fine for a while. A single restart is enough to sync the states, until the bug happens again.
π Expected behavior
The LSP must have an internal state that's consistent (no discrepancies) with the actual buffer
Additional information about the issue
hx -V
: helix 24.7 (079f5442)
npm ls -g
(snip): typescript-language-server@4.3.3