mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-03 07:04:49 +00:00
flip syntax text to use internal iteration
This commit is contained in:
parent
8f032d6a58
commit
8467ba8cdb
4 changed files with 78 additions and 38 deletions
|
@ -362,7 +362,16 @@ impl MacroCallId {
|
|||
pub fn debug_dump(self, db: &impl AstDatabase) -> String {
|
||||
let loc = self.loc(db);
|
||||
let node = loc.ast_id.to_node(db);
|
||||
let syntax_str = node.syntax().text().chunks().collect::<Vec<_>>().join(" ");
|
||||
let syntax_str = {
|
||||
let mut res = String::new();
|
||||
node.syntax().text().for_each_chunk(|chunk| {
|
||||
if !res.is_empty() {
|
||||
res.push(' ')
|
||||
}
|
||||
res.push_str(chunk)
|
||||
});
|
||||
res
|
||||
};
|
||||
|
||||
// dump the file name
|
||||
let file_id: HirFileId = self.loc(db).ast_id.file_id();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue