mirror of
https://github.com/rust-lang/rust-analyzer
synced 2025-01-16 07:03:57 +00:00
v2
This commit is contained in:
parent
b316bccc97
commit
a66dbd11ed
1 changed files with 2 additions and 1 deletions
|
@ -164,7 +164,8 @@ pub(crate) fn relevant_line_comments(comment: &ast::Comment) -> Vec<Comment> {
|
||||||
//
|
//
|
||||||
// But since such comments aren't idiomatic we're okay with this.
|
// But since such comments aren't idiomatic we're okay with this.
|
||||||
pub(crate) fn line_comment_text(indentation: IndentLevel, comm: ast::Comment) -> Option<String> {
|
pub(crate) fn line_comment_text(indentation: IndentLevel, comm: ast::Comment) -> Option<String> {
|
||||||
let contents_without_prefix = comm.text().strip_prefix(comm.prefix())?;
|
let text = comm.text();
|
||||||
|
let contents_without_prefix = text.strip_prefix(comm.prefix()).unwrap_or(text);
|
||||||
let contents = contents_without_prefix.strip_prefix(' ').unwrap_or(contents_without_prefix);
|
let contents = contents_without_prefix.strip_prefix(' ').unwrap_or(contents_without_prefix);
|
||||||
|
|
||||||
// Don't add the indentation if the line is empty
|
// Don't add the indentation if the line is empty
|
||||||
|
|
Loading…
Reference in a new issue