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

Debt: Issue Quick Access cleanup #207103

Closed
justschen opened this issue Mar 7, 2024 · 0 comments
Closed

Debt: Issue Quick Access cleanup #207103

justschen opened this issue Mar 7, 2024 · 0 comments
Assignees
Labels
debt Code quality issues issue-reporter Issue reporter widget issues

Comments

@justschen
Copy link
Contributor

          Non-blocking. I feel like this function could be 2 different functions for actions or extensions... or you `if` setting a couple variables instead and then return a common object:
const buttons = [{
	iconClass: ThemeIcon.asClassName(Codicon.info),
	tooltip: localize('contributedIssuePage', "Open Extension Page")
}];

let label: string;
let trigger: THE_TRIGGER_TYPE;
let accept: THE_ACCEPT_TYPE;
if (action ....) {
    label = action.item.source?.title;
    trigger = () => {
        this.commandService.executeCommand('extension.open', action.item.source.id);
        return TriggerAction.CLOSE_PICKER;
    };
    accept = () => action.run();
} else if (extension) {
    label = extension.displayName ?? extension.name;
    trigger = () => {
        this.commandService.executeCommand('extension.open', extension.identifier.value);
 	return TriggerAction.CLOSE_PICKER;
    };
    accept = () => this.commandService.executeCommand('workbench.action.openIssueReporter', extension.identifier.value);
} else {
    // could this ever happen?
    return undefined;
}

return {
    label,
    highlights: { label: matchesFuzzy(filter, label, true) },
    buttons,
    trigger,
    accept
};

Originally posted by @TylerLeonhardt in #206303 (comment)

@justschen justschen self-assigned this Mar 7, 2024
@justschen justschen added debt Code quality issues issue-reporter Issue reporter widget issues labels Mar 7, 2024
@microsoft microsoft locked and limited conversation to collaborators Jun 10, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
debt Code quality issues issue-reporter Issue reporter widget issues
Projects
None yet
Development

No branches or pull requests

1 participant