Visual Studio Code Documentation

repository·main·Indexed 27 days ago

https://github.com/microsoft/vscode-docs

Official source content for the Visual Studio Code documentation portal. Includes guides on building extensions using the Python extension template, migrating from TSLint to ESLint, and integrating AI features via the Language Model API.

Tokens
209.2K
Snippets
420
Records
1.2K
Agent score
89%

What's inside vscode-docs

  1. Overview of Model Context Protocol (MCP) in VS Code

    main
    Model Context Protocol (MCP) is an open standard that allows AI models to interact with external tools and services via a unified interface. Visual Studio Code implements the full MCP specification, allowing developers to build MCP servers that provide tools, prompts, and resources to extend the capabilities of AI agents within the editor.
  2. Overview of the Language Model Tool API

    main

    The Language Model Tool API allows VS Code extensions to provide domain-specific capabilities to Large Language Models (LLMs) in chat. When an agent in VS Code processes a prompt, it can automatically invoke these tools to perform specialized tasks.

    Extension tools are one of three tool types available in VS Code, alongside built-in tools and MCP (Model Context Protocol) tools. Use extension tools when you need deep integration with VS Code APIs (such as the Debugger API) and want to distribute your tool via the Visual Studio Marketplace.

  3. Overview of the Webview API

    main

    The Webview API enables extensions to create fully customizable views within Visual Studio Code by rendering HTML content in an iframe-like environment. This is useful for building complex user interfaces, custom visualizations, or rendering content like Markdown previews that exceeds the capabilities of native VS Code APIs.

    Webviews are primarily used in three ways:

    1. Webview Panels: Created via window.createWebviewPanel, these appear as distinct editors in the workspace.
    2. Custom Editors: Used to provide a custom UI for editing specific file types, allowing hooks into editor events (undo/redo) and file events (save).
    3. Webview Views: Rendered within the sidebar or panel areas of the VS Code interface.
  4. Overview of the Notebook API

    main

    The Notebook API enables Visual Studio Code extensions to open files as notebooks, execute code cells, and render rich, interactive outputs. A notebook consists of Markdown cells and code cells.

    Key components include:

    • NotebookSerializer: Handles reading/writing notebook data to the file system.
    • NotebookController: Executes code cells and produces outputs.
    • NotebookRenderer: Renders application-specific or interactive outputs.
  5. Overview of Agent Customizations in Visual Studio Code

    main

    Visual Studio Code allows you to customize AI agent behavior to align with your codebase, team conventions, and workflows. You can provide context through several mechanisms:

    • Instructions: Coding standards applied automatically to every request.
    • Agent skills: Repeatable capabilities (scripts, examples, resources) loaded when a task matches.
    • Custom agents: Focused roles with specific instructions, tools, and models (e.g., a security reviewer).
    • MCP servers: Connections to external tools, databases, and services.
    • Hooks: Automated commands run at key points in the agent loop (e.g., formatting after edits).
    • Agent plugins (preview): Ready-made bundles of customizations from a marketplace.
    • Prompt files: Reusable prompts invoked via slash commands (e.g., /scaffold-component).

    Customizations can be managed via the Chat view or the Agents window.

  6. Overview of Foundry Toolkit for Visual Studio Code

    main

    Foundry Toolkit for Visual Studio Code is a development environment for building, testing, and deploying AI applications. It supports both cloud-based models (OpenAI, Anthropic, Google, GitHub) and local models (via ONNX and Ollama).

    Key capabilities include:

    • Agent Development: Create Prompt Agents with tools/vectors or Hosted Agents with custom code.
    • Model Management: Discover and compare models via the Model Catalog; convert, quantize, and optimize models for local deployment.
    • Testing & Evaluation: Use the Playground for real-time chat testing and the Model Evaluation tool to measure performance using metrics like F1 score, relevance, and coherence.
    • Debugging & Monitoring: Use Agent Inspector to visualize agents, Tracing to analyze application performance, and Profiling (Windows ML) to diagnose CPU/GPU/NPU resource usage.
    • Fine-tuning: Adapt models locally with GPU support or in the cloud via Azure Container Apps.
  7. Understand Java project modes in VS Code

    main

    VS Code supports two modes for working with Java source files:

    • Lightweight mode: Ideal for reading and writing standalone Java source files without a full project structure.
    • Standard mode: Required for working with full-scale Java projects (e.g., Maven or Gradle projects).

    You can switch from lightweight mode to standard mode when needed.

  8. Understand Visual Studio Code Dev Containers

    main

    The Visual Studio Code Dev Containers extension allows you to use a container as a full-featured development environment. By including a devcontainer.json file in your project, you can define a specific tool and runtime stack.

    Key features include:

    • Workspace Mounting: Files are mounted from the local file system, or copied/cloned into the container.
    • Remote Extensions: Extensions run inside the container, providing full access to the container's tools, platform, and file system.
    • Consistent Experience: Provides IntelliSense, code navigation, and debugging regardless of where tools or code are located.

    Supported operating models:

    • Using a container as a full-time development environment.
    • Attaching to a running container to inspect it.
  9. Understand Electron Process Sandboxing in VS Code

    main

    In VS Code, the renderer process (responsible for the UI) is sandboxed to improve security. Sandboxing prevents the renderer from using Node.js APIs directly, which limits the impact of malicious code by restricting access to system resources.

    To perform privileged operations (like file system access or updating settings) from a sandboxed renderer, the code must delegate tasks to a non-sandboxed process via asynchronous Inter-Process Communication (IPC).

  10. Understand the difference between 'Code - OSS' and 'Visual Studio Code'

    main

    It is important to distinguish between the open-source repository and the Microsoft distribution:

    • Code - OSS (github.com/microsoft/vscode): The repository where development happens. The source code is available under the MIT license.
    • Visual Studio Code: A distribution of the Code - OSS repository that includes Microsoft-specific customizations, proprietary assets (like icons), and features (such as Visual Studio Marketplace integration and Remote Development capabilities). This distribution is released under a Microsoft product license.
  11. Understand Language Server Extensions

    main

    Language Server Extensions provide an alternative to using the direct languages.* API for implementing programmatic language features. They allow you to implement features like autocomplete, diagnostics (error-checking), and jump-to-definition using the standardized Language Server Protocol (LSP).

    Key Benefits:

    • Language Agnostic: Servers can be implemented in their native programming languages rather than being restricted to the VS Code Node.js runtime.
    • Performance: Servers run in their own process, preventing resource-intensive operations (like parsing large files or building Abstract Syntax Trees) from affecting VS Code's performance.
    • Interoperability: By using LSP, a single language server can work across multiple LSP-compliant editors, and editors can support multiple LSP-compliant tools without custom integration for each.
  12. Marketplace access and security for VS Code products

    main

    The Visual Studio Marketplace is restricted to the Visual Studio family of products to ensure security and quality. Key protections include:

    • Vetting: The Marketplace vets extensions to prevent malicious activity.
    • Automated Removal: If a malicious extension or vulnerability is verified, it is removed from the Marketplace, added to a block list, and automatically uninstalled by VS Code.
    • API Compatibility: The Marketplace ensures extensions use the product's extensions APIs correctly to maintain compatibility across version updates.
    • Security Scanning: The Marketplace employs malware scanning, dynamic detection, and publisher verification.