Skip to content

Commit 2357283

Browse files
bors[bot]eminence
andauthored
Merge #4256
4256: Improve formatting of analyzer status text r=flodiebold a=eminence The old formatting had everything on 1 line, making it quite hard to read: requests: 1 textDocument/documentSymbol 2ms 2 textDocument/codeAction 2ms 3 rust-analyzer/inlayHints 20ms 4 textDocument/foldingRange 108ms 6 textDocument/codeLens 66ms 5 textDocument/semanticTokens/range 76ms 8 rust-analyzer/inlayHints 195ms 7 textDocument/semanticTokens 250ms 9 textDocument/semanticTokens/range 108ms It now looks like this: ``` requests: * 1 textDocument/documentSymbol 11ms 2 textDocument/codeAction 15ms 3 rust-analyzer/inlayHints 4ms 5 textDocument/foldingRange 3ms 4 textDocument/semanticTokens/range 45ms 6 textDocument/codeLens 182ms 8 rust-analyzer/inlayHints 124ms 7 textDocument/semanticTokens 127ms 9 textDocument/documentHighlight 2ms 10 textDocument/codeAction 3ms ``` Co-authored-by: Andrew Chin <achin@eminence32.net>
2 parents 06fb724 + 76f34a1 commit 2357283

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

crates/rust-analyzer/src/main_loop/handlers.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,11 @@ use crate::{
4646
pub fn handle_analyzer_status(world: WorldSnapshot, _: ()) -> Result<String> {
4747
let _p = profile("handle_analyzer_status");
4848
let mut buf = world.status();
49-
format_to!(buf, "\n\nrequests:");
49+
format_to!(buf, "\n\nrequests:\n");
5050
let requests = world.latest_requests.read();
5151
for (is_last, r) in requests.iter() {
5252
let mark = if is_last { "*" } else { " " };
53-
format_to!(buf, "{}{:4} {:<36}{}ms", mark, r.id, r.method, r.duration.as_millis());
53+
format_to!(buf, "{}{:4} {:<36}{}ms\n", mark, r.id, r.method, r.duration.as_millis());
5454
}
5555
Ok(buf)
5656
}

0 commit comments

Comments
 (0)