Table of Contents

Interface ISyntaxColorisation

Namespace
Utils.Parser.Runtime
Assembly
Utils.Parser.dll

Defines a syntax colorization contract that can be discovered by Visual Studio tooling.

public interface ISyntaxColorisation
Extension Methods

Remarks

Implementations of this interface are loaded and executed inside the Visual Studio extension process. They must be pure: they may not perform network access, write to disk, launch processes, or produce any observable side-effect beyond returning classification names. Read-only file access is permitted only when explicitly required (e.g., autocomplete support). Violations may be silently caught and the profile disabled.

Constructors and property accessors must return within a few seconds. Long-running or blocking implementations will be abandoned and the profile ignored.

Properties

FileExtensions

Gets the file extensions supported by this colorization profile.

IReadOnlyList<string> FileExtensions { get; }

Property Value

IReadOnlyList<string>

StringSyntaxExtensions

Gets the StringSyntaxAttribute names supported by this profile.

IReadOnlyList<string> StringSyntaxExtensions { get; }

Property Value

IReadOnlyList<string>

Methods

GetClassification(IEnumerable<string>)

Gets the Visual Studio classification name for a grammar rule path. The path must be ordered from parent rule to most specific rule.

string? GetClassification(IEnumerable<string> rulePath)

Parameters

rulePath IEnumerable<string>

Ordered rule path from root to leaf.

Returns

string

The classification name to use, or null when no mapping exists.

GetClassification(string)

Gets the Visual Studio classification name for a single grammar rule.

string? GetClassification(string ruleName)

Parameters

ruleName string

Grammar rule name.

Returns

string

The classification name to use, or null when no mapping exists.