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

Incorrectly detecting additional characters #781

Open
IPWright83 opened this issue Nov 16, 2021 · 7 comments
Open

Incorrectly detecting additional characters #781

IPWright83 opened this issue Nov 16, 2021 · 7 comments

Comments

@IPWright83
Copy link

I'm encountering an issue whereby the TypeScript validation is detecting additional characters that don't exist in the file. I've encountered this a few times within a couple of different files:

Cannot find name 'Stringg'. Did you mean 'String'?

image

If I attempt to re-save the file this doesn't update as there haven't actually been any changes. If I load in a different editor and save then Sublime re-loads the file and correct the incorrect error. Additionally if I make a superfluous change and re-save the error goes away. But it's very annoying :(

Running Sublime Text 4 - Build 4121
on Ubuntu 20.04.1
@DanielRosenwasser
Copy link
Member

DanielRosenwasser commented Dec 9, 2021

I could imagine that this is caused by some character that creates a mismatch between what the server is seeing and what the language server is seeing. Possibly a paragraph separator (\u2029)? Can you check if you have any unusual characters outside of the extended ASCII range? A regex search for [^\u0000-\u00fff] should do it.

@IPWright83
Copy link
Author

@DanielRosenwasser oddly SublimeText doesn't appear to respect the ^ in that regex as it's matching spaces, brackets etc.

I checked it in VSCode and there are few characters outside the standard range across a number of files, but not in the particular file(s) I've been working in.

@bs85
Copy link

bs85 commented Dec 21, 2021

I've had issues like this, it seems the deltas generated whenever the file is modified are not always reliable, resulting in the ts compiler seeing incorrect content for the file. My work-around is to cut-paste the problematic section (or the whole file).

@IPWright83
Copy link
Author

@bs85 that does fix the issue, thanks. I am seeing this a lot though unfortunately :(

@IPWright83
Copy link
Author

Hey @DanielRosenwasser, I'm just wondering if there's any additional info I can help to diagnose this one. I appreciate I seem to be the only one encountering it at the moment but it's an incredibly annoying issue that's happening > 10x a day. So if there's anything I can to to help try and get this fixed!

@Cobertos
Copy link

I have the same issue, normally I just press add a character at the end of a line and delete it fast. Sometimes it takes a few tries, but it usually gets the right thing send to the typescript compiler

@IPWright83
Copy link
Author

@Cobertos it's maybe exasperated by the fact that the TypeScript linting is taking 25s to lint a single file. So this slight annoyance introduced almost a 60s delay into my workflow 😢

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants