ITextDecorationProvider
Namespace: Hex1b.Documents
Assembly: Hex1b.dll
Provides text decorations (syntax highlighting, diagnostics, etc.) for an editor. Implementations should be efficient — is called every render frame for the visible viewport only. Cache aggressively and use to invalidate caches when the document changes.
public interface ITextDecorationProviderMethods
Activate(IEditorSession)
Called when the provider is connected to an editor. Receives an that the provider can use to interact with the editor (e.g., push overlays, request re-renders).
Parameters:
session(IEditorSession): The editor session handle.
void Activate(IEditorSession session)Deactivate()
Called when the provider is disconnected from an editor. Implementations should clean up any resources or subscriptions.
void Deactivate()GetDecorations(int, int, IHex1bDocument)
Returns decorations for the specified range of visible lines. Only lines within the viewport are requested; providers should not compute decorations for the entire document.
Parameters:
startLine(Int32): First visible line (1-based).endLine(Int32): Last visible line (1-based).document(IHex1bDocument): The document being rendered.
Returns: IReadOnlyList<TextDecorationSpan>
Decoration spans covering the requested line range.
IReadOnlyList<TextDecorationSpan> GetDecorations(int startLine, int endLine, IHex1bDocument document)