Files
2026-01-21 08:28:42 -08:00

782 B

Chat Context Provider Sample

This sample shows how to provide custom context to VS Code's chat feature using the Chat Context Provider API.

The sample uses the ChatContextProvider API to implement a simple context provider that displays line count information for JSON files:

JSON line count context

The extension registers a chat context provider that:

  • Activates when JSON files are opened
  • Provides the line count of JSON files as contextual information
  • Makes this context available in VS Code's chat interface

VS Code API

ChatContextProvider API proposal

You can find details about this API proposal here.