aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_lsp_server/src/main_loop.rs
diff options
context:
space:
mode:
authorAlex Zatelepin <[email protected]>2019-10-21 00:04:55 +0100
committerAlex Zatelepin <[email protected]>2019-10-21 19:35:42 +0100
commit9d5e9326266d6b064c6d0f5d78ba2fae4d78e8fb (patch)
tree8f68f7083cad16640f4f99b1ce6e77315e5bd5f4 /crates/ra_lsp_server/src/main_loop.rs
parent6b9bd7bdd2712a7e85d6bfc70c231dbe36c2e585 (diff)
fixup folding ranges for "lineFoldingOnly" clients #2033
Diffstat (limited to 'crates/ra_lsp_server/src/main_loop.rs')
-rw-r--r--crates/ra_lsp_server/src/main_loop.rs24
1 files changed, 16 insertions, 8 deletions
diff --git a/crates/ra_lsp_server/src/main_loop.rs b/crates/ra_lsp_server/src/main_loop.rs
index 35c35d32b..0b5d9c44d 100644
--- a/crates/ra_lsp_server/src/main_loop.rs
+++ b/crates/ra_lsp_server/src/main_loop.rs
@@ -111,6 +111,21 @@ pub fn main_loop(
111 connection.sender.send(request.into()).unwrap(); 111 connection.sender.send(request.into()).unwrap();
112 } 112 }
113 113
114 let options = {
115 let text_document_caps = client_caps.text_document.as_ref();
116 Options {
117 publish_decorations: config.publish_decorations,
118 supports_location_link: text_document_caps
119 .and_then(|it| it.definition)
120 .and_then(|it| it.link_support)
121 .unwrap_or(false),
122 line_folding_only: text_document_caps
123 .and_then(|it| it.folding_range.as_ref())
124 .and_then(|it| it.line_folding_only)
125 .unwrap_or(false),
126 }
127 };
128
114 let feature_flags = { 129 let feature_flags = {
115 let mut ff = FeatureFlags::default(); 130 let mut ff = FeatureFlags::default();
116 for (flag, value) in config.feature_flags { 131 for (flag, value) in config.feature_flags {
@@ -133,14 +148,7 @@ pub fn main_loop(
133 config.lru_capacity, 148 config.lru_capacity,
134 &globs, 149 &globs,
135 Watch(!config.use_client_watching), 150 Watch(!config.use_client_watching),
136 Options { 151 options,
137 publish_decorations: config.publish_decorations,
138 supports_location_link: client_caps
139 .text_document
140 .and_then(|it| it.definition)
141 .and_then(|it| it.link_support)
142 .unwrap_or(false),
143 },
144 feature_flags, 152 feature_flags,
145 ) 153 )
146 }; 154 };