Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tsserver diagnostic discrepancy on identifier completion #60606

Open
Rudxain opened this issue Nov 26, 2024 · 1 comment
Open

tsserver diagnostic discrepancy on identifier completion #60606

Rudxain opened this issue Nov 26, 2024 · 1 comment
Labels
Needs More Info The issue still hasn't been fully clarified

Comments

@Rudxain
Copy link

Rudxain commented Nov 26, 2024

πŸ”Ž 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): [email protected]

@jakebailey
Copy link
Member

Can you test using VS Code? It's highly likely this is actually a problem with your LSP wrapper or editor using this API incorrectly. I do not think the feature is enabled unless a client enables it.

@Rudxain Rudxain changed the title tsserver region diagnostics auto-complete is very unreliable tsserver diagnostic discrepancy on identifier completion Nov 27, 2024
@RyanCavanaugh RyanCavanaugh added the Needs More Info The issue still hasn't been fully clarified label Nov 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs More Info The issue still hasn't been fully clarified
Projects
None yet
Development

No branches or pull requests

3 participants