Skip to content

LanguageServerDecorationProvider

Namespace: Hex1b.LanguageServer

Assembly: Hex1b.dll

An that connects to a language server and bridges semantic tokens, diagnostics, and completions to the editor's decoration and overlay APIs.

csharp
public sealed class LanguageServerDecorationProvider : ITextDecorationProvider, IAsyncDisposable

Inheritance

ObjectLanguageServerDecorationProvider

Implements

Constructors

LanguageServerDecorationProvider(LanguageServerConfiguration)

Parameters:

csharp
public LanguageServerDecorationProvider(LanguageServerConfiguration config)

Properties

CurrentDiagnostics

The current diagnostics for this document, updated from publishDiagnostics notifications.

Returns: IReadOnlyList<DiagnosticInfo>

csharp
public IReadOnlyList<DiagnosticInfo> CurrentDiagnostics { get; }

IsConnected

Whether the language server is connected and initialized.

Returns: Boolean

csharp
public bool IsConnected { get; }

Methods

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:

csharp
public void Activate(IEditorSession session)

Deactivate()

Called when the provider is disconnected from an editor. Implementations should clean up any resources or subscriptions.

csharp
public void Deactivate()

DisposeAsync()

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources asynchronously.

Returns: ValueTask

A task that represents the asynchronous dispose operation.

csharp
public ValueTask DisposeAsync()

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.

csharp
public IReadOnlyList<TextDecorationSpan> GetDecorations(int startLine, int endLine, IHex1bDocument document)

Released under the MIT License.