Skip to content

IEditorSession

Namespace: Hex1b.Documents

Assembly: Hex1b.dll

Handle given to implementations for interacting with the editor they are connected to. Enables providers to push overlays, access editor state, and request re-renders.

csharp
public interface IEditorSession

Properties

ActiveGutterDecorations

Returns all currently active gutter decorations.

Returns: IReadOnlyList<GutterDecoration>

csharp
IReadOnlyList<GutterDecoration> ActiveGutterDecorations { get; }

ActiveInlineHints

Returns all currently active inline hints.

Returns: IReadOnlyList<InlineHint>

csharp
IReadOnlyList<InlineHint> ActiveInlineHints { get; }

ActiveOverlays

Returns all currently active overlays.

Returns: IReadOnlyList<EditorOverlay>

csharp
IReadOnlyList<EditorOverlay> ActiveOverlays { get; }

ActiveRangeHighlights

Returns all currently active range highlights.

Returns: IReadOnlyList<RangeHighlight>

csharp
IReadOnlyList<RangeHighlight> ActiveRangeHighlights { get; }

Returns the current breadcrumb data, or null if none set.

Returns: BreadcrumbData

csharp
BreadcrumbData? Breadcrumbs { get; }

Capabilities

Terminal capabilities for the current session.

Returns: TerminalCapabilities

csharp
TerminalCapabilities Capabilities { get; }

FoldingRegions

Returns all currently defined folding regions.

Returns: IReadOnlyList<FoldingRegion>

csharp
IReadOnlyList<FoldingRegion> FoldingRegions { get; }

State

The current editor state (document, cursors, selections).

Returns: EditorState

csharp
EditorState State { get; }

Methods

ClearGutterDecorations()

Clears all gutter decorations.

csharp
void ClearGutterDecorations()

ClearInlineHints()

Clears all inline hints.

csharp
void ClearInlineHints()

ClearRangeHighlights()

Clears all range highlights.

csharp
void ClearRangeHighlights()

DismissOverlay(string)

Dismisses an overlay by its unique ID.

Parameters:

csharp
void DismissOverlay(string overlayId)

DismissSignaturePanel()

Dismisses the signature help panel.

csharp
void DismissSignaturePanel()

Invalidate()

Requests the editor to re-render. Call this after asynchronous updates (e.g., when language server results arrive) to ensure decorations are refreshed.

csharp
void Invalidate()

PushGutterDecorations(IReadOnlyList<GutterDecoration>)

Pushes gutter decorations (icons/markers in the editor margin). Replaces any previously pushed gutter decorations.

Parameters:

csharp
void PushGutterDecorations(IReadOnlyList<GutterDecoration> decorations)

PushInlineHints(IReadOnlyList<InlineHint>)

Pushes inline hints (virtual text rendered inline without modifying the document). Replaces any previously pushed hints.

Parameters:

csharp
void PushInlineHints(IReadOnlyList<InlineHint> hints)

PushOverlay(EditorOverlay)

Pushes a floating overlay anchored to a document position. If an overlay with the same ID already exists, it is replaced.

Parameters:

csharp
void PushOverlay(EditorOverlay overlay)

PushRangeHighlights(IReadOnlyList<RangeHighlight>)

Pushes range highlights (temporary background-colored document ranges). Replaces any previously pushed highlights.

Parameters:

csharp
void PushRangeHighlights(IReadOnlyList<RangeHighlight> highlights)

SetBreadcrumbs(BreadcrumbData?)

Sets breadcrumb data (hierarchical document symbols for navigation).

Parameters:

csharp
void SetBreadcrumbs(BreadcrumbData? data)

SetFoldingRegions(IReadOnlyList<FoldingRegion>)

Sets folding regions (collapsible code regions). Replaces any previously set regions.

Parameters:

csharp
void SetFoldingRegions(IReadOnlyList<FoldingRegion> regions)

ShowActionMenuAsync(ActionMenu)

Shows an action menu popup at the specified position. Returns the selected item's ID, or null if dismissed.

Parameters:

Returns: Task<String>

csharp
Task<string?> ShowActionMenuAsync(ActionMenu menu)

ShowSignaturePanel(SignaturePanel)

Shows a signature help panel.

Parameters:

csharp
void ShowSignaturePanel(SignaturePanel panel)

Released under the MIT License.