Skip to content

Commit af655f6

Browse files
authored
refactor(awsq): remove externalBrowserUtils, use openUrl() #4117
externalBrowserUtils is redundant and does not have telemetry attached.
1 parent be0df62 commit af655f6

File tree

4 files changed

+5
-65
lines changed

4 files changed

+5
-65
lines changed

src/amazonq/commons/externalBrowser/externalBrowserUtils.ts

Lines changed: 0 additions & 22 deletions
This file was deleted.

src/amazonqFeatureDev/controllers/chat/controller.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@ import { AuthController } from '../../../amazonq/auth/controller'
2323
import { getLogger } from '../../../shared/logger'
2424
import { submitFeedback } from '../../../feedback/vue/submitFeedback'
2525
import { placeholder } from '../../../shared/vscode/commands2'
26-
import { ExternalBrowserUtils } from '../../../amazonq/commons/externalBrowser/externalBrowserUtils'
2726
import { userGuideURL } from '../../../amazonq/webview/ui/texts/constants'
2827
import { EditorContentController } from '../../../amazonq/commons/controllers/contentController'
28+
import { openUrl } from '../../../shared/utilities/vsCodeUtils'
2929

3030
export interface ChatControllerEventEmitters {
3131
readonly processHumanChatMessage: EventEmitter<any>
@@ -441,7 +441,7 @@ To learn more, visit the _[Amazon Q User Guide](${userGuideURL})_.
441441
}
442442

443443
private processLink(message: any) {
444-
ExternalBrowserUtils.instance.openLink(message.link)
444+
openUrl(vscode.Uri.parse(message.link))
445445
}
446446

447447
private insertCodeAtPosition(message: any) {

src/codewhispererChat/controllers/chat/controller.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* SPDX-License-Identifier: Apache-2.0
44
*/
55

6-
import { Event as VSCodeEvent } from 'vscode'
6+
import { Event as VSCodeEvent, Uri } from 'vscode'
77
import { EditorContextExtractor } from '../../editor/context/extractor'
88
import { ChatSessionStorage } from '../../storages/chatSession'
99
import { Messenger, StaticTextResponseType } from './messenger/messenger'
@@ -45,8 +45,8 @@ import { getLogger } from '../../../shared/logger/logger'
4545
import { triggerPayloadToChatRequest } from './chatRequest/converter'
4646
import { OnboardingPageInteraction } from '../../../amazonq/onboardingPage/model'
4747
import { getChatAuthState } from '../../../codewhisperer/util/authUtil'
48-
import { ExternalBrowserUtils } from '../../../amazonq/commons/externalBrowser/externalBrowserUtils'
4948
import { processTransformByQ } from '../../../amazonqGumby/entrypoint'
49+
import { openUrl } from '../../../shared/utilities/vsCodeUtils'
5050

5151
export interface ChatControllerMessagePublishers {
5252
readonly processPromptChatMessage: MessagePublisher<PromptMessage>
@@ -191,7 +191,7 @@ export class ChatController {
191191
click: ResponseBodyLinkClickMessage | SourceLinkClickMessage | FooterInfoLinkClick
192192
) {
193193
this.telemetryHelper.recordInteractWithMessage(click)
194-
ExternalBrowserUtils.instance.openLink(click.link)
194+
openUrl(Uri.parse(click.link))
195195
}
196196

197197
private processResponseBodyLinkClick(click: ResponseBodyLinkClickMessage) {

src/test/amazonq/commons/externalBrowser/externalBrowserUtils.test.ts

Lines changed: 0 additions & 38 deletions
This file was deleted.

0 commit comments

Comments
 (0)