Skip to content
This repository was archived by the owner on May 20, 2026. It is now read-only.

Add global listener for GitHub Pull Request extension installation#1643

Closed
Copilot wants to merge 2 commits into
joshspicer/restore-pr-extension-install-logicfrom
copilot/sub-pr-1642
Closed

Add global listener for GitHub Pull Request extension installation#1643
Copilot wants to merge 2 commits into
joshspicer/restore-pr-extension-install-logicfrom
copilot/sub-pr-1642

Conversation

Copilot AI commented Oct 26, 2025

Copy link
Copy Markdown
Contributor

Addresses feedback from #1642 to detect GHPR extension installation via two paths: explicit install flow and manual user installation.

Changes

  • Global listener: Added persistent vscode.extensions.onDidChange listener that detects when GHPR extension is installed by any means and updates context key
  • Event-based explicit install: Replaced polling with onDidChange event to wait for extension installation, maintaining reload notification for explicit install case only

Implementation

// Global listener monitors all extension changes
this._register(vscode.extensions.onDidChange(() => {
    if (this.isPullRequestExtensionInstalled()) {
        vscode.commands.executeCommand('setContext', prExtensionInstalledContextKey, true);
    }
}));

// Explicit install uses event listener, shows reload notification
await new Promise<void>((resolve, reject) => {
    const listener = vscode.extensions.onDidChange(() => {
        if (this.isPullRequestExtensionInstalled()) {
            listener.dispose();
            // Show reload notification...
            resolve();
        }
    });
});

The global listener catches manual installations silently, while the explicit install flow shows the reload prompt.


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Co-authored-by: joshspicer <23246594+joshspicer@users.noreply.github.com>
Copilot AI changed the title [WIP] Update global listener for GHPR installation flow Add global listener for GitHub Pull Request extension installation Oct 26, 2025
Copilot AI requested a review from joshspicer October 26, 2025 23:10
@joshspicer joshspicer closed this Nov 26, 2025
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.

2 participants