Skip to content

Fix race when registering extension quick fix providers #173155

Merged
Tyriar merged 2 commits intomainfrom
tyriar/168154
Feb 2, 2023
Merged

Fix race when registering extension quick fix providers #173155
Tyriar merged 2 commits intomainfrom
tyriar/168154

Conversation

@Tyriar
Copy link
Copy Markdown
Contributor

@Tyriar Tyriar commented Feb 2, 2023

Fixes #168154

I tested this by adding an await timeout(3000) to before the resolve below in order to artificially simulate the race condition:

this.quickFixes = new Promise((r) => terminalsExtPoint.setHandler(contributions => {
this._terminalProfiles = contributions.map(c => {
return c.value?.profiles?.filter(p => hasValidTerminalIcon(p)).map(e => {
return { ...e, extensionIdentifier: c.description.identifier.value };
}) || [];
}).flat();
const quickFixes = (contributions.filter(c => isProposedApiEnabled(c.description, 'terminalQuickFixProvider')).map(c => c.value.quickFixes ? c.value.quickFixes.map(fix => { return { ...fix, extensionIdentifier: c.description.identifier.value }; }) : [])).flat();
r(quickFixes);
}));

@meganrogge I see the quick fix provider is providing the correct npm init when running npm initt, I don't see the quick fix lightbulb come up though on main or this branch 🤷, Insiders seems fine

@Tyriar Tyriar added this to the February 2023 milestone Feb 2, 2023
@Tyriar Tyriar requested a review from meganrogge February 2, 2023 14:51
@Tyriar Tyriar self-assigned this Feb 2, 2023
@Tyriar Tyriar merged commit dafcf95 into main Feb 2, 2023
@Tyriar Tyriar deleted the tyriar/168154 branch February 2, 2023 16:35
@github-actions github-actions bot locked and limited conversation to collaborators Mar 19, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Error: No registered selector for ID: ms-vscode.npm-command

2 participants