3543: Parameter inlay hint separate from variable type inlay? #2876 r=matklad a=slyngbaek

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

Co-authored-by: Steffen Lyngbaek <steffenlyngbaek@gmail.com>
This commit is contained in:
bors[bot]
2020-03-12 16:02:55 +00:00
committed by GitHub
12 changed files with 150 additions and 43 deletions

View File

@@ -7,6 +7,8 @@
//! configure the server itself, feature flags are passed into analysis, and
//! tweak things like automatic insertion of `()` in completions.
use crate::req::InlayConfigDef;
use ra_ide::InlayConfig;
use rustc_hash::FxHashMap;
use ra_project_model::CargoFeatures;
@@ -30,7 +32,8 @@ pub struct ServerConfig {
pub lru_capacity: Option<usize>,
pub max_inlay_hint_length: Option<usize>,
#[serde(with = "InlayConfigDef")]
pub inlay_hints: InlayConfig,
pub cargo_watch_enable: bool,
pub cargo_watch_args: Vec<String>,
@@ -60,7 +63,7 @@ impl Default for ServerConfig {
exclude_globs: Vec::new(),
use_client_watching: false,
lru_capacity: None,
max_inlay_hint_length: None,
inlay_hints: Default::default(),
cargo_watch_enable: true,
cargo_watch_args: Vec::new(),
cargo_watch_command: "check".to_string(),