This fixes issue (#2724)
This commit is contained in:
1 parent
c4e55c7fb6
commit
e73484795a
4 files changed
+21
-1
No files matched your search
@@ -69,7 +69,14 @@ pub fn fmt_file(contents: &str, indent: IndentOptions) -> Vec<FormattedBlock> {
|
||||
continue;
|
||||
}
|
||||
|
||||
let body = item.parse_body_with(CallBody::parse_strict).unwrap();
|
||||
let body = match item.parse_body_with(CallBody::parse_strict) {
|
||||
Ok(v) => v,
|
||||
//there is aparsing error, we give up and don't format the rsx
|
||||
Err(e) => {
|
||||
eprintln!("Error while parsing rsx {:?} ", e);
|
||||
return formatted_blocks;
|
||||
}
|
||||
};
|
||||
|
||||
let rsx_start = macro_path.span().start();
|
||||
|
||||
|
||||
@@ -30,3 +30,4 @@ twoway!("multiexpr-many" => multiexpr_many (IndentOptions::new(IndentType::Space
|
||||
twoway!("simple-combo-expr" => simple_combo_expr (IndentOptions::new(IndentType::Spaces, 4, false)));
|
||||
twoway!("oneline-expand" => online_expand (IndentOptions::new(IndentType::Spaces, 4, false)));
|
||||
twoway!("shortened" => shortened (IndentOptions::new(IndentType::Spaces, 4, false)));
|
||||
twoway!("syntax_error" => syntax_error (IndentOptions::new(IndentType::Spaces, 4, false)));
|
||||
@@ -0,0 +1,6 @@
|
||||
fn app() -> Element {
|
||||
rsx! {
|
||||
let x="hello world";
|
||||
div { "hello world" }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
fn app() -> Element {
|
||||
rsx! {
|
||||
let x="hello world";
|
||||
div { "hello world" }
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user