### Manual Setup for MCP Server Source: https://github.com/microsoft/vscode/blob/main/test/mcp/README.md Steps to manually set up and run the MCP server from the command line. This involves navigating to the directory, installing dependencies, compiling TypeScript, and starting the server. ```bash # Navigate to the MCP directory cd test/mcp # Install dependencies npm install # Compile TypeScript npm run compile # or watch # Start the server npm start ``` -------------------------------- ### Example tasks.json for Run Commands Source: https://github.com/microsoft/vscode/blob/main/src/vs/sessions/skills/generate-run-commands/SKILL.md Defines two run commands: one for installing dependencies that auto-runs on worktree creation, and another for starting a dev server. Ensure `inAgents` is set to `true` for commands to appear in the Agents run button. ```json { "tasks": [ { "label": "Install dependencies", "type": "shell", "command": "npm install", "inAgents": true, "runOptions": { "runOn": "worktreeCreated" } }, { "label": "Start dev server", "type": "shell", "command": "npm run dev", "inAgents": true } ] } ``` -------------------------------- ### Execute Copilot Setup Logic Source: https://github.com/microsoft/vscode/blob/main/extensions/copilot/src/platform/parser/test/node/fixtures/chatSetup.ts.getStructure.html Performs the core Copilot setup logic, including signing in the user if necessary, requesting workspace trust, and installing Copilot. It manages the setup state and logs installation results. ```typescript private async doSetup(options: { forceSignIn?: boolean }, watch: StopWatch): Promise { this.context.suspend(); // reduces flicker let success = false; try { const providerId = ChatEntitlementRequests.providerId(this.configurationService); let session: AuthenticationSession | undefined; let entitlement: ChatEntitlement | undefined; // Entitlement Unknown or `forceSignIn`: we need to sign-in user if (this.context.state.entitlement === ChatEntitlement.Unknown || options.forceSignIn) { this.setStep(ChatSetupStep.SigningIn); const result = await this.signIn(providerId); if (!result.session) { this.telemetryService.publicLog2('commandCenter.ChatInstall', { installResult: 'failedNotSignedIn', installDuration: watch.elapsed(), signUpErrorCode: undefined, }); return false; } session = result.session; entitlement = result.entitlement; } const trusted = await this.workspaceTrustRequestService.requestWorkspaceTrust({ message: localize('copilotWorkspaceTrust', "Copilot is currently only supported in trusted workspaces.") }); if (!trusted) { this.telemetryService.publicLog2('commandCenter.ChatInstall', { installResult: 'failedNotTrusted', installDuration: watch.elapsed(), signUpErrorCode: undefined, }); return false; } // Install this.setStep(ChatSetupStep.Installing); success = await this.install(session, entitlement ?? this.context.state.entitlement, providerId, watch); } finally { this.setStep(ChatSetupStep.Initial); this.context.resume(); } return success; } ``` -------------------------------- ### Install Python setuptools Source: https://github.com/microsoft/vscode/wiki/How-to-Contribute Recommended package installation to prevent build errors during node-gyp compilation. ```bash pip install setuptools ``` -------------------------------- ### Start MCP Server via Command Palette Source: https://github.com/microsoft/vscode/blob/main/test/mcp/README.md Use the Command Palette to start the vscode-automation-mcp server. Ensure all dependencies are installed first. ```plaintext MCP: List Servers → vscode-automation-mcp → Start Server ``` -------------------------------- ### Install dependencies Source: https://github.com/microsoft/vscode/wiki/How-to-Contribute Install all necessary project dependencies using npm. ```bash cd vscode npm install ``` -------------------------------- ### Handle Chat Setup Progress and Results Source: https://github.com/microsoft/vscode/blob/main/extensions/copilot/src/platform/parser/test/node/fixtures/chatSetup.ts.getStructure.html Manages the progress and final outcome of the chat setup process, displaying messages for signing in, installing, success, or failure. It forwards requests to Copilot if setup is successful. ```typescript progress({ kind: 'progressMessage', content: new MarkdownString(localize('setupChatSignIn2', "Signing in to {0}.", ChatEntitlementRequests.providerId(this.configurationService) === defaultChat.enterpriseProviderId ? defaultChat.enterpriseProviderName : defaultChat.providerName)), }); break; case ChatSetupStep.Installing: progress({ kind: 'progressMessage', content: new MarkdownString(localize('installingCopilot', "Getting Copilot ready.")), }); break; } })); let result: IChatSetupResult | undefined = undefined; try { result = await ChatSetup.getInstance(this.instantiationService, this.context, this.controller).run(); } catch (error) { this.logService.error(\`[chat setup] Error during setup: ${toErrorMessage(error)}\`); } finally { setupListener.dispose(); } // User has agreed to run the setup if (typeof result?.success === 'boolean') { if (result.success) { if (result.dialogSkipped) { progress({ kind: 'progressMessage', content: new MarkdownString(localize('copilotSetupSuccess', "Copilot setup finished successfully.")) }); } else if (requestModel) { // Replace agent part with the actual Copilot agent let newRequest = this.replaceAgentInRequestModel(requestModel, chatAgentService); // Then replace any tool parts with the actual Copilot tools newRequest = this.replaceToolInRequestModel(newRequest); await this.forwardRequestToCopilot(newRequest, progress, chatService, languageModelsService, chatAgentService, chatWidgetService, languageModelToolsService); } } else { progress({ kind: 'warning', content: new MarkdownString(localize('copilotSetupError', "Copilot setup failed.")) }); } } // User has cancelled the setup else { progress({ kind: 'markdownContent', content: SetupChatAgent.SETUP_NEEDED_MESSAGE, }); } return {}; } ``` -------------------------------- ### Install and Run showkey on macOS Source: https://github.com/microsoft/vscode/wiki/Terminal-Issues Use Homebrew to install and run the showkey utility on macOS. ```bash brew install showkey showkey -a ``` -------------------------------- ### Load Example into Source Pane Source: https://github.com/microsoft/vscode/blob/main/src/vs/base/test/node/pfs/fixtures/index.html Populates the Strada source code pane with a selected example. It fetches the example code from the server and then triggers an update of the compiled output. ```javascript function exampleSelectionChanged() { var examples = document.getElementById('examples'); var selectedExample = examples.options[examples.selectedIndex].value; if (selectedExample != "") { $.get('examples/' + selectedExample, function (srcText) { $('#stradaSrc').val(srcText); setTimeout(srcUpdated,100); }, function (err) { console.log(err); }); } } ``` -------------------------------- ### Register and Implement Setup Tool Source: https://github.com/microsoft/vscode/blob/main/extensions/copilot/src/platform/parser/test/node/fixtures/chatSetup.ts.getStructure.html Registers a tool for setup purposes and provides an implementation for its invocation. This is a basic tool that currently returns an empty text result. ```typescript static registerTools(instantiationService: IInstantiationService, toolData: IToolData): { disposable: IDisposable; tool: SetupTool } { return instantiationService.invokeFunction(accessor => { const disposables = new DisposableStore(); const toolService = accessor.get(ILanguageModelToolsService); disposables.add(toolService.registerToolData(toolData)); const tool = instantiationService.createInstance(SetupTool); disposables.add(toolService.registerToolImplementation(toolData.id, tool)); return { tool, disposable: disposables }; }); } constructor( ) { super(); } invoke(invocation: IToolInvocation, countTokens: CountTokensCallback, token: CancellationToken): Promise { const result: IToolResult = { content: [ { kind: 'text', value: '' } ] }; return Promise.resolve(result); } prepareToolInvocation?(parameters: any, token: ``` -------------------------------- ### Install Snap Package Source: https://github.com/microsoft/vscode/wiki/Sanity-Check Install a VS Code snap package using `snap install`. The `--classic` flag is required for VS Code, and `--dangerous` is needed for locally downloaded snaps. ```sh sudo snap install --classic --dangerous .snap ``` -------------------------------- ### Install build toolchain and chroot prerequisites Source: https://github.com/microsoft/vscode/wiki/Cross-Compiling-for-Debian-Based-Linux Installs QEMU, debootstrap, and ARM cross-compilation toolchains required for building VS Code on a different architecture. Run this command with sudo. ```bash sudo apt-get install qemu qemu-user-static debootstrap gcc-arm-linux-gnueabihf g++-arm-linux-gnueabihf ``` -------------------------------- ### Install Seti-UI Dependencies Source: https://github.com/microsoft/vscode/blob/main/extensions/theme-seti/README.md Install the necessary dependencies for `seti-ui` by running `npm install` within the `seti-ui` directory. This is a prerequisite for generating updated icons from a local copy. ```bash npm install ``` -------------------------------- ### Invoke Chat Setup Source: https://github.com/microsoft/vscode/blob/main/extensions/copilot/src/platform/parser/test/node/fixtures/chatSetup.ts.getStructure.html Initiates the chat setup process, logs a workbench action, and monitors changes in the chat controller's step to react to different setup stages like signing in. ```typescript private async doInvokeWithSetup(request: IChatAgentRequest, progress: (part: IChatProgress) => void, chatService: IChatService, languageModelsService: ILanguageModelsService, chatWidgetService: IChatWidgetService, chatAgentService: IChatAgentService, languageModelToolsService: ILanguageModelToolsService): Promise { this.telemetryService.publicLog2('workbenchActionExecuted', { id: CHAT_SETUP_ACTION_ID, from: 'chat' }); const requestModel = chatWidgetService.getWidgetBySessionId(request.sessionId)?.viewModel?.model.getRequests().at(-1); const setupListener = Event.runAndSubscribe(this.controller.value.onDidChange, (() => { switch (this.controller.value.step) { case ChatSetupStep.SigningIn: pro ``` -------------------------------- ### Install Dependencies Source: https://github.com/microsoft/vscode/blob/main/extensions/html-language-features/CONTRIBUTING.md Run this command in the root of the VS Code repository to install all necessary dependencies for the project, including those for extensions. ```bash npm i ``` -------------------------------- ### Install Node.js via nvm-windows on ARM64 Source: https://github.com/microsoft/vscode/wiki/How-to-Contribute Required command syntax for installing Node.js on ARM64 architecture using nvm-windows. ```bash nvm install 22 arm64 ``` -------------------------------- ### Install Visual Studio Build Tools via winget Source: https://github.com/microsoft/vscode/wiki/How-to-Contribute Automated installation commands for C++ build environments on various Windows architectures. ```bash winget install --id Microsoft.VisualStudio.2022.BuildTools -e --source winget --override "--add Microsoft.VisualStudio.Component.Windows11SDK.22621 --add Microsoft.VisualStudio.Workload.VCTools --add Microsoft.VisualStudio.Component.VC.Runtimes.x86.x64.Spectre --add Microsoft.VisualStudio.Component.VC.ATL.Spectre --add Microsoft.VisualStudio.Component.VC.ATLMFC.Spectre" ``` ```bash winget install --id Microsoft.VisualStudio.2022.BuildTools -e --source winget --override "--add Microsoft.VisualStudio.Component.Windows10SDK.20348 --add Microsoft.VisualStudio.Workload.VCTools --add Microsoft.VisualStudio.Component.VC.Runtimes.ARM.Spectre --add Microsoft.VisualStudio.Component.VC.ATL.ARM.Spectre --add Microsoft.VisualStudio.Component.VC.MFC.ARM.Spectre" ``` ```bash winget install --id Microsoft.VisualStudio.2022.BuildTools -e --source winget --override "--add Microsoft.VisualStudio.Component.Windows10SDK.20348 --add Microsoft.VisualStudio.Workload.VCTools --add Microsoft.VisualStudio.Component.VC.Runtimes.ARM64.Spectre --add Microsoft.VisualStudio.Component.VC.ATL.ARM64.Spectre --add Microsoft.VisualStudio.Component.VC.MFC.ARM64.Spectre" ``` -------------------------------- ### Install macOS Command Line Tools Source: https://github.com/microsoft/vscode/wiki/How-to-Contribute Install Xcode command line tools to provide the necessary build toolchain. ```bash xcode-select --install ``` -------------------------------- ### Initialize Copilot Setup Service Source: https://github.com/microsoft/vscode/blob/main/extensions/copilot/src/platform/parser/test/node/fixtures/chatSetup.ts.getStructure.html Initializes the Copilot setup service with various dependencies required for managing the setup process, including progress, activity, command, workspace trust, dialog, configuration, lifecycle, and quick input services. ```typescript constructor( @IProgressService private readonly progressService: IProgressService, @IActivityService private readonly activityService: IActivityService, @ICommandService private readonly commandService: ICommandService, @IWorkspaceTrustRequestService private readonly workspaceTrustRequestService: IWorkspaceTrustRequestService, @IDialogService private readonly dialogService: IDialogService, @IConfigurationService private readonly configurationService: IConfigurationService, @ILifecycleService private readonly lifecycleService: ILifecycleService, @IQuickInputService private readonly quickInputService: IQuickInputService, ) { super(); this.registerListeners(); } ``` -------------------------------- ### Setup Chat Agent Initialization Message Source: https://github.com/microsoft/vscode/blob/main/extensions/copilot/src/platform/parser/test/node/fixtures/chatSetup.ts.getStructure.html Defines the markdown string used to inform the user that setup is needed for the chat agent. ```typescript private static readonly SETUP_NEEDED_MESSAGE = new MarkdownString(localize('settingUpCopilotNeeded', "You need to set up Copilot to use Chat.")); ``` -------------------------------- ### Chat Setup Controller Initialization Source: https://github.com/microsoft/vscode/blob/main/extensions/copilot/src/platform/parser/test/node/fixtures/chatSetup.ts.getStructure.html Initializes the ChatSetupController with necessary services and defines the current setup step. This controller manages the state and logic for setting up chat features. ```typescript class ChatSetupController extends Disposable { private readonly _onDidChange = this._register(new Emitter()); readonly onDidChange = this._onDidChange.event; private _step = ChatSetupStep.Initial; get step(): ChatSetupStep { return this._step; } constructor( private readonly context: ChatEntitlementContext, private readonly requests: ChatEntitlementRequests, @ITelemetryService private readonly telemetryService: ITelemetryService, @IAuthenticationService private readonly authenticationService: IAuthenticationService, @IExtensionsWorkbenchService private readonly extensionsWorkbenchService: IExtensionsWorkbenchService, @IProductService private readonly productService: IProductService, @ILogService private readonly logService: ILogService, ) { super(); } } ``` -------------------------------- ### Setup Notebook Extension Environment Source: https://github.com/microsoft/vscode/wiki/Notebook-Smoke-Test Commands to clone the notebook extension samples and prepare the build environment. ```bash git clone https://github.com/microsoft/notebook-extension-samples ``` ```bash yarn && yarn run install && yarn run build ``` -------------------------------- ### Basic Logging and References Source: https://github.com/microsoft/vscode/blob/main/extensions/copilot/src/extension/tools/test/node/replaceString/fixtures/math.js.txt Initial setup including a reference path and a console log statement. ```javascript /// console.log("foobar"); ``` -------------------------------- ### Create Instruction Template Source: https://github.com/microsoft/vscode/blob/main/extensions/copilot/assets/prompts/skills/agent-customization/references/instructions.md Structure instruction files with descriptive frontmatter followed by clear, actionable guidelines. ```markdown --- description: "Use when writing database migrations, schema changes, or data transformations. Covers safety checks and rollback patterns." --- # Migration Guidelines - Always create reversible migrations - Test rollback before merging - Never drop columns in the same release as code removal ``` -------------------------------- ### Handle Chat Request Without Setup Source: https://github.com/microsoft/vscode/blob/main/extensions/copilot/src/platform/parser/test/node/fixtures/chatSetup.ts.getStructure.html Manages chat requests when the user does not require setup, displaying a 'getting ready' message and forwarding the request. ```typescript private async doInvokeWithoutSetup(request: IChatAgentRequest, progress: (part: IChatProgress) => void, chatService: IChatService, languageModelsService: ILanguageModelsService, chatWidgetService: IChatWidgetService, chatAgentService: IChatAgentService, languageModelToolsService: ILanguageModelToolsService): Promise { const requestModel = chatWidgetService.getWidgetBySessionId(request.sessionId)?.viewModel?.model.getRequests().at(-1); if (!requestModel) { this.logService.error('[chat setup] Request model not found, cannot redispatch request.'); return {}; // this should not happen } progress({ kind: 'progressMessage', content: new MarkdownString(localize('waitingCopilot', "Getting Copilot ready.")) }); await this.forwardRequestToCopilot(requestModel, progress, chatService, languageModelsService, chatAgentService, chatWidgetService, languageModelToolsService); return {}; } ``` -------------------------------- ### Launching the Language Server Source: https://github.com/microsoft/vscode/blob/main/extensions/json-language-features/server/README.md Instructions on how to install and launch the JSON language server as a command-line tool. ```APIDOC ## Launching the JSON Language Server ### Installation ```bash npm install -g vscode-json-languageserver ``` ### Usage Start the language server with the `vscode-json-languageserver` command, specifying the communication channel: ```bash vscode-json-languageserver --node-ipc vscode-json-languageserver --stdio vscode-json-languageserver --socket= ``` ``` -------------------------------- ### Copilot CLI Session Service Source: https://github.com/microsoft/vscode/blob/main/extensions/copilot/docs/monitoring/agent_monitoring_arch.md Handles bridge installation and OpenTelemetry environment variable setup for Copilot CLI sessions. ```typescript copilotcliSessionService.ts ``` -------------------------------- ### Run vscode-bisect CLI for Sanity Testing Source: https://github.com/microsoft/vscode/wiki/Sanity-Check Execute the vscode-bisect CLI tool to perform sanity testing on a specific VS Code build. This command will guide you through downloading, installing, and testing the build. ```sh npx @vscode/vscode-bisect@latest --sanity --commit ``` -------------------------------- ### Create ARM root filesystem Source: https://github.com/microsoft/vscode/wiki/Cross-Compiling-for-Debian-Based-Linux Creates a minimal root filesystem for the ARM target architecture using QEMU and debootstrap. This is a one-time setup step. ```bash sudo qemu-debootstrap --arch=armhf --variant=minbase xenial rootfs ``` -------------------------------- ### Start Extension Bisect for Performance Issues Source: https://github.com/microsoft/vscode/wiki/Performance-Issues Use this command to automatically identify a problematic extension by performing a binary search on your installed extensions. VS Code will disable extensions and reload, asking you to confirm if the issue persists. ```bash Help: Start Extension Bisect ``` -------------------------------- ### Run VS Code CLI Tunnel on Linux ARMv7 Source: https://github.com/microsoft/vscode/wiki/Sanity-Check Launches a VS Code CLI tunnel for the linux/arm/v7 platform within a Docker container. It updates packages, installs dependencies, downloads the specified commit of the CLI, and starts the tunnel. ```shell docker run -e COMMIT -it --rm --pull always --platform linux/arm/v7 arm32v7/ubuntu /bin/sh -c 'apt update && DEBIAN_FRONTEND=noninteractive apt install -y wget libatomic1 ca-certificates python3-minimal && wget "https://update.code.visualstudio.com/commit:$COMMIT/cli-linux-armhf/stable" -O- | tar -xz && ./code tunnel' ``` -------------------------------- ### Install and Run showkey on Linux Source: https://github.com/microsoft/vscode/wiki/Terminal-Issues Use the kbd package to inspect character codes received by the application on Linux systems. ```bash sudo apt update sudo apt install kbd showkey -a ``` -------------------------------- ### Step Execution Example Source: https://github.com/microsoft/vscode/blob/main/src/vs/sessions/test/e2e/README.md Trace of how a 'Click button "Cloud"' step is processed during the generate and test phases. ```yaml - group "Session target" - button "Local" [ref=e141] - button "Cloud" [ref=e143] ``` -------------------------------- ### Run VS Code CLI Tunnel on Linux ARM64 Source: https://github.com/microsoft/vscode/wiki/Sanity-Check Launches a VS Code CLI tunnel for the linux/arm64 platform within a Docker container. It updates packages, installs dependencies, downloads the specified commit of the CLI, and starts the tunnel. ```shell docker run -e COMMIT -it --rm --pull always --platform linux/arm64 mcr.microsoft.com/devcontainers/base:latest /bin/sh -c 'apt update && DEBIAN_FRONTEND=noninteractive apt install -y wget libatomic1 ca-certificates python3-minimal && wget "https://update.code.visualstudio.com/commit:$COMMIT/cli-linux-arm64/stable" -O- | tar -xz && ./code tunnel' ``` -------------------------------- ### Run VS Code CLI Tunnel on Linux AMD64 Source: https://github.com/microsoft/vscode/wiki/Sanity-Check Launches a VS Code CLI tunnel for the linux/amd64 platform within a Docker container. It updates packages, installs dependencies, downloads the specified commit of the CLI, and starts the tunnel. ```shell docker run -e COMMIT -it --rm --pull always --platform linux/amd64 mcr.microsoft.com/devcontainers/base:latest /bin/sh -c 'apt update && DEBIAN_FRONTEND=noninteractive apt install -y wget libatomic1 ca-certificates python3-minimal && wget "https://update.code.visualstudio.com/commit:$COMMIT/cli-linux-x64/stable" -O- | tar -xz && ./code tunnel' ``` -------------------------------- ### Run VS Code CLI Tunnel on Alpine Linux ARM64 Source: https://github.com/microsoft/vscode/wiki/Sanity-Check Launches a VS Code CLI tunnel for the linux/arm64 platform on an Alpine base image within a Docker container. It updates packages, installs dependencies, downloads the specified commit of the CLI, and starts the tunnel. ```shell docker run -e COMMIT -it --rm --pull always --platform linux/arm64 arm64v8/alpine /bin/sh -c 'apk update && apk add musl libgcc libstdc++ && wget "https://update.code.visualstudio.com/commit:$COMMIT/cli-alpine-arm64/stable" -O- | tar -xz && ./code tunnel' ``` -------------------------------- ### Initialize VS Code Workbench Environment Source: https://github.com/microsoft/vscode/blob/main/src/vs/code/browser/workbench/workbench.html Sets up performance markers and the base URL for the workbench file root. ```javascript performance.mark('code/didStartRenderer'); const baseUrl = new URL('{{WORKBENCH_WEB_BASE_URL}}', window.location.origin).toString(); globalThis._VSCODE_FILE_ROOT = baseUrl + '/out/'; performance.mark('code/willLoadWorkbenchMain'); ``` -------------------------------- ### Run VS Code CLI Tunnel on Alpine Linux AMD64 Source: https://github.com/microsoft/vscode/wiki/Sanity-Check Launches a VS Code CLI tunnel for the linux/amd64 platform on an Alpine base image within a Docker container. It updates packages, installs dependencies, downloads the specified commit of the CLI, and starts the tunnel. ```shell docker run -e COMMIT -it --rm --pull always --platform linux/amd64 amd64/alpine /bin/sh -c 'apk update && apk add musl libgcc libstdc++ && wget "https://update.code.visualstudio.com/commit:$COMMIT/cli-alpine-x64/stable" -O- | tar -xz && ./code tunnel' ``` -------------------------------- ### Initiate Copilot Setup with Progress Source: https://github.com/microsoft/vscode/blob/main/extensions/copilot/src/platform/parser/test/node/fixtures/chatSetup.ts.getStructure.html Initiates the Copilot setup process, displaying progress to the user. It uses `progressService.withProgress` to manage the progress indicator and ensures the progress badge is disposed of upon completion or error. ```typescript async setup(options?: { forceSignIn?: boolean }): Promise { const watch = new StopWatch(false); const title = localize('setupChatProgress', "Getting Copilot ready..."); const badge = this.activityService.showViewContainerActivity(CHAT_SIDEBAR_PANEL_ID, { badge: new ProgressBadge(() => title), }); try { return await this.progressService.withProgress({ location: ProgressLocation.Window, command: CHAT_OPEN_ACTION_ID, title, }, () => this.doSetup(options ?? {}, watch)); } finally { badge.dispose(); } } ``` -------------------------------- ### Tilde-Wrapped Code Block Example Source: https://github.com/microsoft/vscode/blob/main/extensions/vscode-colorize-tests/test/colorize-fixtures/test.md This example uses tildes to create an un-indented code block, often used for longer code examples. ```javascript // Markdown extra adds un-indented code blocks too if (this_is_more_code == true && !indented) { // tild wrapped code blocks, also not indented } ``` -------------------------------- ### Marketplace & Installation Services Source: https://github.com/microsoft/vscode/blob/main/src/vs/workbench/contrib/chat/common/plugins/AGENTS_PLUGINS.md Describes the `IPluginMarketplaceService` for managing plugin catalogs and installation, including fetching marketplaces, handling installed storage, managing trust, enabling auto-updates, and GitHub caching. It also details the `IPluginInstallService` for orchestrating install and update workflows. ```APIDOC ## Marketplace & Installation ### IPluginMarketplaceService Manages the catalog of available and installed plugins: - **Fetch** — reads `chat.pluginMarketplaces` config (GitHub shorthand, Git URLs, or file URIs), fetches `marketplace.json` from each, and returns parsed `IMarketplacePlugin` entries. - **Installed storage** — persists installed plugins in application-scoped storage (`chat.plugins.installed.v1`). Each entry tracks `{ pluginUri, plugin, enabled }`. - **Trust** — marketplace canonical IDs must be explicitly trusted before install proceeds (`chat.plugins.trustedMarketplaces.v1`). - **Auto-update** — checks for upstream changes approximately every 24 hours when `extensions.autoUpdate` is enabled; sets `hasUpdatesAvailable` observable. - **GitHub caching** — caches raw GitHub API responses with an 8-hour TTL to avoid repeated fetches. ### Marketplace Definition Files Checked in order per repository: 1. `marketplace.json` → `MarketplaceType.OpenPlugin` 2. `.plugin/marketplace.json` → `MarketplaceType.OpenPlugin` 3. `.github/plugin/marketplace.json` → `MarketplaceType.Copilot` 4. `.claude-plugin/marketplace.json` → `MarketplaceType.Claude` ### IPluginInstallService Orchestrates install and update workflows: - `installPlugin()` — checks marketplace trust, delegates to the appropriate source strategy to ensure files are locally available, and registers the plugin in installed storage. - `updatePlugin()` / `updateAllPlugins()` — pulls latest changes for cloned repositories and re-runs package-manager installs where applicable. ``` -------------------------------- ### Skill File Structure Example Source: https://github.com/microsoft/vscode/blob/main/src/vs/sessions/copilot-customizations-spec.md Illustrates the directory structure for skills, including a `SKILL.md` file with YAML frontmatter or a flat `SKILL.md` in the skills directory. ```yaml .github/skills/ my-skill/ SKILL.md ← markdown with frontmatter Or a flat SKILL.md directly in the skills directory (single-skill mode). ``` -------------------------------- ### Use closures and modules Source: https://github.com/microsoft/vscode/blob/main/extensions/copilot/src/platform/parser/test/node/fixtures/test.rs.getStructure.html Demonstrates basic closure syntax and module organization. ```rust // Closure let add = |x, y| x + y; println!("Sum: {}", add(5, 5)); // Module mod utils { pub fn print_greeting() { println!("Hello, world!"); } } // Using the module utils::print_greeting(); let v = vec![1, 2, 3, 4, 5]; ``` -------------------------------- ### Install and Configure GPG Tools on macOS Source: https://github.com/microsoft/vscode/wiki/Commit-Signing Install GPG tools and configure the GPG agent for macOS. This involves installing Homebrew packages and setting up configuration files for `gpg-agent` and `bash`/`zsh`. ```bash brew install gpg2 gnupg pinentry-mac mkdir -p ~/.gnupg echo "pinentry-program $(brew --prefix)/bin/pinentry-mac" >> ~/.gnupg/gpg-agent.conf echo "use-agent" >> ~/.gnupg/gpg.conf echo 'export GPG_TTY=$(tty)' >> ~/.bash_profile # replace with ~/.zprofile if using ZSH ``` -------------------------------- ### Inspect Keybinding Dispatch Logs Source: https://github.com/microsoft/vscode/wiki/Keybinding-Issues Example output from the KeybindingService showing the detection and resolution of a keyboard shortcut. ```text [KeybindingService]: / Received keydown event - modifiers: [meta], code: MetaLeft, keyCode: 91, key: Meta [KeybindingService]: | Converted keydown event - modifiers: [meta], code: MetaLeft, keyCode: 57 ('Meta') [KeybindingService]: \ Keyboard event cannot be dispatched. [KeybindingService]: / Received keydown event - modifiers: [meta], code: Slash, keyCode: 191, key: / [KeybindingService]: | Converted keydown event - modifiers: [meta], code: Slash, keyCode: 85 ('/') [KeybindingService]: | Resolving meta+[Slash] [KeybindingService]: \ From 2 keybinding entries, matched editor.action.commentLine, when: editorTextFocus && !editorReadonly, source: built-in. ``` -------------------------------- ### Start JSON Language Server with Standard I/O Source: https://github.com/microsoft/vscode/blob/main/extensions/json-language-features/server/README.md Launches the JSON language server using standard input/output streams. This is a common method for integrating language servers with editors. ```bash vscode-json-languageserver --stdio ``` -------------------------------- ### Install electron-minidump Source: https://github.com/microsoft/vscode/wiki/Native-Crash-Issues Install the required tool globally via npm for symbolication tasks. ```bash npm install -g electron-minidump ``` -------------------------------- ### Test the new build system Source: https://github.com/microsoft/vscode/blob/main/build/next/working.md Commands to build, package, and run the server-web target to verify the resource copying fix. ```bash # Build server-web with new system npx tsx build/next/index.ts bundle --nls --target server-web --out out-vscode-reh-web-min # Package it (uses gulp task) npm run gulp vscode-reh-web-darwin-arm64-min # Run server ./vscode-server-darwin-arm64-web/bin/code-server-oss --connection-token dev-token # Open browser - should connect without "Unauthorized client refused" ``` -------------------------------- ### VS Code Commands API Examples Source: https://context7.com/microsoft/vscode/llms.txt Demonstrates registering commands with arguments and return values, executing built-in commands, and retrieving a list of all registered commands. ```typescript import * as vscode from 'vscode'; // Register a command with arguments and return value const commandDisposable = vscode.commands.registerCommand( 'myExtension.processFile', async (uri: vscode.Uri, options?: { format: boolean }) => { const document = await vscode.workspace.openTextDocument(uri); const text = document.getText(); if (options?.format) { // Format the document await vscode.commands.executeCommand('editor.action.formatDocument'); } return { lineCount: document.lineCount, size: text.length }; } ); // Execute a built-in VS Code command await vscode.commands.executeCommand('vscode.open', vscode.Uri.file('/path/to/file.ts')); // Execute command and get result const result = await vscode.commands.executeCommand< vscode.Location[] >( 'vscode.executeDefinitionProvider', document.uri, position ); // Get list of all registered commands const allCommands = await vscode.commands.getCommands(true); // true = filter internal commands ``` -------------------------------- ### Install Packaging Tools on Linux Source: https://github.com/microsoft/vscode/wiki/How-to-Contribute Install dependencies required for building deb and rpm packages. ```bash sudo apt-get install fakeroot rpm ``` -------------------------------- ### Configure and build 32-bit VS Code Source: https://github.com/microsoft/vscode/wiki/Build-and-run-32bit-Code---OSS-on-Windows Commands to prepare the environment and launch the 32-bit version of VS Code. ```powershell git clean -fdx ``` ```powershell $env:npm_config_arch = 'ia32' ``` ```powershell npm i ``` ```powershell npm run electron ia32 ``` ```powershell .\scripts\code.bat ``` -------------------------------- ### Example JSON-RPC Authentication Error Response Source: https://github.com/microsoft/vscode/blob/main/src/vs/platform/agentHost/test/auth-rework.md An example of a JSON-RPC error response containing an authentication challenge. ```json { "jsonrpc": "2.0", "id": 5, "error": { "code": -32007, "message": "Authentication required", "data": { "challenges": [ { "schemeId": "github", "error": "invalid_token", "errorDescription": "The access token expired" } ] } } } ``` -------------------------------- ### Install specific xterm beta version Source: https://github.com/microsoft/vscode/wiki/Working-with-xterm.js Install a specific beta version of xterm using yarn. ```bash yarn add xterm@x-y-z-betaX ``` -------------------------------- ### Test Plan Item with Any Platform Specification Source: https://github.com/microsoft/vscode/wiki/Writing-Test-Plan-Items This example uses 'anyOS' to indicate that the test can be run on any operating system. Multiple 'anyOS' entries are used to represent different testing environments. ```markdown Refs: - [ ] anyOS - [ ] anyOS Complexity: 4 --- ``` -------------------------------- ### Chat Setup Strategy and Result Definitions Source: https://github.com/microsoft/vscode/blob/main/extensions/copilot/src/platform/parser/test/node/fixtures/chatSetup.ts.getStructure.html Defines the strategies for chat initialization and the structure of the setup result. ```typescript enum ChatSetupStrategy { Canceled = 0, DefaultSetup = 1, SetupWithoutEnterpriseProvider = 2, SetupWithEnterpriseProvider = 3 } interface IChatSetupResult { readonly success: boolean | undefined; readonly dialogSkipped: boolean; } ``` -------------------------------- ### Clone and Setup Smoke Test Repository Source: https://github.com/microsoft/vscode/wiki/Smoke-Test Commands to initialize the express smoke test environment. ```bash git clone https://github.com/Microsoft/vscode-smoketest-express.git ``` ```bash cd vscode-smoketest-express ``` ```bash yarn ``` -------------------------------- ### Code Snippet with Object Start Source: https://github.com/microsoft/vscode/blob/main/extensions/copilot/src/lib/vscode-node/test/nesProvider.reply.txt This JSON chunk contains the start of an object literal in code, indicated by '{'. ```json data: {"choices":[{"content_filter_results":{"hate":{"filtered":false,"severity":"safe"},"self_harm":{"filtered":false,"severity":"safe"},"sexual":{"filtered":false,"severity":"safe"},"violence":{"filtered":false,"severity":"safe"}},"delta":{"content":" { "},"finish_reason":null,"index":0,"logprobs":null}],"created":1756217686,"id":"chatcmpl-C8ojeJT8SVXTy5qp7xog2lFodnxFA","model":"gpt-4o-mini-2024-07-18","object":"chat.completion.chunk","system_fingerprint":"fp_efad92c60b","usage":null} ``` -------------------------------- ### Discovery Event: Load Instructions Source: https://github.com/microsoft/vscode/blob/main/extensions/copilot/assets/prompts/skills/troubleshoot/SKILL.md Example of a 'discovery' event log entry showing the resolution of instructions. Key attributes include details about resolved items, folders, and the source. ```jsonl {"ts":1773200251309,"dur":0,"sid":"62f52dec","type":"discovery","name":"Load Instructions","spanId":"2cb1f2f4","status":"ok","attrs":{"details":"Resolved 0 instructions in 0.0ms | folders: [/c:/Users/user/.copilot/instructions, /workspace/.github/instructions]","category":"discovery","source":"core"}} ``` -------------------------------- ### Example Test Output Source: https://github.com/microsoft/vscode/blob/main/src/vs/sessions/test/e2e/README.md An example of the output generated when running tests, showing compiled scenarios and test results. ```text Found 2 compiled scenario(s) Starting sessions web server on port 9542… Server ready. ▶ Scenario: Repository picker opens when submitting without a repo ✅ step 1: Click button "Cloud" ✅ step 2: Type "build the project" in the chat input ✅ step 3: Press Enter to submit ✅ step 4: Verify the repository picker dropdown is visible ▶ Scenario: Switching to Cloud target disables the Add Run Action button ✅ step 1: Click button "Cloud" ✅ step 2: Click button "Local" Results: 6 passed, 0 failed ``` -------------------------------- ### Import Data Libraries Source: https://github.com/microsoft/vscode/blob/main/extensions/copilot/src/platform/notebook/test/node/fixtures/data_processing_before.ipynb Initializes the environment with pandas and numpy. ```python import pandas as pd import numpy as np ``` -------------------------------- ### Install Linux build dependencies Source: https://github.com/microsoft/vscode/wiki/Selfhosting-on-Windows-WSL Install the required Debian-based packages for building VS Code in a Linux environment. ```bash sudo apt install python3 python-is-python3 libsecret-1-dev libxss1 libx11-dev libxkbfile-dev libasound2 libgtk-3-0 libgdk-pixbuf2.0-0 libnss3 libxtst6 libxi6 libxdamage1 libxcursor1 libxcomposite1 libx11-xcb1 libgbm1 ```