pub struct InlayHintConfig {
pub show_type_hints: bool,
pub show_parameter_hints: bool,
pub show_variable_type_hints: bool,
pub show_return_type_hints: bool,
pub show_chain_hints: bool,
pub show_binding_kind_hints: bool,
}Expand description
Configuration for inlay hints
Fields§
§show_type_hints: bool§show_parameter_hints: bool§show_variable_type_hints: boolShow : type hints after variable names in let/var/const without explicit annotations
show_return_type_hints: boolShow -> type hints after function parameter lists without explicit return annotations
show_chain_hints: boolW2.4 / 1.27: render the inferred type after every intermediate .method()
call in a method chain (e.g. xs.map(f).filter(g).sum() → hint after
.map(f) and .filter(g)).
show_binding_kind_hints: boolW2.4 / 1.25 + LSP-I (R8 W11): render an approximate
BindingStorageClass label after let/var bindings. The five
ADR-006 §2 categories — [Direct] / [UniqueHeap] / [SharedCow] /
[SharedAtomic] / [SharedAtomicMut] — are rendered as best-effort
labels from the LSP-side AST (the authoritative classifier lives in
the bytecode compiler at crates/shape-vm/src/type_tracking.rs:286
- the MIR borrow solver). Always surfaced with the
[… approx]qualifier so the user knows it is not the compiler verdict.
Standing pattern (binding 2026-05-26): Shape-unique inlay hints
(chain hints, binding-storage-class hints, anything not Rust/TS
idiomatic) ship opt-in default-OFF under the shape.inlayHints.*
namespace. The canonical LSP key for this toggle is
shape.inlayHints.bindingStorageClass.enable: boolean (Decision 2
ratify). The legacy bindingKindHints key (W2.4 / 1.25 vintage) is
accepted as an alias for backward compatibility; future inlay-hint
sub-clusters should follow the same opt-in default-OFF shape.
Implementations§
Source§impl InlayHintConfig
impl InlayHintConfig
Sourcepub fn from_lsp_settings(value: Option<&Value>) -> Self
pub fn from_lsp_settings(value: Option<&Value>) -> Self
W2.4 / 1.70 + LSP-I (R8 W11): parse an InlayHintConfig from a
workspace/configuration JSON value. Honors keys such as
shape.inlayHints.enable, shape.inlayHints.typeHints,
shape.inlayHints.parameterHints, shape.inlayHints.variableTypeHints,
shape.inlayHints.returnTypeHints, shape.inlayHints.chainHints,
shape.inlayHints.bindingStorageClass.enable (canonical Decision 2 key
for binding-storage-class hints), and shape.inlayHints.bindingKindHints
(legacy W2.4 / 1.25 alias, retained for backward compatibility).
snake_case aliases (e.g. chain_hints, binding_storage_class) are also
accepted. Unknown keys are ignored. Returns Default::default() when
the input is None or contains no recognized keys.
Trait Implementations§
Source§impl Clone for InlayHintConfig
impl Clone for InlayHintConfig
Source§impl Debug for InlayHintConfig
impl Debug for InlayHintConfig
Auto Trait Implementations§
impl Freeze for InlayHintConfig
impl RefUnwindSafe for InlayHintConfig
impl Send for InlayHintConfig
impl Sync for InlayHintConfig
impl Unpin for InlayHintConfig
impl UnsafeUnpin for InlayHintConfig
impl UnwindSafe for InlayHintConfig
Blanket Implementations§
impl<T> Allocation for T
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
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