// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
import type { LspCompletionKind } from "./LspCompletionKind";
import type { LspTextEdit } from "./LspTextEdit";

export type LspCompletionItem = { label: string, kind: LspCompletionKind | null, 
/**
 * Short right-hand annotation: signature summary, type name, etc.
 */
detail: string | null, 
/**
 * Longer markdown body shown in the selected-item side panel.
 */
documentation: string | null, 
/**
 * Text inserted if different from `label`. CM's autocomplete
 * uses `label` as the display text and falls back to it as the
 * insert text when this is `None`.
 */
insertText: string | null, 
/**
 * Sort key if the server wants a specific order — CM sorts by
 * `label` by default, which is sometimes worse (e.g. private
 * `_` members bubble to the top).
 */
sortText: string | null, 
/**
 * Filter key if the server wants a different match surface than
 * `label`. Same rationale as `sort_text`.
 */
filterText: string | null, 
/**
 * Primary text edit the server wants applied at acceptance,
 * when it cares about an exact range (e.g. completing
 * `foo.bar` from inside `foo` — the server replaces the whole
 * dotted span, not just the prefix-matched suffix). When
 * `None`, the frontend falls back to "replace the
 * matchBefore-detected word with `insert_text` / `label`".
 * `LspRange` is UTF-16, zero-based — same encoding the
 * hover/diagnostics surface uses.
 */
textEdit: LspTextEdit | null, 
/**
 * Edits the server wants applied **alongside** the primary
 * edit, typically auto-import lines: e.g. picking `useState`
 * from a React module ships an `import { useState } from
 * 'react';` line at the top of the file. Often empty in the
 * initial `textDocument/completion` response and only
 * populated after the client calls
 * `completionItem/resolve` — see [`Self::resolve_token`].
 */
additionalTextEdits: Array<LspTextEdit>, 
/**
 * Opaque token the frontend ships back to
 * `lsp_completion_resolve` to fetch lazy-resolved fields
 * (notably `additional_text_edits` for auto-imports). Built
 * by JSON-encoding the original `lsp_types::CompletionItem`,
 * so the resolver can replay the exact server payload — the
 * LSP spec says clients must round-trip the original item
 * verbatim. `None` when the server didn't advertise resolve
 * support at init time, in which case whatever we already
 * have in [`Self::additional_text_edits`] is final.
 */
resolveToken: string | null, };
