adding-codelens-indicators

Implement custom CodeLens indicators for Visual Studio extensions using IAsyncCodeLensDataPointProvider.

14|2|Updated Mar 24, 2026
One-click install
npx skills add https://github.com/madskristensen/vs-agent-plugins --skill adding-codelens-indicators
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: adding-codelens-indicators
Source: https://github.com/madskristensen/vs-agent-plugins/tree/main/skills/adding-codelens-indicators
Command: npx skills add https://github.com/madskristensen/vs-agent-plugins --skill adding-codelens-indicators

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

CodeLens indicators display inline information above code elements (classes, methods, properties) in the editor — references, tests, git history, etc. This skill helps you implement custom CodeLens providers to surface contextual data directly in code and respond to clicks.

Core Features & Use Cases

  • Create an out-of-process CodeLens data point provider implementing IAsyncCodeLensDataPointProvider
  • Develop the in-process VSIX package for navigation/commands and optionally an MEF IViewElementFactory for richer UI
  • Register via CodeLens OOP/VSIX integration and provide details pane in CodeLens use cases

Quick Start

Start by implementing an IAsyncCodeLensDataPointProvider in a class library, then expose it via a VSIX CodeLens component and handle navigation in the in-process package.

Frequently Asked Questions about adding-codelens-indicators

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I add custom CodeLens indicators in a Visual Studio extension?

To add custom CodeLens indicators in a Visual Studio extension, implement an out-of-process IAsyncCodeLensDataPointProvider in a class library and integrate it with an in-process VSIX package to surface inline metadata above code elements.

Can I show custom metadata like git history or test status above methods using CodeLens?

Yes, CodeLens indicators can display custom metadata such as git history, test status, or ownership directly above classes, methods, and properties by implementing a custom data point provider in your VSSDK extension.

Do I need an out-of-process provider to create CodeLens data points in VSIX?

Yes, creating CodeLens indicators requires implementing IAsyncCodeLensDataPointProvider and IAsyncCodeLensDataPoint in an out-of-process class library, paired with an in-process VSIX package for handling navigation and commands.

How do I handle click events on CodeLens indicators in Visual Studio?

You handle click events on CodeLens indicators by developing the in-process VSIX package component, which manages navigation and commands, optionally enhanced with an MEF IViewElementFactory for richer UI details panes.

What is the best way to customize the CodeLens UI in a Visual Studio extension?

The best way to customize the CodeLens UI is by using an optional MEF-based IViewElementFactory within your in-process VSIX package, allowing you to render richer visual elements and provide details panes for your indicators.

Does CodeLens work with both VSSDK extensions and MEF components?

Yes, CodeLens integration supports VSSDK VSIX environments by using an out-of-process provider for data points and an in-process VSIX package for commands, with optional MEF components for customized UI rendering.