diff options
Diffstat (limited to 'crates')
-rw-r--r-- | crates/profile/src/stop_watch.rs | 6 | ||||
-rw-r--r-- | crates/rust-analyzer/tests/rust-analyzer/main.rs | 14 |
2 files changed, 17 insertions, 3 deletions
diff --git a/crates/profile/src/stop_watch.rs b/crates/profile/src/stop_watch.rs index 5e276190e..cb6915d45 100644 --- a/crates/profile/src/stop_watch.rs +++ b/crates/profile/src/stop_watch.rs | |||
@@ -76,7 +76,11 @@ impl fmt::Display for StopWatchSpan { | |||
76 | instructions /= 1000; | 76 | instructions /= 1000; |
77 | prefix = "m" | 77 | prefix = "m" |
78 | } | 78 | } |
79 | write!(f, ", {}{}i", instructions, prefix)?; | 79 | if instructions > 10000 { |
80 | instructions /= 1000; | ||
81 | prefix = "g" | ||
82 | } | ||
83 | write!(f, ", {}{}instr", instructions, prefix)?; | ||
80 | } | 84 | } |
81 | if let Some(memory) = self.memory { | 85 | if let Some(memory) = self.memory { |
82 | write!(f, ", {}", memory)?; | 86 | write!(f, ", {}", memory)?; |
diff --git a/crates/rust-analyzer/tests/rust-analyzer/main.rs b/crates/rust-analyzer/tests/rust-analyzer/main.rs index 38d09f3ee..f5c5c63e5 100644 --- a/crates/rust-analyzer/tests/rust-analyzer/main.rs +++ b/crates/rust-analyzer/tests/rust-analyzer/main.rs | |||
@@ -732,6 +732,16 @@ pub fn foo(_input: TokenStream) -> TokenStream { | |||
732 | ), | 732 | ), |
733 | work_done_progress_params: Default::default(), | 733 | work_done_progress_params: Default::default(), |
734 | }); | 734 | }); |
735 | let value = res.get("contents").unwrap().get("value").unwrap().to_string(); | 735 | let value = res.get("contents").unwrap().get("value").unwrap().as_str().unwrap(); |
736 | expect![[r#""\n```rust\nfoo::Bar\n```\n\n```rust\nfn bar()\n```""#]].assert_eq(&value); | 736 | |
737 | expect![[r#" | ||
738 | |||
739 | ```rust | ||
740 | foo::Bar | ||
741 | ``` | ||
742 | |||
743 | ```rust | ||
744 | fn bar() | ||
745 | ```"#]] | ||
746 | .assert_eq(&value); | ||
737 | } | 747 | } |