aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2020-05-02 10:45:37 +0100
committerGitHub <[email protected]>2020-05-02 10:45:37 +0100
commit235728319fb545670e49db996e9c2cd94b8b34eb (patch)
tree105619231d37ce51518994481290c2d7dbf298dc
parent06fb7247d8db829759f905621cca9798ae2ced4e (diff)
parent76f34a15e61fc69ccafe1ec4804712dcd3069de5 (diff)
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 <[email protected]>
-rw-r--r--crates/rust-analyzer/src/main_loop/handlers.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/crates/rust-analyzer/src/main_loop/handlers.rs b/crates/rust-analyzer/src/main_loop/handlers.rs
index 914062902..c7a96ba93 100644
--- a/crates/rust-analyzer/src/main_loop/handlers.rs
+++ b/crates/rust-analyzer/src/main_loop/handlers.rs
@@ -46,11 +46,11 @@ use crate::{
46pub fn handle_analyzer_status(world: WorldSnapshot, _: ()) -> Result<String> { 46pub fn handle_analyzer_status(world: WorldSnapshot, _: ()) -> Result<String> {
47 let _p = profile("handle_analyzer_status"); 47 let _p = profile("handle_analyzer_status");
48 let mut buf = world.status(); 48 let mut buf = world.status();
49 format_to!(buf, "\n\nrequests:"); 49 format_to!(buf, "\n\nrequests:\n");
50 let requests = world.latest_requests.read(); 50 let requests = world.latest_requests.read();
51 for (is_last, r) in requests.iter() { 51 for (is_last, r) in requests.iter() {
52 let mark = if is_last { "*" } else { " " }; 52 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());
54 } 54 }
55 Ok(buf) 55 Ok(buf)
56} 56}