One completion candidate with stable provider and semantic edit identity.
The identifier is the full identity tuple, not a display label or truncated hash. Documentation is intentionally excluded because completionItem/resolve may add it without changing the candidate's identity. Detail remains part of the identity because providers commonly use it to distinguish overloads.
Summary
Types
Stable identity of one provider-owned completion candidate.
LSP CompletionItemKind as an atom.
A half-open match range expressed in Unicode codepoint offsets.
Identity of the provider within one completion session.
A text edit to apply when accepting a completion.
Functions
Compacts sorted match positions into half-open ranges.
Builds a non-LSP completion item from the same stable field contract.
Parses one LSP CompletionItem and assigns its provider-qualified stable identity.
Returns this candidate with resolved documentation while preserving its identity.
Returns the provider-aware semantic key used to collapse true duplicates.
Returns a compact stable identifier suitable for native protocol payloads.
Returns this candidate with at most 255 display-label match ranges for the wire snapshot.
Maps normalized filter-text ranges onto the displayed label, omitting non-mappable ranges.
Types
@type id() :: {provider_id(), {String.t(), String.t(), map() | nil, term(), term(), term(), String.t()}}
Stable identity of one provider-owned completion candidate.
@type kind() ::
:text
| :method
| :function
| :constructor
| :field
| :variable
| :class
| :interface
| :module
| :property
| :unit
| :value
| :enum
| :keyword
| :snippet
| :color
| :file
| :reference
| :folder
| :enum_member
| :constant
| :struct
| :event
| :operator
| :type_parameter
LSP CompletionItemKind as an atom.
@type match_range() :: {start :: non_neg_integer(), length :: pos_integer()}
A half-open match range expressed in Unicode codepoint offsets.
@type provider_id() :: term()
Identity of the provider within one completion session.
@type t() :: %Minga.Editing.Completion.Item{ detail: String.t(), documentation: String.t(), filter_text: String.t(), id: id(), insert_text: String.t(), kind: kind(), label: String.t(), match_ranges: [match_range()], preselect: boolean(), provider_id: provider_id(), raw: map() | nil, search: Minga.Editing.Completion.Item.Search.t(), sort_text: String.t(), source: String.t(), text_edit: text_edit() | nil }
@type text_edit() :: %{ range: %{ start_line: non_neg_integer(), start_col: non_neg_integer(), end_line: non_neg_integer(), end_col: non_neg_integer() }, new_text: String.t() }
A text edit to apply when accepting a completion.
Functions
@spec compact_match_positions([non_neg_integer()]) :: [match_range()]
Compacts sorted match positions into half-open ranges.
@spec from_fields(provider_id(), map()) :: t()
Builds a non-LSP completion item from the same stable field contract.
@spec from_lsp(provider_id(), map()) :: t()
Parses one LSP CompletionItem and assigns its provider-qualified stable identity.
Returns this candidate with resolved documentation while preserving its identity.
Returns the provider-aware semantic key used to collapse true duplicates.
Returns a compact stable identifier suitable for native protocol payloads.
@spec with_match_ranges(t(), [match_range()]) :: t()
Returns this candidate with at most 255 display-label match ranges for the wire snapshot.
@spec with_normalized_match_ranges(t(), [match_range()]) :: t()
Maps normalized filter-text ranges onto the displayed label, omitting non-mappable ranges.