Skip to content

Incorrectly detecting additional characters #781

Open

Description

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

Activity

  1. DanielRosenwasser commented on Dec 9, 2021

    @DanielRosenwasser
    Member

    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.

  2. IPWright83 commented on Dec 17, 2021

    @IPWright83
    Author

    Daniel Rosenwasser (@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.

  3. bs85 commented on Dec 21, 2021

    @bs85

    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).

  4. IPWright83 commented on Jan 31, 2022

    @IPWright83
    Author

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

  5. IPWright83 commented on Feb 9, 2022

    @IPWright83
    Author

    Hey Daniel Rosenwasser (@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!

  6. Cobertos commented on Feb 14, 2022

    @Cobertos

    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

  7. IPWright83 commented on Feb 14, 2022

    @IPWright83
    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions