Interface ISyntaxColorisation
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
StringSyntaxExtensions
Gets the StringSyntaxAttribute names supported by this profile.
IReadOnlyList<string> StringSyntaxExtensions { get; }
Property Value
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
rulePathIEnumerable<string>Ordered rule path from root to leaf.
Returns
GetClassification(string)
Gets the Visual Studio classification name for a single grammar rule.
string? GetClassification(string ruleName)
Parameters
ruleNamestringGrammar rule name.