Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Oct 26, 2025

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.

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
Copilot finished work on behalf of joshspicer October 26, 2025 23:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants