1
1
import type { ConfigurationChangeEvent } from 'vscode' ;
2
2
import { Disposable } from 'vscode' ;
3
3
import { GlyphChars } from '../constants' ;
4
- import type { IntegrationId } from '../constants.integrations' ;
5
4
import { IssueIntegrationId } from '../constants.integrations' ;
6
5
import type { Container } from '../container' ;
7
6
import type { GitRemote } from '../git/models/remote' ;
7
+ import type { RemoteProviderId } from '../git/remotes/remoteProvider' ;
8
8
import { getIssueOrPullRequestHtmlIcon , getIssueOrPullRequestMarkdownIcon } from '../git/utils/-webview/icons' ;
9
9
import type { HostingIntegration , IssueIntegration } from '../plus/integrations/integration' ;
10
+ import { remoteProviderIdToIntegrationId } from '../plus/integrations/integrationService' ;
10
11
import { configuration } from '../system/-webview/configuration' ;
11
12
import { fromNow } from '../system/date' ;
12
13
import { debug } from '../system/decorators/log' ;
@@ -214,9 +215,9 @@ export class Autolinks implements Disposable {
214
215
215
216
const enrichedAutolinks = new Map < string , EnrichedAutolink > ( ) ;
216
217
for ( const [ id , link ] of messageOrAutolinks ) {
217
- let linkIntegration = link . provider
218
- ? await this . container . integrations . get ( link . provider . id as IntegrationId )
219
- : undefined ;
218
+ const integrationId = link . provider ? remoteProviderIdToIntegrationId ( link . provider . id ) : undefined ;
219
+ let linkIntegration =
220
+ integrationId != null ? await this . container . integrations . get ( integrationId ) : undefined ;
220
221
if ( linkIntegration != null ) {
221
222
const connected = linkIntegration . maybeConnected ?? ( await linkIntegration . isConnected ( ) ) ;
222
223
if ( ! connected || ! ( await linkIntegration . access ( ) ) ) {
@@ -226,7 +227,7 @@ export class Autolinks implements Disposable {
226
227
const issueOrPullRequestPromise =
227
228
remote ?. provider != null &&
228
229
integration != null &&
229
- link . provider ?. id === integration . id &&
230
+ integrationId === integration . id &&
230
231
link . provider ?. domain === integration . domain
231
232
? integration . getIssueOrPullRequest (
232
233
link . descriptor ?? remote . provider . repoDesc ,
0 commit comments