Skip to content

tsserver diagnostic discrepancy on identifier completion #60606

Closed as not planned
@Rudxain

Description

@Rudxain

πŸ”Ž 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Needs More InfoThe issue still hasn't been fully clarified

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions