Path: blob/main/extensions/copilot/src/extension/onboardDebug/common/launchConfigService.ts
13399 views
/*---------------------------------------------------------------------------------------------1* Copyright (c) Microsoft Corporation. All rights reserved.2* Licensed under the MIT License. See License.txt in the project root for license information.3*--------------------------------------------------------------------------------------------*/45import * as l10n from '@vscode/l10n';6import type * as vscode from 'vscode';7import { createServiceIdentifier } from '../../../util/common/services';8import { URI } from '../../../util/vs/base/common/uri';910export const needsWorkspaceFolderForTaskError = () => l10n.t`The model asked to run a build task, which requires a workspace folder. Please open a folder and retry.`;1112export interface ILaunchConfigService {13_serviceBrand: undefined;1415/**16* Adds the launch configuration and/or inputs to the user's launch.json.17*/18add(workspaceFolder: URI | undefined, config: ILaunchJSON): Promise<void>;1920/**21* Opens the user's launch.json. Optionally show the new configuration.22*/23show(workspaceFolder: URI, showConfigName?: string): Promise<void>;2425/**26* Launches the debug configuration.27*/28launch(config: ILaunchJSON | vscode.DebugConfiguration): Promise<void>;2930/**31* Resolves the configuration inputs in the given launch.json.32*/33resolveConfigurationInputs(launchJson: ILaunchJSON, defaults?: Map<string, string>, interactor?: ICommandInteractor): Promise<{ config: vscode.DebugConfiguration; inputs: Map<string, string> } | undefined>;34}3536export const ILaunchConfigService = createServiceIdentifier<ILaunchConfigService>('ILaunchConfigService');3738/** Describes the contents of launch.json */39export interface ILaunchJSON {40configurations: vscode.DebugConfiguration[];41inputs?: {42type: string;43id: string;44description: string;45options: string[];46}[];47}4849export interface ITasksJSON {50tasks: vscode.TaskDefinition[];51}5253export interface ICommandInteractor {54isGenerating(): void;55prompt(text: string, defaultValue?: string): Promise<string | undefined>;56ensureTask(workspaceFolder: URI | undefined, definition: vscode.TaskDefinition): Promise<boolean>;57}585960