Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
microsoft
GitHub Repository: microsoft/vscode
Path: blob/main/extensions/copilot/src/platform/open/common/opener.ts
13401 views
1
/*---------------------------------------------------------------------------------------------
2
* Copyright (c) Microsoft Corporation. All rights reserved.
3
* Licensed under the MIT License. See License.txt in the project root for license information.
4
*--------------------------------------------------------------------------------------------*/
5
6
import { createServiceIdentifier } from '../../../util/common/services';
7
8
export const IUrlOpener = createServiceIdentifier<IUrlOpener>('IUrlOpener');
9
10
/**
11
* Encapsulates all the functionality related opening urls in a browser.
12
*/
13
export interface IUrlOpener {
14
readonly _serviceBrand: undefined;
15
open(target: string): void;
16
}
17
18
export class NullUrlOpener implements IUrlOpener {
19
20
declare readonly _serviceBrand: undefined;
21
22
public readonly openedUrls: string[] = [];
23
24
open(target: string): void {
25
this.openedUrls.push(target);
26
}
27
}
28
29