diff options
author | Aleksey Kladov <[email protected]> | 2019-05-27 12:20:11 +0100 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2019-05-27 12:20:11 +0100 |
commit | cf214ac4e76413bdfd2676edf834505306edc9c6 (patch) | |
tree | f2de6c2d2393effe847fa4a2151587faf2b42bdc /crates/ra_lsp_server/tests/heavy_tests/support.rs | |
parent | ce040aa90755f2294b8db39a5255d75927f2bb95 (diff) |
enable profiling in tests
Diffstat (limited to 'crates/ra_lsp_server/tests/heavy_tests/support.rs')
-rw-r--r-- | crates/ra_lsp_server/tests/heavy_tests/support.rs | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/crates/ra_lsp_server/tests/heavy_tests/support.rs b/crates/ra_lsp_server/tests/heavy_tests/support.rs index d68182174..729067395 100644 --- a/crates/ra_lsp_server/tests/heavy_tests/support.rs +++ b/crates/ra_lsp_server/tests/heavy_tests/support.rs | |||
@@ -52,6 +52,11 @@ impl<'a> Project<'a> { | |||
52 | static INIT: Once = Once::new(); | 52 | static INIT: Once = Once::new(); |
53 | INIT.call_once(|| { | 53 | INIT.call_once(|| { |
54 | let _ = Logger::with_env_or_str(crate::LOG).start().unwrap(); | 54 | let _ = Logger::with_env_or_str(crate::LOG).start().unwrap(); |
55 | ra_prof::set_filter(if crate::PROFILE.is_empty() { | ||
56 | ra_prof::Filter::disabled() | ||
57 | } else { | ||
58 | ra_prof::Filter::from_spec(&crate::PROFILE) | ||
59 | }); | ||
55 | }); | 60 | }); |
56 | 61 | ||
57 | let mut paths = vec![]; | 62 | let mut paths = vec![]; |
@@ -121,6 +126,15 @@ impl Server { | |||
121 | TextDocumentIdentifier { uri: Url::from_file_path(path).unwrap() } | 126 | TextDocumentIdentifier { uri: Url::from_file_path(path).unwrap() } |
122 | } | 127 | } |
123 | 128 | ||
129 | pub fn notification<N>(&self, params: N::Params) | ||
130 | where | ||
131 | N: Notification, | ||
132 | N::Params: Serialize, | ||
133 | { | ||
134 | let r = RawNotification::new::<N>(¶ms); | ||
135 | self.send_notification(r) | ||
136 | } | ||
137 | |||
124 | pub fn request<R>(&self, params: R::Params, expected_resp: Value) | 138 | pub fn request<R>(&self, params: R::Params, expected_resp: Value) |
125 | where | 139 | where |
126 | R: Request, | 140 | R: Request, |