diff options
author | Steffen Lyngbaek <[email protected]> | 2020-03-10 07:55:46 +0000 |
---|---|---|
committer | Steffen Lyngbaek <[email protected]> | 2020-03-10 21:33:45 +0000 |
commit | e98aff109a1c4bda6a05f16981898425c302aa0c (patch) | |
tree | bad52598c5638a81af9066592913bdfcdcb639fa /crates/ra_ide/src/lib.rs | |
parent | 0714a065d578e8b22b0451bfc64378c875fe858f (diff) |
Parameter inlay hint separate from variable type inlay? #2876
Add setting to allow enabling either type inlay hints or parameter
inlay hints or both. Group the the max inlay hint length option
into the object.
- Add a new type for the inlayHint options.
- Add tests to ensure the inlays don't happen on the server side
Diffstat (limited to 'crates/ra_ide/src/lib.rs')
-rw-r--r-- | crates/ra_ide/src/lib.rs | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/crates/ra_ide/src/lib.rs b/crates/ra_ide/src/lib.rs index 9f45003d3..8b1292a41 100644 --- a/crates/ra_ide/src/lib.rs +++ b/crates/ra_ide/src/lib.rs | |||
@@ -44,6 +44,7 @@ mod marks; | |||
44 | #[cfg(test)] | 44 | #[cfg(test)] |
45 | mod test_utils; | 45 | mod test_utils; |
46 | 46 | ||
47 | use ra_project_model::InlayHintOptions; | ||
47 | use std::sync::Arc; | 48 | use std::sync::Arc; |
48 | 49 | ||
49 | use ra_cfg::CfgOptions; | 50 | use ra_cfg::CfgOptions; |
@@ -318,9 +319,9 @@ impl Analysis { | |||
318 | pub fn inlay_hints( | 319 | pub fn inlay_hints( |
319 | &self, | 320 | &self, |
320 | file_id: FileId, | 321 | file_id: FileId, |
321 | max_inlay_hint_length: Option<usize>, | 322 | inlay_hint_opts: &InlayHintOptions, |
322 | ) -> Cancelable<Vec<InlayHint>> { | 323 | ) -> Cancelable<Vec<InlayHint>> { |
323 | self.with_db(|db| inlay_hints::inlay_hints(db, file_id, max_inlay_hint_length)) | 324 | self.with_db(|db| inlay_hints::inlay_hints(db, file_id, inlay_hint_opts)) |
324 | } | 325 | } |
325 | 326 | ||
326 | /// Returns the set of folding ranges. | 327 | /// Returns the set of folding ranges. |