aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_lsp_server/src/init.rs
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2019-06-07 18:49:29 +0100
committerAleksey Kladov <[email protected]>2019-06-12 11:36:24 +0100
commitfed52706def9a9f5d33edc7dd9848a02ae475ba5 (patch)
treebe508002355e87b97bd98a64f1678f431ed4b3ae /crates/ra_lsp_server/src/init.rs
parent15668119de40b97011a1f2e2d065d11f25a5833a (diff)
make LRU cache configurable
Diffstat (limited to 'crates/ra_lsp_server/src/init.rs')
-rw-r--r--crates/ra_lsp_server/src/init.rs14
1 files changed, 11 insertions, 3 deletions
diff --git a/crates/ra_lsp_server/src/init.rs b/crates/ra_lsp_server/src/init.rs
index 1b77e0312..b894b449d 100644
--- a/crates/ra_lsp_server/src/init.rs
+++ b/crates/ra_lsp_server/src/init.rs
@@ -17,11 +17,17 @@ pub struct InitializationOptions {
17 /// Defaults to `true` 17 /// Defaults to `true`
18 #[serde(deserialize_with = "nullable_bool_true")] 18 #[serde(deserialize_with = "nullable_bool_true")]
19 pub show_workspace_loaded: bool, 19 pub show_workspace_loaded: bool,
20
21 pub lru_capacity: Option<usize>,
20} 22}
21 23
22impl Default for InitializationOptions { 24impl Default for InitializationOptions {
23 fn default() -> InitializationOptions { 25 fn default() -> InitializationOptions {
24 InitializationOptions { publish_decorations: false, show_workspace_loaded: true } 26 InitializationOptions {
27 publish_decorations: false,
28 show_workspace_loaded: true,
29 lru_capacity: None,
30 }
25 } 31 }
26} 32}
27 33
@@ -54,8 +60,10 @@ mod test {
54 assert_eq!(default, serde_json::from_str(r#"{}"#).unwrap()); 60 assert_eq!(default, serde_json::from_str(r#"{}"#).unwrap());
55 assert_eq!( 61 assert_eq!(
56 default, 62 default,
57 serde_json::from_str(r#"{"publishDecorations":null, "showWorkspaceLoaded":null}"#) 63 serde_json::from_str(
58 .unwrap() 64 r#"{"publishDecorations":null, "showWorkspaceLoaded":null, "lruCapacity":null}"#
65 )
66 .unwrap()
59 ); 67 );
60 } 68 }
61} 69}