You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In rust-analyzer rust-analyzer version: 0.3.1885-standalone (b6d1887bc 2024-03-17) in vscode, when writing a doc comment
#[doc = "\n\nThis is a \"quote\".\n\nFoo"]
fn main() {}
hovering over main() shows the doc comment as expected, with newlines. However, in rust-analyzer rust-analyzer version: 0.3.1896-standalone, while the quote characters display correctly, literal \n (backslash n) tokens appear in the tooltip.
The text was updated successfully, but these errors were encountered:
AttrInput::Literal(it) => match it.text.strip_prefix('r'){
Some(it) => it.trim_matches('#'),
None => it.text.as_str(),
}
.strip_prefix('"')?
.strip_suffix('"'),
I guess we keep the whole token text to match spans. But I don't think using strip to get the string is a good approach since we can't distinguish between a raw-string and a normal string (in which characters can be escaped). And I found that when doc comments are within #[doc], \n should be escaped; whereas within /// it won't be escaped, the current code cannot handle this situation.
In rust-analyzer
rust-analyzer version: 0.3.1885-standalone (b6d1887bc 2024-03-17)
in vscode, when writing a doc commenthovering over
main()
shows the doc comment as expected, with newlines. However, in rust-analyzerrust-analyzer version: 0.3.1896-standalone
, while the quote characters display correctly, literal\n
(backslash n) tokens appear in the tooltip.The text was updated successfully, but these errors were encountered: