diff --git a/vhdl_lang/src/analysis/names.rs b/vhdl_lang/src/analysis/names.rs index 768c105d..0c66895a 100644 --- a/vhdl_lang/src/analysis/names.rs +++ b/vhdl_lang/src/analysis/names.rs @@ -960,8 +960,15 @@ impl<'a> AnalyzeContext<'a> { ) -> EvalResult> { // all type attribute suffixes require that the prefix be an object type let Some(obj) = prefix.as_object_name() else { - diagnostics.error(pos,format!("The {} attribute can only be used on objects, not {}", suffix, prefix.describe())); - return Err(EvalError::Unknown) + diagnostics.error( + pos, + format!( + "The {} attribute can only be used on objects, not {}", + suffix, + prefix.describe() + ), + ); + return Err(EvalError::Unknown); }; match suffix { TypeAttribute::Subtype => Ok(obj.type_mark()), diff --git a/vhdl_lang/src/data/contents.rs b/vhdl_lang/src/data/contents.rs index 767f0359..d78f2393 100644 --- a/vhdl_lang/src/data/contents.rs +++ b/vhdl_lang/src/data/contents.rs @@ -117,10 +117,7 @@ impl Contents { let end_line = std::cmp::min(self.lines.len().saturating_sub(1), end_line); self.lines - .splice( - start_line..=end_line, - split_lines(&merged_content), - ) + .splice(start_line..=end_line, split_lines(&merged_content)) .count(); } } diff --git a/vhdl_lang/src/syntax/context.rs b/vhdl_lang/src/syntax/context.rs index c4d1075e..26149838 100644 --- a/vhdl_lang/src/syntax/context.rs +++ b/vhdl_lang/src/syntax/context.rs @@ -216,7 +216,8 @@ mod tests { #[test] fn test_context_clause() { - let variants = [&"\ + let variants = [ + &"\ context ident is end; ", @@ -231,7 +232,8 @@ end ident; &"\ context ident is end context ident; -"]; +", + ]; for (idx, variant) in variants.iter().enumerate() { let has_end_ident = idx >= 2; let code = Code::new(variant);