Lexicon

A Semantic Syntax Theme System

A color vocabulary for code.

Currently for C# in Visual Studio with Codist. More to come.

You already know the difference between a class and a struct. Between an if statement and a method call. Between a constant and a variable. Lexicon makes your editor know it too. Every color carries meaning. Purple is always a reference type. Blue is always a value type. Orange is always a decision point. Once you learn the vocabulary, any C# codebase using Lexicon becomes easier to read—not because the code changed, but because you can see its structure at a glance.

Lexicon at a glance
❖ Semantic syntax theme system for C# in Visual Studio 2026.
☰ 11 semantic categories: types, data, control flow, exceptions, and more.
◎ Designed to support code review, debugging, and onboarding.
◑ 10 coordinated dark themes sharing the same semantic vocabulary.
★ Start with Twilight; use Beacon for high contrast.

Theme Preview

This code sample demonstrates the Lexicon semantic syntax system. Use the theme selector to compare how each palette renders the same code.

using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;

namespace Lexicon.Demo;

// Interface: cyan + italic (behavioral contract)
public interface IDocumentProcessor
{
    // Property: light blue (encapsulated access)
    int ProcessedCount { get; }
    
    // Callable: yellow (executable behavior)
    Task<ProcessingResult> ProcessAsync(IEnumerable<Document> documents);
}

See the full sample in Complete Example and the palette in Lexicon Twilight below.

1. Problems and Goals

Lexicon addresses specific pain points that developers encounter when reading and reviewing code. Traditional syntax highlighting colors code by grammatical category: keywords in one color, strings in another, comments in gray. While this provides basic visual structure, it fails to surface semantic distinctions that matter for comprehension and debugging.

Problems with Traditional Syntax Highlighting

Semantic blindness. A traditional theme might color DateTime and Exception identically because both are type names. But DateTime is a value type (stack-allocated, copy semantics) while Exception is a reference type (heap-allocated, polymorphic). This distinction affects memory management, equality behavior, and API design—information worth surfacing visually, especially when debugging mutation or aliasing bugs.

Control flow invisibility. When tracing execution paths, developers need to identify decision points (if, switch) and iteration (for, while). Traditional themes color these the same as class and public—all "keywords." This forces cognitive search for the specific keywords that affect execution flow.

Exception boundary opacity. Exception handling constructs (try, catch, throw) define critical error boundaries. Traditional highlighting provides no visual distinction between these and other keywords, making it harder to quickly assess error handling coverage during code review.

Closure hazards hidden. Variables captured by lambdas or local functions have different lifetime and mutation semantics than ordinary locals. This is a common source of bugs (the classic loop-variable-capture issue), yet traditional highlighting provides no visual indication that a variable is captured.

Design Goals

Lexicon aims to:

2. Scope and Audience

Current Implementation

Lexicon is currently implemented for C# development in Visual Studio 2026 using the Codist extension. The system depends on Codist's extended semantic classification capabilities, which go beyond Visual Studio's built-in Roslyn classifications. Without Codist, Lexicon's full semantic vocabulary cannot be rendered.

The scope is deliberately focused: one language, one IDE, one extension. The design aspiration is that the semantic vocabulary could eventually extend to other languages and editors, but this would require adaptation work. For now, Lexicon is where C# lives.

Target Users

Lexicon is designed for developers who already understand C# syntax and semantics. It surfaces semantic distinctions rather than teaching language fundamentals. Three primary user populations and their tasks inform the design:

User Population Primary Tasks Lexicon Value
Senior developers and architects Code review, architecture assessment, API design review Rapid pattern recognition: quickly identify type relationships, control flow complexity, and abstraction boundaries
Developers during debugging Investigating bugs, tracing execution paths, understanding exception handling Relevant information surfacing: captured variables, value vs reference semantics, exception boundaries visible at a glance
Developers onboarding to new codebases Building mental models, understanding architectural patterns Structural scaffolding: consistent semantic coloring helps identify patterns even before understanding specific logic

3. Design Philosophy

Traditional syntax highlighting answers the question "What grammatical category is this token?" Lexicon answers a different question: "What role does this code element play in program execution?"

When you see a block of code styled with Lexicon, you don't parse tokens—you see patterns of meaning. Purple clusters indicate reference types. Cyan italic marks abstraction boundaries. Orange bold signals execution flow decisions.

Core Principle: Every color choice answers the question "What does this code element do?" rather than "What grammatical category is this?"

Semantic vs. Grammatical Highlighting

Approach Classification Basis Example Distinctions
Traditional (grammatical) Token type from parser keyword, identifier, string, number, comment
Visual Studio semantic Roslyn semantic model class name, struct name, interface name, method name, property name
Lexicon semantic Developer mental model + Codist reference type, value type, interface (italic), callable, data, data+bold (const/readonly), control flow (bold), exception, captured variable (background), obsolete (strikethrough)

The key difference is not just what is distinguished, but why. Lexicon's categories are chosen to support specific developer tasks—debugging, code review, onboarding—not to mirror compiler internals.

4. Theme Collection

All Lexicon themes share the same semantic mappings and decorations. What varies is the palette—the specific colors assigned to each category—and the emotional feel. Themes are different aesthetic schemes over the same vocabulary. Choose based on your environment, your vision, or simply what feels right.

Theme Saturation / Intensity Accessibility Focus Vibe
Twilight Medium Balanced contrast, general use Evening sky, "magic hour" coding
Glacier Low–medium Gentler contrast, cooler palette Arctic calm, reduced visual intensity
Ember Medium–high Warm bias, focused contrast Late-night warmth and creative energy
Canopy Medium Green-centric, rich hue variety Forest canopy, organic feel
Neon High Maximal category separation Electric city, high-energy sessions
Solstice Medium Solarized-inspired balance Calibrated, analytical, precise
Whisper Low Reduced visual demand Soft, library-quiet coding
Nocturne High Strong contrast on true dark Jewel tones on deep night
Patina Low–medium Warm, sepia-toned comfort Aged copper, archival feel
Beacon Very high Accessibility-first, maximum separation Signal over style, functional clarity

Lexicon Twilight

The space between day and night, when colors are most alive.

Twilight is the flagship theme—the reference implementation that this document demonstrates. Named for that liminal hour when the sun has set but darkness hasn't arrived, when the sky holds impossible colors: deep blues, soft purples, warm golds against the fading light. There's a reason photographers call it the "magic hour."

The palette balances cool and warm. Purple types against yellow methods. Cyan structure against orange decisions. The dark background (#0d1117) provides depth without harshness—like looking at the sky just after sunset. This is a theme for long sessions: high enough contrast to read easily, soft enough to work in for hours. The trade-off is that some category pairs (purple/blue) require attention to distinguish; users who need maximum distinctness should consider Beacon or Neon.

The complete code sample in Complete Example uses this Twilight palette.

SemanticColorHex
Reference TypesSoft Purple#bb9af7
Value TypesSky Blue#7aa2f7
InterfacesCyan#7dcfff
CallablesPale Yellow#dcdcaa
DataLight Blue#9cdcfe
Control FlowOrange#ff9e64
ExceptionsCoral#f7768e
String LiteralsGreen#9ece6a
Literal ValuesAmber#e0af68
NamespacesTeal#4ec9b0
KeywordsViolet#9d7cd8

Lexicon Glacier

Cool, crystalline, calm. Ice fields under a pale sky.

Glacier draws from arctic landscapes: the blue-white of ancient ice, the pale violet of polar twilight, the surprising warmth of coral sunset reflected on snow. This is a reduced-saturation palette that maintains category differentiation while minimizing visual intensity.

For developers who find vivid colors fatiguing, or who work in bright environments where high contrast becomes harsh, Glacier offers relief. The colors are all shifted cooler—even the "warm" accents like orange control flow and coral exceptions carry blue undertones. The semantic vocabulary remains intact; everything just feels calmer, more contemplative. The trade-off: in very dark environments, the low saturation may reduce category distinctness. Like the landscape that inspired it, Glacier is focused and a bit severe.

SemanticColorHex
Reference TypesPale Lavender#b4a7d6
Value TypesIce Blue#7eb8da
InterfacesGlacier Cyan#6dd3d6
CallablesPale Gold#d4c896
DataFrost Blue#a8d4e6
Control FlowArctic Sunset#e6a07c
ExceptionsPolar Rose#e07c7c
String LiteralsLichen Green#7ec8a3
Literal ValuesSand#d4b896
NamespacesGlacial Teal#5eb8b0
KeywordsFrost Violet#a090c8

Lexicon Ember

Warm coals in darkness. Comfort and intensity.

Ember inverts the usual temperature balance. Where most dark themes lean cool, Ember runs warm—the palette of dying coals, of candlelight, of autumn leaves against dark earth. This is a theme that feels alive, that radiates warmth from the screen.

Reference types become rose and coral. Data shifts to sand and copper. Even value types carry amber undertones. The sage green of string literals provides just enough cool contrast to keep the warmth from becoming oppressive. Ember is a theme for late nights and creative work, when the code is flowing and you want the environment to feel alive. The trade-off: the warm bias reduces blue-green distinctness, which may make some category pairs harder to separate at a glance.

SemanticColorHex
Reference TypesRose#e8a4b8
Value TypesCopper#d4a076
InterfacesTerra Cotta#d08070
CallablesAmber#e6c87c
DataSand#d4b896
Control FlowFlame#e88050
ExceptionsEmber Red#d05050
String LiteralsSage#a0b890
Literal ValuesHoney#c8a060
NamespacesDriftwood#b09878
KeywordsDusty Rose#c8a0a0

Lexicon Canopy

Dappled light through leaves. The forest floor at midday.

Canopy is built around green—the color we see more shades of than any other, the color of life and growth. Where other themes use green sparingly, Canopy lets it dominate. Data becomes moss. Value types become fern. String literals become spring leaves.

This isn't a gimmick. Green is the color human eyes are most sensitive to; we can distinguish more variations of green than any other hue. Canopy exploits this by using green for frequently-viewed categories. The result is a surprisingly readable palette that feels organic rather than synthetic. Purple reference types and orange control flow provide the contrast points, standing out against the verdant baseline like flowers in a meadow. The trade-off: users with red-green color vision deficiency may find this theme particularly challenging.

SemanticColorHex
Reference TypesOrchid#c9a0dc
Value TypesFern#70a860
InterfacesEucalyptus#60b8a8
CallablesChartreuse#b8c878
DataMoss#8cb870
Control FlowTiger Lily#d89050
ExceptionsWild Rose#d06070
String LiteralsSpring Green#90d890
Literal ValuesFern#70a860
NamespacesPine#50a888
KeywordsWisteria#a890b8

Lexicon Neon

Electric signs on wet pavement. The city never sleeps.

Neon is unapologetically vivid. High saturation, maximum luminance, the palette of a cyberpunk future or a Tokyo side street at midnight. Where Twilight and Glacier exercise restraint, Neon turns everything up to eleven.

This isn't for everyone, but for developers who find muted themes dull, who want their editor to crackle with energy, Neon delivers. The colors are carefully balanced—the full spectrum is represented, so even at high saturation, purple reference types are clearly distinct from cyan value types, and orange control flow pops against electric green strings. The trade-off: high saturation may cause eye strain during extended sessions. Think of it as the difference between a jazz trio and a full orchestra. Both have their place.

SemanticColorHex
Reference TypesElectric Purple#a855f7
Value TypesNeon Cyan#22d3ee
InterfacesTeal Glow#2dd4bf
CallablesLaser Yellow#facc15
DataPlasma Blue#38bdf8
Control FlowSignal Orange#fb923c
ExceptionsAlarm Red#f87171
String LiteralsElectric Lime#a3e635
Literal ValuesNeon Cyan#22d3ee
NamespacesRadioactive Teal#14b8a6
KeywordsUltraviolet#c084fc

Lexicon Solstice

Precision optics. Calibrated for the human eye.

Solstice adapts Ethan Schoonover's celebrated Solarized palette to Lexicon's semantic system. Solarized was engineered with scientific precision: CIELAB lightness values calculated to maintain consistent contrast across both light and dark modes, hues selected for maximum differentiation while remaining perceptually uniform.

Where Solarized treats all code uniformly, Solstice adds semantic meaning. Reference types get violet. Callables get yellow. Data gets the base gray. The careful calibration remains—every color still has the same perceptual lightness—but now the colors carry meaning. The trade-off: Solarized's uniform lightness can make some adjacent categories harder to distinguish without relying on hue. It's Solarized with a vocabulary.

SemanticColorHex
Reference TypesViolet#6c71c4
Value TypesBlue#268bd2
InterfacesCyan#2aa198
CallablesYellow#b58900
DataBase 0#839496
Control FlowOrange#cb4b16
ExceptionsRed#dc322f
String LiteralsGreen#859900
Literal ValuesBlue#268bd2
NamespacesCyan#2aa198
KeywordsMagenta#d33682

Lexicon Whisper

Soft focus. Colors that don't shout.

Whisper is for developers who want syntax highlighting to guide, not dominate. Every color is desaturated, softened, pulled back toward gray. The result is a palette that still differentiates—purple is still visually distinct from yellow—but doesn't demand attention.

This theme works well for mixed work: writing prose interspersed with code, reviewing documentation, or any context where the code isn't the sole focus. It's also effective in very dark environments where even moderate saturation can feel harsh. Control flow becomes a gentle suggestion rather than a demand. Exceptions are noted, not alarmed about. The trade-off: the muted palette may reduce distinctness for users who benefit from high-contrast differentiation. Think of it as code in a library voice.

SemanticColorHex
Reference TypesMuted Lavender#c9b8dc
Value TypesSoft Aqua#a8d4d8
InterfacesPale Teal#a0d8d0
CallablesCream#dcd8b0
DataPale Blue#b0d0dc
Control FlowSoft Peach#dcbca8
ExceptionsBlush#dcb0b0
String LiteralsPale Mint#b0dcb8
Literal ValuesSoft Aqua#a8d4d8
NamespacesSage#98c8c0
KeywordsHaze#b8a8c8

Lexicon Nocturne

Deep night. Jewel tones against void.

Nocturne adapts the beloved Dracula palette to Lexicon's semantic system. Pure dark with jewel-tone accents—perfect for OLED displays where true blacks save battery and maximize contrast, and for developers who work best in maximum dark adaptation.

The colors pop against the void like stars against the night sky. Purple reference types glow with amethyst intensity. Yellow callables catch the eye like distant lights. Orange control flow marks decision points with warm certainty. The semantic vocabulary is fully preserved; what changes is the drama. The trade-off: the high contrast and vivid colors may cause fatigue during very long sessions. This is code that feels like an occasion.

SemanticColorHex
Reference TypesAmethyst#bd93f9
Value TypesIce#8be9fd
InterfacesEmerald#50fa7b
CallablesCanary#f1fa8c
DataAquamarine#9aedfe
Control FlowTopaz#ffb86c
ExceptionsRuby#ff5555
String LiteralsEmerald#50fa7b
Literal ValuesIce#8be9fd
NamespacesEmerald#50fa7b
KeywordsPink Sapphire#ff79c6

Lexicon Patina

Aged copper and old paper. Time-worn elegance.

Patina draws from the colors of age: oxidized bronze, yellowed paper, faded ink, weathered wood. It's a warm, desaturated palette with an antique quality—code that looks like it was written in a library from another century.

The sepia-shifted colors reduce blue light, making Patina easier on the eyes during long evening sessions. The low saturation keeps the warmth from becoming overwhelming. Reference types take on a dusty rose. Control flow becomes warm copper. String literals fade to sage. The trade-off: the muted, warm-shifted palette may reduce distinctness between some category pairs for users who need high contrast. It's sophisticated, understated, perhaps a bit melancholy. For developers who find modern vibrant themes too aggressive, Patina offers refuge.

SemanticColorHex
Reference TypesDusty Rose#b89898
Value TypesParchment#c0b090
InterfacesVerdigris#a0b098
CallablesOld Gold#d4c8a0
DataLinen#c8c0a8
Control FlowCopper#c89870
ExceptionsRust#c07060
String LiteralsFaded Sage#98a880
Literal ValuesParchment#c0b090
NamespacesLichen#90a090
KeywordsMauve#a89898

Lexicon Beacon

Maximum signal. Designed for accessibility.

Beacon is designed for maximum visibility. Every color is at high saturation and near-maximum brightness. The palette may look garish in screenshots, but serves a specific purpose: accessibility for users with low vision or in challenging display conditions.

The colors are chosen to be maximally distinguishable across common forms of color vision deficiency. Red exceptions and green strings are both present but separated by significant lightness differences. Cyan and yellow provide primary differentiation for deuteranopia and protanopia. Strong lightness separation ensures elements stand out even when hue perception is impaired. The trade-off: Beacon will cause visual fatigue for users without vision impairments; it is designed as an accessibility accommodation, not a general-purpose theme.

See Accessibility Considerations for more detail on contrast and color vision assumptions behind this theme.

SemanticColorHex
Reference TypesMagenta#ff00ff
Value TypesDodger Blue#1e90ff
InterfacesSpring Green#00ff7f
CallablesYellow#ffff00
DataCyan#00ffff
Control FlowOrange#ffa500
ExceptionsRed#ff4444
String LiteralsChartreuse#7fff00
Literal ValuesDodger Blue#1e90ff
NamespacesDark Turquoise#00ced1
KeywordsOrchid#da70d6

5. Research Foundations

This section reviews research that informed Lexicon's design. These studies provide theoretical grounding and design principles for the semantic approach. See Section 12 for validation status.

Program Comprehension and Visual Cues

In 1988, Ronald Baecker demonstrated that visual enhancements could improve program comprehension. His study found that improved layout—combining typography, indentation, and color—increased correct answers by 11% and improved readability by 25%.[1] These improvements came from combined visual enhancements, providing evidence that thoughtful visual design aids code reading.

A 2015 eye-tracking study by Advait Sarkar found that developers reading highlighted code exhibited lower cognitive load indicators than those reading plain text.[2] The benefit became weaker with increased programming experience, suggesting that highlighting may provide greatest benefit during onboarding to unfamiliar codebases—one of Lexicon's explicit design goals.

The most important finding for semantic highlighting comes from Gilmore and Green's work on "programming plans."[3] Their study found that visual cues only helped when they matched the task at hand. Participants found surface bugs faster with control-structure highlighting, but deep bugs faster with cognitive-plan coloring. This insight drives Lexicon's category selection: categories are chosen to align with tasks developers actually perform.

Color Psychology

Elliot and Maier's Color-in-Context Theory[4] establishes that color carries psychological meaning and influences cognitive processing, often without conscious awareness. Lexicon uses this as a design heuristic: warm colors (orange) for attention-demanding constructs like control flow, cool colors (blue, purple) for structural elements, desaturated red (coral) for exceptions to distinguish from IDE error markers.

Color has meaning, and this has a direct and automatic influence on cognitive processes, including attention.
— Elliot & Maier, Color-in-Context Theory

Category Count

George Miller's (1956) "seven plus or minus two" finding[5] concerns serial recall of arbitrary items in short-term memory—not visual categorization. Research on visual search suggests that practiced users can distinguish many more than seven categories when the categories are meaningful and consistent. Lexicon's eleven semantic categories cluster into related groups (types, data, flow) that map to distinctions developers already make. With use, the vocabulary becomes intuitive.

6. The Semantic Map

The semantic map defines eleven categories of code elements, each assigned a consistent color role across all theme variations. This mapping reflects how developers conceptualize code architecture during debugging and review tasks.

Category Semantic Role C# Examples Color Family
Reference Types Heap-allocated, polymorphic types Classes, records, delegates, string Purple
Value Types Stack-allocated, copy-semantic types Structs, enums, int, DateTime Blue
Interfaces Behavioral contracts, abstraction boundaries IDisposable, IEnumerable<T> Cyan + Italic
Callables Executable behavior Methods, constructors, local functions Yellow
Data Named storage locations Fields, properties, parameters, locals; const and readonly use bold Light Blue (bold for immutable)
Control Flow Execution path decisions and iteration if, else, switch, for, foreach, while Orange + Bold
Exceptions Error handling boundaries try, catch, throw, finally, when* Coral
String Literals Text data, often user-facing content "text", $"interpolated", @"verbatim" Green
Literal Values Primitive literal values and enum members 42, 3.14, true, false, null, enum members Amber (bold for enum members)
Namespaces Organizational scope Namespace identifiers Teal
Keywords Language reserved words (non-control-flow) class, public, async, var Soft Purple

* The when keyword is only styled as an exception keyword when it appears in a catch clause filter (e.g., catch (Exception ex) when (...)). In pattern matching contexts such as switch expressions, when is styled as a regular keyword since it serves control flow rather than exception handling.

6.1 Category Rationale

Following Gilmore and Green's finding that visual cues help only when matched to task, each category was selected based on specific developer tasks where the distinction provides value.

Reference Types vs. Value Types

The distinction between reference types (purple) and value types (blue) is fundamental to C# programming and directly affects debugging. When a List<Order> is passed to a method, modifications affect the original—the caller and callee share the same object. When a DateTime is passed, the method receives a copy. Mutation bugs, aliasing issues, and null reference exceptions all trace back to this distinction. Making it visible accelerates root cause analysis.

Task alignment: Debugging mutation/aliasing bugs, understanding equality semantics, API design review.

Interfaces

Interfaces (cyan italic) mark abstraction boundaries—behavioral contracts that define how components interact. The italic styling reinforces that interfaces represent indirection: what you see in the code (the interface type) might not be what runs (the concrete implementation). During code review, cyan italic clusters indicate areas where behavior varies at runtime.

Task alignment: Architecture review, dependency analysis, understanding testability and mock boundaries.

Callables

Callables (yellow) represent executable behavior—methods, constructors, local functions. Yellow is used because callables are action points: locations where execution transfers, where side effects occur, where work happens. In a sea of data and types, yellow marks the verbs.

Task alignment: Understanding execution flow, identifying side effects, performance analysis.

Data

Data (light blue) encompasses all named storage: fields, properties, parameters, and locals. These are unified because from a reading perspective, they all represent "a place where a value lives." The naming convention (_field vs local) already distinguishes scope; color distinguishes the semantic category "storage" from "type" and "action."

Const fields and readonly fields share the Data color but use bold styling to signal immutability. This keeps them visually connected to other data (they're still storage locations) while clearly marking that their values cannot change. During debugging, bold data members are safe harbors—they're not the source of unexpected state changes.

Task alignment: Understanding data flow, tracking state changes, identifying unused variables, magic number auditing.

Control Flow

Control flow (orange, bold) unifies all execution-path keywords: conditionals (if, switch), loops (for, while, foreach), and jumps (break, continue, return). Traditional highlighting scatters these among generic "keywords." Lexicon makes decision points visible at a glance.

Task alignment: Tracing execution paths, understanding branching complexity, debugging state-dependent behavior.

Exceptions

Exception handling (coral) marks error boundaries: try, catch, throw, finally, and the when filter in catch clauses. Note that when in pattern matching contexts (switch expressions) remains a regular keyword, as it serves control flow rather than exception handling. Coral is used rather than bright red to distinguish from IDE error squiggles—exception handling is intentional error management, not an error. During code review, coral blocks show where errors are expected and handled.

Task alignment: Reviewing error handling coverage, understanding failure modes, ensuring cleanup code runs.

String Literals vs. Literal Values

String literals (green) and literal values (amber) are separated because they require different developer attention. Strings often need localization review, format verification, or resource management consideration. Literal values—numbers, boolean literals, null, and enum members—often need magic-constant auditing or constant extraction. Keeping them visually distinct supports targeted review tasks.

The Literal Values category includes true, false, null, and enum members because these share the semantic character of numeric literals: they are raw, literal values written directly in code rather than computed or referenced from storage. Enum members like ProcessingStatus.Success are conceptually the same as writing a numeric constant—they're named literal values. The bold styling on enum members signals their fixed nature while the amber color groups them with other literals.

Task alignment: Localization review (strings), magic-constant audit (literal values), identifying hardcoded values.

Namespaces and Keywords

Namespaces (teal) provide organizational context. Keywords (soft purple) cover language reserved words that don't fit other categories—structural keywords like class, public, and async. These form the grammatical backbone of the code without demanding special attention.

Palette Construction Rule: All Lexicon themes must maintain perceptual distinctness between string literals and literal values. These categories serve different review tasks and must not share colors.

For a compact reminder of these eleven categories, see Quick Reference below.

7. Decorations and Visual Hierarchy

Visual hierarchy research is clear: every element competes for attention. When everything is bold, nothing is bold. Codist offers dozens of styling options, but Lexicon uses only six, each passing a simple test: does this tell me something color alone cannot?

ProcessAsync Italic — Indirection. Interfaces, virtual/override methods, extension methods. What you see might not be what runs.
MaxRetries Bold — Immutability. Const fields, enum members. Value is fixed.
threshold Background Tint — Captured by closure. Variables captured by lambdas. Closure warning.
OldMethod Strikethrough — Deprecated. Members marked with [Obsolete]. Don't use this.
unused code Dimmed — Unnecessary/unused. Redundant code, unused usings. Fade what doesn't matter.
[Serializable] Smaller — Metadata. Attributes that don't affect logic. Metadata recedes.

7.1 Decoration Precedence

When multiple decorations could apply to a single token, Lexicon follows a defined precedence hierarchy:

Priority Decoration Semantic Rationale
1 (Highest) Strikethrough + Dimmed Obsolete/Deprecated Deprecation is a critical warning that overrides all other styling
2 Background Tint Captured Variable Closure capture is a common bug source; must remain visible
3 Bold Constant/Static Immutability is important but not an error condition
4 Italic Interface/Virtual/Extension Indirection matters but is less urgent than capture/deprecation
5 Dimmed Unused Low priority; unused obsolete code shows strikethrough, not dimming
6 (Lowest) Smaller Attributes Metadata styling has lowest priority

Combination rules: Background tint combines with bold and italic (a captured constant shows both bold and background tint). Strikethrough overrides dimming. When a token is both obsolete and captured, strikethrough takes precedence but the background tint is preserved if technically possible.

Interpretation Notes

Bold = Immutability, not emphasis. In typical text, bold means "important." In Lexicon, bold means "fixed at compile time." This is a learned convention.

Italic = Indirection, not emphasis. Italic marks elements where the actual behavior may differ from what the source code shows (interfaces, virtual methods, extension methods).

Coral ≠ Error. Exception handling uses coral (desaturated red) deliberately to distinguish from IDE error markers (bright red). This avoids alarm fatigue in codebases with extensive exception handling.

8. Implementation

Lexicon is implemented for Visual Studio 2026 with the Codist extension. This section explains requirements and capabilities.

Why Codist Is Required

Visual Studio provides semantic tokens through its Roslyn-based classification system, but Lexicon requires capabilities that Codist adds:

Classification Gaps

Even with Codist, some desired classifications are not available:

Desired Classification Status Workaround
Async methods Not available Naming convention (*Async)
Pure vs. impure methods Not available None
Nullable reference types Partial IDE warnings

Installation

1. Install the Codist extension from the Visual Studio Marketplace.

2. Open Codist settings (Tools → Codist → Options).

3. Import the desired Lexicon theme file (JSON).

Getting Started with Lexicon

To experience Lexicon effectively on first use, follow this simple path:

9. Quick Reference

A handy reminder for the eleven semantic categories:

🟣
Reference Types
Classes, records, delegatesThink: "Heap, aliased"
🔵
Value Types
Structs, enums, primitivesThink: "Stack, copied"
🩵
Interfaces
IDisposable, IEnumerableThink: "Contract"
🟡
Callables
Methods, constructorsThink: "Execute"
💠
Data
Fields, props, params, locals; bold = const/readonlyThink: "Storage"
🟠
Control Flow
if, else, for, while, switchThink: "Decision point"
🔴
Exceptions
try, catch, throw, finallyThink: "Handle with care"
🟢
String Literals
"text", $"interpolated"Think: "User-facing text"
🟤
Literal Values
42, true, null, enum membersThink: "Raw values"
🩶
Namespaces
Namespace identifiersThink: "Organization"
💜
Keywords
class, public, async, varThink: "Language"

10. Complete Example

This code sample demonstrates the Lexicon semantic syntax system with all major semantic categories and decorations:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;

namespace Lexicon.Demo;

// Interface: cyan + italic (behavioral contract)
public interface IDocumentProcessor
{
    // Property: light blue (encapsulated access)
    int ProcessedCount { get; }
    
    // Callable: yellow (executable behavior)
    Task<ProcessingResult> ProcessAsync(IEnumerable<Document> documents);
}

// Reference type: purple (heap-allocated, polymorphic)
[ServiceLifetime(ServiceLifetime.Scoped)]
public class DocumentProcessor : IDocumentProcessor, IDisposable
{
    // # Constants (data + bold)
    private const int MaxRetries = 3;
    private const string DefaultName = "Untitled";
    
    // # Fields
    private readonly ILogger _logger;
    private bool _isDisposed;
    
    // Property: light blue
    public int ProcessedCount { get; private set; }
    
    public DocumentProcessor(ILogger logger)
    {
        _logger = logger ?? throw new ArgumentNullException(nameof(logger));
    }
    
    public async Task<ProcessingResult> ProcessAsync(IEnumerable<Document> documents)
    {
        var results = new List<DocumentResult>();
        var retryCount = 0;
        
        // Control flow: orange + bold (execution path decisions)
        foreach (var document in documents)
        {
            try
            {
                // Captured variable: background tint (closure warning)
                var result = await RetryAsync(async () =>
                {
                    retryCount++;  // CAPTURED by lambda
                    return await ProcessSingleAsync(document);
                }, MaxRetries);
                
                results.Add(result);
                ProcessedCount++;
            }
            catch (ProcessingException ex) when (ex.IsRetryable)
            {
                _logger.LogWarning($"Retryable: {ex.Message}");
            }
            catch (Exception ex)
            {
                _logger.LogError(ex, "Processing failed");
                throw;
            }
        }
        
        // Switch expression with pattern matching
        var status = results.Count switch
        {
            0 => ProcessingStatus.NoDocuments,
            _ when results.All(r => r.Success) => ProcessingStatus.AllSucceeded,
            _ => ProcessingStatus.PartialSuccess
        };
        
        return new ProcessingResult(results, status);
    }
    
    // Obsolete method: strikethrough decoration
    [Obsolete("Use ProcessAsync instead")]
    public void Process(Document doc) => throw new NotSupportedException();
}

// Value type (struct): blue
public readonly struct ProcessingResult
{
    public IReadOnlyList<DocumentResult> Results { get; }
    public ProcessingStatus Status { get; }
}

// Enum: blue (value type), members are literal values (amber + bold)
public enum ProcessingStatus
{
    NoDocuments,
    AllSucceeded,
    PartialSuccess,
    AllFailed
}

11. Accessibility Considerations

Lexicon addresses accessibility through a dedicated high-contrast theme (Beacon), careful contrast consideration in the flagship theme (Twilight), and documented limitations. This section presents calculated accessibility data and acknowledges testing gaps.

11.1 WCAG Contrast Ratios

The Web Content Accessibility Guidelines (WCAG) 2.1 specify minimum contrast ratios: Level AA requires 4.5:1 for normal text; Level AAA requires 7:1.[6] The following table presents calculated contrast ratios for Lexicon Twilight against background #0d1117. These are computed values using the WCAG relative luminance formula; actual display contrast varies with monitor calibration, ambient lighting, and individual vision.

Category Hex Contrast Ratio WCAG Level
Reference Types #bb9af7 8.1:1 AAA ✓
Value Types #7aa2f7 6.8:1 AA ✓
Interfaces #7dcfff 9.3:1 AAA ✓
Callables #dcdcaa 11.3:1 AAA ✓
Data #9cdcfe 10.1:1 AAA ✓
Control Flow #ff9e64 7.6:1 AAA ✓
Exceptions #f7768e 7.0:1 AAA ✓
String Literals #9ece6a 8.2:1 AAA ✓
Literal Values #e0af68 9.5:1 AAA ✓
Namespaces #4ec9b0 8.4:1 AAA ✓
Keywords #9d7cd8 6.0:1 AA ✓

All Twilight colors meet WCAG 2.1 Level AA requirements (4.5:1 minimum). Nine of eleven categories meet Level AAA (7:1). The two categories meeting only AA (Value Types at 6.8:1 and Keywords at 6.0:1) remain well above the minimum threshold.

11.2 Color Vision Deficiency

Approximately 8% of males and 0.5% of females have some form of color vision deficiency (CVD). Lexicon's palette presents potential challenges:

Deuteranopia/Protanopia (red-green, most common): Orange (control flow) and green (string literals) may be difficult to distinguish. The design partially mitigates this by using bold weight on control flow, providing a non-color differentiation cue. However, simulation testing has not been performed.

Tritanopia (blue-yellow): Purple (reference types) and blue (value types) may be difficult to distinguish. This affects a core semantic distinction. Users with tritanopia should consider the Beacon theme, which maximizes lightness separation between all hues.

Recommendation: Users with color vision deficiency should evaluate themes using CVD simulation tools (such as Color Oracle, Coblis, or browser DevTools simulators) before adoption.

11.3 Italic Readability

Some developers, including those with dyslexia or certain visual processing differences, may find italic text harder to read. Interfaces and virtual methods use italic styling; this is a trade-off between semantic meaning and readability.

Users who find italics hard to read can adjust Lexicon themes by using a variant with italics removed or by overriding font style for interfaces and virtual methods in Codist's classification settings.

11.4 High Saturation

The Neon and Beacon themes use high-saturation colors that may cause visual fatigue for some users. The Whisper, Glacier, and Patina themes offer lower-saturation alternatives.

12. Limitations and Validation Status

Lexicon's design is informed by research on program comprehension, syntax highlighting, and color psychology—but Lexicon itself has not been empirically validated. This section consolidates the key limitations and validation gaps.

Research Status

Research-informed, not empirically validated. The studies cited in this document provide theoretical grounding and design principles; they do not validate that Lexicon's specific implementation produces the intended benefits.

Design hypotheses, not measured outcomes. Any benefits for comprehension speed, error detection rate, or cognitive load reduction are design hypotheses based on the research literature. Formal user studies would be needed to measure whether Lexicon actually delivers these benefits in practice.

Calculated accessibility values. The WCAG contrast ratios presented in Section 11 are calculated using standard formulas, not measured on actual hardware under controlled display conditions. Real-world contrast depends on monitor calibration, ambient lighting, and display technology.

No formal user studies. No controlled experiments have been conducted on Lexicon specifically. The design is informed by prior research on syntax highlighting and program comprehension, but has not been independently validated.

Known Limitations

Single language: Lexicon currently supports only C#. The semantic vocabulary is designed with C#'s type system in mind.

Extension dependency: Codist is required for full functionality. Some semantic distinctions (captured variables, control flow separation) cannot be rendered without it.

Color reliance: Lexicon relies heavily on color to convey meaning. Developers with certain forms of color vision deficiency may find some distinctions difficult to perceive, even with the Beacon theme.

13. Future Directions

User Studies

Controlled comparison of task performance between Lexicon and traditional highlighting would help validate (or refute) the design hypotheses. Useful metrics would include comprehension speed, bug detection rate, and subjective cognitive load ratings.

Accessibility Validation

Laboratory measurement of contrast ratios on calibrated displays, CVD simulation testing, and usability testing with accessibility-needs populations would strengthen the accessibility claims.

Editor and Language Expansion

Expanding to other editors (particularly VS Code) and other languages with similar type systems would allow the semantic vocabulary to benefit a wider range of developers.

References

[1] Baecker, R. M. (1988). "Enhancing program readability and comprehensibility with tools for program visualization." Proceedings of the 10th International Conference on Software Engineering (ICSE '88), pp. 356-366. IEEE Computer Society Press. ^
[2] Sarkar, A. (2015). "The impact of syntax colouring on program comprehension." Proceedings of the 26th Annual Conference of the Psychology of Programming Interest Group (PPIG 2015), pp. 49-58. ^
[3] Gilmore, D. J., & Green, T. R. G. (1988). "Programming Plans and Programming Expertise." The Quarterly Journal of Experimental Psychology Section A, 40(3), pp. 423-442. ^
[4] Elliot, A. J., & Maier, M. A. (2012). "Color-in-Context Theory." Advances in Experimental Social Psychology, Vol. 45, pp. 61-125. Academic Press (Elsevier). ^
[5] Miller, G. A. (1956). "The magical number seven, plus or minus two: Some limits on our capacity for processing information." Psychological Review, 63(2), pp. 81-97. ^
[6] Web Content Accessibility Guidelines (WCAG) 2.1. (2018). W3C Recommendation. https://www.w3.org/TR/WCAG21/ ^