refactor: rename function

refactor: rename function
This commit is contained in:
Nikita Revenco 2024-12-25 18:28:55 +00:00
parent db8ac503f4
commit 67552f6aa2

View file

@ -292,9 +292,9 @@ impl DocumentColorSwatches {
pub fn empty_with_id(id: ColorSwatchesId) -> Self { pub fn empty_with_id(id: ColorSwatchesId) -> Self {
Self { Self {
id, id,
color_swatches: Vec::new(), color_swatches: vec![],
color_swatches_padding: Vec::new(), color_swatches_padding: vec![],
colors: Vec::new(), colors: vec![],
} }
} }
} }
@ -1439,7 +1439,7 @@ impl Document {
.sort_by_key(|diagnostic| (diagnostic.range, diagnostic.severity, diagnostic.provider)); .sort_by_key(|diagnostic| (diagnostic.range, diagnostic.severity, diagnostic.provider));
// Update the inlay hint annotations' positions, helping ensure they are displayed in the proper place // Update the inlay hint annotations' positions, helping ensure they are displayed in the proper place
let apply_inlay_hint_changes = |annotations: &mut Vec<InlineAnnotation>| { let apply_lsp_annotations_changes = |annotations: &mut Vec<InlineAnnotation>| {
changes.update_positions( changes.update_positions(
annotations annotations
.iter_mut() .iter_mut()
@ -1460,11 +1460,11 @@ impl Document {
padding_after_inlay_hints, padding_after_inlay_hints,
} = text_annotation; } = text_annotation;
apply_inlay_hint_changes(padding_before_inlay_hints); apply_lsp_annotations_changes(padding_before_inlay_hints);
apply_inlay_hint_changes(type_inlay_hints); apply_lsp_annotations_changes(type_inlay_hints);
apply_inlay_hint_changes(parameter_inlay_hints); apply_lsp_annotations_changes(parameter_inlay_hints);
apply_inlay_hint_changes(other_inlay_hints); apply_lsp_annotations_changes(other_inlay_hints);
apply_inlay_hint_changes(padding_after_inlay_hints); apply_lsp_annotations_changes(padding_after_inlay_hints);
} }
for text_annotation in self.color_swatches.values_mut() { for text_annotation in self.color_swatches.values_mut() {
@ -1475,8 +1475,8 @@ impl Document {
color_swatches_padding, color_swatches_padding,
} = text_annotation; } = text_annotation;
apply_inlay_hint_changes(color_swatches); apply_lsp_annotations_changes(color_swatches);
apply_inlay_hint_changes(color_swatches_padding); apply_lsp_annotations_changes(color_swatches_padding);
} }
helix_event::dispatch(DocumentDidChange { helix_event::dispatch(DocumentDidChange {