Skip to content

Conversation

@andrewbranch
Copy link
Member

Fixes part of #46568

This duplicates the work of calculating auto-imports between CompletionInfo and CompletionDetails in order to support this without a last-minute protocol change and VS Code update. During 4.6, we can actually just update the protocol and leverage the work done in CompletionInfo, removing the CompletionDetails work, but I think this is alright for the moment.

Kapture.2021-10-29.at.13.36.07.mp4

@typescript-bot typescript-bot added Author: Team For Uncommitted Bug PR for untriaged, rejected, closed or missing bug labels Oct 29, 2021
"category": "Message",
"code": 90053
},
"Includes imports of types referenced by '{0}'": {
Copy link
Member Author

Choose a reason for hiding this comment

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

Note that this is never surfaced by the VS Code UI 🤷

I think that's totally fine, I only made it because the protocol made me have a message to go along with the fix

Copy link
Member

@gabritto gabritto left a comment

Choose a reason for hiding this comment

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

I think this makes sense for a quick win, and like you said, we can deduplicate the import adder efforts later. Thanks ✨


if (actual.insertText !== expected.insertText) {
this.raiseError(`Expected completion insert text to be ${expected.insertText}, got ${actual.insertText}`);
this.raiseError(`Completion insert text did not match: ${showTextDiff(expected.insertText || "", actual.insertText || "")}`);
Copy link
Member

Choose a reason for hiding this comment

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

that's awesome, I've been needing this for a while

Copy link
Member Author

Choose a reason for hiding this comment

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

I usually try to fix things that annoy me about fourslash, it has definitely paid off even if I were the only person using it 😅

@andrewbranch andrewbranch merged commit eeaa595 into microsoft:main Oct 29, 2021
@andrewbranch andrewbranch deleted the feature/member-snippet-auto-imports branch October 29, 2021 21:43
mprobst pushed a commit to mprobst/TypeScript that referenced this pull request Jan 10, 2022
@microsoft microsoft locked as resolved and limited conversation to collaborators Oct 21, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Author: Team For Uncommitted Bug PR for untriaged, rejected, closed or missing bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants