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

Ignore related info in diagnostic deduplication #50309

Merged
merged 2 commits into from
Aug 16, 2022

Conversation

andrewbranch
Copy link
Member

@andrewbranch andrewbranch commented Aug 15, 2022

Probably fixes #50243 but I can’t reproduce it. I noticed this first in #50088 (review) and worked around it. I think there may be more than one place we deduplicate diagnostics which makes this not noticeable on the CLI or in error baselines—the two baselines that changed actually had materially different related info, but I still think it’s better to deduplicate. In the fourslash test that changed, however, the language service actually had two identical copies
of each diagnostic.

Also fixes #49437

@andrewbranch
Copy link
Member Author

@typescript-bot pack this

@typescript-bot
Copy link
Collaborator

typescript-bot commented Aug 15, 2022

Heya @andrewbranch, I've started to run the tarball bundle task on this PR at 95736c0. You can monitor the build here.

@typescript-bot
Copy link
Collaborator

typescript-bot commented Aug 15, 2022

Hey @andrewbranch, I've packed this into an installable tgz. You can install it for testing by referencing it in your package.json like so:

{
    "devDependencies": {
        "typescript": "https://typescript.visualstudio.com/cf7ac146-d525-443c-b23c-0d58337efebc/_apis/build/builds/131869/artifacts?artifactName=tgz&fileId=0B881E4E9C85FA05391BBD61103268AA8C487432A92D223504C1B6A75476F5B102&fileName=/typescript-4.9.0-insiders.20220815.tgz"
    }
}

and then running npm install.


There is also a playground for this build and an npm module you can use via "typescript": "npm:@typescript-deploys/[email protected]".;

Copy link
Member

@sheetalkamat sheetalkamat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My understanding here is that lookup we were skipping related information for binary search (checker uses this to get diagnostic and attach related information to existing or new diagnostic) But while inserting we used diagnostic with related information to determine sorting order and that messed with lookup i think which resulted in duplicate errors in your scenario..
This change makes sense.

@DanielRosenwasser
Copy link
Member

I wonder if this solves #49437 as well.

@DanielRosenwasser
Copy link
Member

@andrewbranch @sheetalkamat I figured out how that weird issue I filed manifested itself and described it on #49437 (comment)

@andrewbranch can you add something like the following test case to see if it passes now? Today it fails in TypeScript.

/// <reference path="./fourslash.ts" />

////let lololol = 123;
////
////lololo/**/

verify.encodedSemanticClassificationsLength("2020", 3);
verify.numberOfErrorsInCurrentFile(1);

@andrewbranch
Copy link
Member Author

@DanielRosenwasser it passes.

@typescript-bot typescript-bot added the For Milestone Bug PRs that fix a bug with a specific milestone label Aug 16, 2022
@andrewbranch
Copy link
Member Author

CI failure was in main and fixed in #50320

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Author: Team For Backlog Bug PRs that fix a backlog bug For Milestone Bug PRs that fix a bug with a specific milestone
Projects
None yet
4 participants