diff options
author | Steffen Lyngbaek <[email protected]> | 2020-03-12 03:14:39 +0000 |
---|---|---|
committer | Steffen Lyngbaek <[email protected]> | 2020-03-12 03:14:39 +0000 |
commit | 58248e24cd45adcbfd7bfd00e1487df196b4a8c6 (patch) | |
tree | 7221dea8daa9dcede6ffaede88c890de17586c51 /crates/ra_project_model/src | |
parent | 974ed7155acccb5da0c2aeac09d7052c4f75902d (diff) |
Switch from Vec<InlayKind> to object with props
- Instead of a single object type, use several individual nested types
to allow toggling from the settings GUI
- Remove unused struct definitions
- Install and test that the toggles work
Diffstat (limited to 'crates/ra_project_model/src')
-rw-r--r-- | crates/ra_project_model/src/lib.rs | 23 |
1 files changed, 0 insertions, 23 deletions
diff --git a/crates/ra_project_model/src/lib.rs b/crates/ra_project_model/src/lib.rs index 036c8719f..37845ca56 100644 --- a/crates/ra_project_model/src/lib.rs +++ b/crates/ra_project_model/src/lib.rs | |||
@@ -16,7 +16,6 @@ use anyhow::{bail, Context, Result}; | |||
16 | use ra_cfg::CfgOptions; | 16 | use ra_cfg::CfgOptions; |
17 | use ra_db::{CrateGraph, CrateName, Edition, Env, FileId}; | 17 | use ra_db::{CrateGraph, CrateName, Edition, Env, FileId}; |
18 | use rustc_hash::FxHashMap; | 18 | use rustc_hash::FxHashMap; |
19 | use serde::Deserialize; | ||
20 | use serde_json::from_reader; | 19 | use serde_json::from_reader; |
21 | 20 | ||
22 | pub use crate::{ | 21 | pub use crate::{ |
@@ -25,28 +24,6 @@ pub use crate::{ | |||
25 | sysroot::Sysroot, | 24 | sysroot::Sysroot, |
26 | }; | 25 | }; |
27 | 26 | ||
28 | #[derive(Deserialize, Clone, Debug, PartialEq, Eq)] | ||
29 | #[serde(rename_all = "lowercase")] | ||
30 | pub enum InlayHintDisplayType { | ||
31 | Off, | ||
32 | TypeHints, | ||
33 | ParameterHints, | ||
34 | Full, | ||
35 | } | ||
36 | |||
37 | #[derive(Deserialize, Clone, Debug, PartialEq, Eq)] | ||
38 | #[serde(rename_all = "camelCase", default)] | ||
39 | pub struct InlayHintOptions { | ||
40 | pub display_type: InlayHintDisplayType, | ||
41 | pub max_length: Option<usize>, | ||
42 | } | ||
43 | |||
44 | impl Default for InlayHintOptions { | ||
45 | fn default() -> Self { | ||
46 | Self { display_type: InlayHintDisplayType::Full, max_length: None } | ||
47 | } | ||
48 | } | ||
49 | |||
50 | #[derive(Clone, PartialEq, Eq, Hash, Debug)] | 27 | #[derive(Clone, PartialEq, Eq, Hash, Debug)] |
51 | pub struct CargoTomlNotFoundError { | 28 | pub struct CargoTomlNotFoundError { |
52 | pub searched_at: PathBuf, | 29 | pub searched_at: PathBuf, |