diff --git a/crates/ide-core/src/editor_settings.rs b/crates/ide-core/src/editor_settings.rs index c7addabb8..62e156dcb 100644 --- a/crates/ide-core/src/editor_settings.rs +++ b/crates/ide-core/src/editor_settings.rs @@ -362,6 +362,8 @@ pub struct InlayHintsSettings { pub parameters: bool, /// Hints of other kinds (chaining, closing labels…). pub other: bool, + /// The Dart server's closing labels (`// Column` after a widget's closing bracket). + pub closing_labels: bool, pub disabled_languages: Vec, /// Code vision as a whole (usages, author and language-server lenses); the switches below apply while it is on. pub code_vision: bool, @@ -394,6 +396,7 @@ impl Default for InlayHintsSettings { types: true, parameters: true, other: true, + closing_labels: true, disabled_languages: Vec::new(), code_vision: true, code_vision_usages: true, diff --git a/crates/ide-lsp/src/closing_labels.rs b/crates/ide-lsp/src/closing_labels.rs new file mode 100644 index 000000000..b9005af4b --- /dev/null +++ b/crates/ide-lsp/src/closing_labels.rs @@ -0,0 +1,105 @@ +//! The Dart analysis server's closing labels (`dart/textDocument/publishClosingLabels`): the +//! widget or call a closing `)` / `]` ends, shown after it at the end of the line (`// Column`). + +use crate::convert::Conv; +use crate::text::{DocText, Encoding, col_to_byte, units}; +use crate::types::{InlayHint, InlayKind}; +use ide_core::Pos; +use lsp_types as lsp; +use serde::Deserialize; +use std::collections::BTreeMap; +use std::path::Path; +#[cfg(test)] +use std::sync::Arc; + +#[derive(Deserialize)] +pub(crate) struct Params { + pub uri: String, + pub labels: Vec