adding-editor-classifiers

Build custom text classifiers and classification formats for Visual Studio extensions.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Visual Studio extension development often requires custom text classification to colorize code and editor content, enabling clear semantics and improved readability for users.

Core Features & Use Cases

  • Define custom classification types and formats (IClassifierProvider, ClassificationTypeDefinition, EditorFormatDefinition) to colorize tokens.
  • Support multiple Visual Studio extension models (VisualStudio.Extensibility, VSIX Community Toolkit, VSSDK) to cover in-process and out-of-process scenarios.
  • Use cases include highlighting keywords, comments, strings, and domain-specific tokens in custom languages or DSLs.

Quick Start

Export a classifier using IClassifierProvider and register MEF exports to enable syntax highlighting in editor buffers.

Frequently Asked Questions about adding-editor-classifiers

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

FAQPage Schema
How do I add custom syntax highlighting to a Visual Studio extension?

To add custom syntax highlighting in a Visual Studio extension, implement an IClassifierProvider and export MEF components for ClassificationTypeDefinition and EditorFormatDefinition to colorize editor tokens.

Does this approach to syntax highlighting work with both in-process and out-of-process VS extensions?

Yes, this custom syntax highlighting approach supports both in-process and out-of-process Visual Studio extension models, specifically covering VisualStudio.Extensibility, VSIX Community Toolkit, and VSSDK.

What MEF exports do I need to colorize custom keywords in Visual Studio?

To colorize custom keywords in Visual Studio, you need MEF exports for IClassifierProvider to define logic, ClassificationTypeDefinition for the type, and EditorFormatDefinition for the visual format.

Why are my custom classifier tokens not highlighting in the VSIX extension?

Custom classifier tokens fail to highlight when the MEF asset type is missing from the VSIX manifest, so you must ensure the manifest declares the MEF exports correctly.

Can I use this to highlight domain-specific tokens and custom language strings?

Yes, you can use custom text classification to highlight domain-specific tokens, custom language keywords, strings, and comments by defining the matching logic within the IClassifierProvider.

What is the best way to register classification formats for diagnostic highlighting in Visual Studio?

The best way to register classification formats for diagnostic highlighting in Visual Studio is by using MEF to export EditorFormatDefinition and ClassificationTypeDefinition within your extension project.