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

TypeScript diagnostics gets corrupted after typing Map #47895

Closed
bpasero opened this issue Feb 13, 2022 · 6 comments · Fixed by #48067
Closed

TypeScript diagnostics gets corrupted after typing Map #47895

bpasero opened this issue Feb 13, 2022 · 6 comments · Fixed by #48067
Assignees
Labels
Bug Fix Available

Comments

@bpasero
Copy link
Member

@bpasero bpasero commented Feb 13, 2022

Latest insider broke TS entirely for me. When writing a typed Map I get errors out of nowhere:

Recording 2022-02-13 at 09 01 56

@bpasero bpasero changed the title TypeScript is entirely broken TypeScript Map typing is entirely broken Feb 13, 2022
@mjbvz mjbvz transferred this issue from microsoft/vscode Feb 14, 2022
@mjbvz
Copy link
Contributor

@mjbvz mjbvz commented Feb 14, 2022

Here's a TS Server log of this happening:

tsserver-log-Y1xK2u.zip

I reproduce this in the VS Code codebase by typing out private map = new Map<string, number>() in a class. This corrupted the diagnostics. A few seconds later I ran format and the document was incorrectly formatted

@mjbvz mjbvz removed their assignment Feb 14, 2022
@mjbvz mjbvz removed the important label Feb 14, 2022
@mjbvz mjbvz changed the title TypeScript Map typing is entirely broken TypeScript diagnostics gets corrupted after typing Map Feb 14, 2022
@andrewbranch
Copy link
Member

@andrewbranch andrewbranch commented Feb 14, 2022

Possibly an incremental parsing bug? Probably best to start with a bisect and go from there.

@DanielRosenwasser
Copy link
Member

@DanielRosenwasser DanielRosenwasser commented Feb 15, 2022

First appears in typescript@4.4.0-dev.20210715 from what I can tell.

//// class C {
////     map = new Set<string, number>/*$*/
////
////     foo() {
////
////     }
//// }

Insert () at the /*$*/ marker and expect no errors.

@DanielRosenwasser
Copy link
Member

@DanielRosenwasser DanielRosenwasser commented Feb 15, 2022

Looking at this search query, this was likely caused by #43005

@DanielRosenwasser DanielRosenwasser added the Bug label Feb 15, 2022
@DanielRosenwasser DanielRosenwasser added this to the TypeScript 4.7.0 milestone Feb 15, 2022
@DanielRosenwasser
Copy link
Member

@DanielRosenwasser DanielRosenwasser commented Feb 15, 2022

If we can, we should try to back-port this to 4.6.

@DanielRosenwasser
Copy link
Member

@DanielRosenwasser DanielRosenwasser commented Mar 1, 2022

I've kicked off a task to cherry-pick the fix to release-4.6 - unfortunately, 4.6 is already out. 😅

If there's a VS Code servicing release, maybe we can aim for a 4.6.3 patch release before then. Otherwise, it would still be nice to get this in before 4.7.

crapStone pushed a commit to Calciumdibromid/CaBr2 that referenced this issue Mar 27, 2022
This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [typescript](https://www.typescriptlang.org/) ([source](https://github.com/Microsoft/TypeScript)) | devDependencies | minor | [`4.5.5` -> `4.6.3`](https://renovatebot.com/diffs/npm/typescript/4.5.5/4.6.3) |

---

### Release Notes

<details>
<summary>Microsoft/TypeScript</summary>

### [`v4.6.3`](https://github.com/Microsoft/TypeScript/releases/v4.6.3)

[Compare Source](microsoft/TypeScript@v4.6.2...v4.6.3)

This release includes fixes for

-   [an incremental parsing bug caused by faulty error recovery logic](microsoft/TypeScript#47895)
-   [improved results from the TypeScript API's `preProcessFile` function](microsoft/TypeScript#47657)

For the complete list of fixed issues, check out the

-   [fixed issues query for Typescript 4.6.0 (Beta)](https://github.com/microsoft/TypeScript/issues?q=milestone%3A%22TypeScript+4.6.0%22+).
-   [fixed issues query for Typescript 4.6.1 (RC)](https://github.com/microsoft/TypeScript/issues?q=milestone%3A%22TypeScript+4.6.1%22+).
-   [fixed issues query for Typescript 4.6.2 (Stable)](https://github.com/microsoft/TypeScript/issues?q=milestone%3A%22TypeScript+4.6.2%22+).
-   [fixed issues query for Typescript 4.6.3 (Stable)](https://github.com/microsoft/TypeScript/issues?q=milestone%3A%22TypeScript+4.6.3%22+).

Downloads are available on:

-   [npm](https://www.npmjs.com/package/typescript)

### [`v4.6.2`](https://github.com/Microsoft/TypeScript/releases/v4.6.2)

[Compare Source](microsoft/TypeScript@v4.5.5...v4.6.2)

For release notes, check out the [release announcement](https://devblogs.microsoft.com/typescript/announcing-typescript-4-6/).

For the complete list of fixed issues, check out the

-   [fixed issues query for Typescript 4.6.0 (Beta)](https://github.com/microsoft/TypeScript/issues?q=milestone%3A%22TypeScript+4.6.0%22+).
-   [fixed issues query for Typescript 4.6.1 (RC)](https://github.com/microsoft/TypeScript/issues?q=milestone%3A%22TypeScript+4.6.1%22+).
-   [fixed issues query for Typescript 4.6.2 (Stable)](https://github.com/microsoft/TypeScript/issues?q=milestone%3A%22TypeScript+4.6.2%22+).

Downloads are available on:

-   [npm](https://www.npmjs.com/package/typescript)
-   [Visual Studio 2022/2019](https://marketplace.visualstudio.com/items?itemName=TypeScriptTeam.TypeScript-46) ([Select new version in project options](https://github.com/Microsoft/TypeScript/wiki/Updating-TypeScript-in-Visual-Studio-2017))
-   [NuGet package](https://www.nuget.org/packages/Microsoft.TypeScript.MSBuild)

</details>

---

### Configuration

📅 **Schedule**: At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

 **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, click this checkbox.

---

This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).

Co-authored-by: cabr2-bot <cabr2.help@gmail.com>
Reviewed-on: https://codeberg.org/Calciumdibromid/CaBr2/pulls/1242
Reviewed-by: Epsilon_02 <epsilon_02@noreply.codeberg.org>
Co-authored-by: Calciumdibromid Bot <cabr2_bot@noreply.codeberg.org>
Co-committed-by: Calciumdibromid Bot <cabr2_bot@noreply.codeberg.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Fix Available
Projects
None yet
6 participants