Skip to content

Commit e12ab17

Browse files
committed
[FIX] line break for pycharm
It seems that PyCharm randomly crash when receiving documentation with <br/> in it. We fallback then to a 'sometimes' escaped \n, while we don't really know what is causing the issue
1 parent 9e28a88 commit e12ab17

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

server/src/features/features_utils.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -597,7 +597,7 @@ impl FeaturesUtils {
597597
},
598598
TypeInfo::VALUE(value) => value.clone(),
599599
}).unique().collect::<Vec<_>>();
600-
value += &format!("{}{}```", FeaturesUtils::represent_return_types(return_types_string), FeaturesUtils::get_line_break(session));
600+
value += &format!("{}{}```", FeaturesUtils::represent_return_types(return_types_string), " \n"); //No need to put an escaped \n in code bloc
601601
//end block
602602
value
603603
}
@@ -636,7 +636,7 @@ impl FeaturesUtils {
636636
};
637637
let path = FileMgr::pathname2uri(&base_path);
638638
let range = if type_ref.is_file_content() { type_ref.range().start().to_u32() } else { 0 };
639-
format!(" \n*** \nSee also: [{}]({}#{}){}", type_ref.name().as_str(), path.as_str(), range, FeaturesUtils::get_line_break(session))
639+
format!(" \n*** \nSee also: [{}]({}#{}){}", type_ref.name().as_str(), path.as_str(), range, " \n")
640640
} else {
641641
S!("")
642642
}
@@ -679,7 +679,7 @@ impl FeaturesUtils {
679679
pub fn get_line_break(session: &mut SessionInfo<'_>) -> &'static str {
680680
if session.sync_odoo.capabilities.general.is_none() ||
681681
session.sync_odoo.capabilities.general.as_ref().unwrap().markdown.is_none() {
682-
return "<br/>"
682+
return " \\\n"
683683
}
684684
" \n"
685685
}

0 commit comments

Comments
 (0)