pub struct Item {
pub label: String,
pub kind: ItemKind,
pub detail: Option<String>,
pub description: Option<String>,
pub documentation_md: Option<String>,
pub kb_entry: Option<&'static Entry>,
pub insert_text: String,
pub is_snippet: bool,
pub sort_priority: u8,
}Fields§
§label: String§kind: ItemKind§detail: Option<String>§description: Option<String>§documentation_md: Option<String>Eagerly-built markdown, for items whose documentation is derived
from the catalog or a hand-written snippet blurb. Knowledge-base
items leave this None and set Item::kb_entry instead – read
through Item::documentation rather than touching either field.
kb_entry: Option<&'static Entry>Knowledge-base entry backing this item, when it has one.
Rendering markdown for every built-in keyword, type, and function
costs ~2700 render_markdown calls (each one several format!s
plus paragraph wrapping) on every completion request, and the
client displays exactly one of them. Carrying the entry instead
lets the server defer rendering to completionItem/resolve.
insert_text: String§is_snippet: booltrue when insert_text contains LSP snippet placeholders like
$0 or ${1:arg}. The server maps this onto
InsertTextFormat::Snippet. Default false.
sort_priority: u8Sort priority – lower = appears first in the completion menu. 0 = in-scope columns (from FROM/JOIN), 1 = in-scope tables, 2 = scoped builtins, 3 = catalog-wide tables/functions, 4 = keywords, 5 = catch-all. Default 5 keeps old call-sites safe.
Implementations§
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Item
impl RefUnwindSafe for Item
impl Send for Item
impl Sync for Item
impl Unpin for Item
impl UnsafeUnpin for Item
impl UnwindSafe for Item
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more