aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_project_model/src
diff options
context:
space:
mode:
authorSteffen Lyngbaek <[email protected]>2020-03-12 03:14:39 +0000
committerSteffen Lyngbaek <[email protected]>2020-03-12 03:14:39 +0000
commit58248e24cd45adcbfd7bfd00e1487df196b4a8c6 (patch)
tree7221dea8daa9dcede6ffaede88c890de17586c51 /crates/ra_project_model/src
parent974ed7155acccb5da0c2aeac09d7052c4f75902d (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.rs23
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};
16use ra_cfg::CfgOptions; 16use ra_cfg::CfgOptions;
17use ra_db::{CrateGraph, CrateName, Edition, Env, FileId}; 17use ra_db::{CrateGraph, CrateName, Edition, Env, FileId};
18use rustc_hash::FxHashMap; 18use rustc_hash::FxHashMap;
19use serde::Deserialize;
20use serde_json::from_reader; 19use serde_json::from_reader;
21 20
22pub use crate::{ 21pub 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")]
30pub 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)]
39pub struct InlayHintOptions {
40 pub display_type: InlayHintDisplayType,
41 pub max_length: Option<usize>,
42}
43
44impl 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)]
51pub struct CargoTomlNotFoundError { 28pub struct CargoTomlNotFoundError {
52 pub searched_at: PathBuf, 29 pub searched_at: PathBuf,