mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-29 13:25:09 +00:00
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
This commit is contained in:
parent
0714a065d5
commit
e98aff109a
13 changed files with 155 additions and 34 deletions
|
@ -7,6 +7,7 @@
|
|||
//! configure the server itself, feature flags are passed into analysis, and
|
||||
//! tweak things like automatic insertion of `()` in completions.
|
||||
|
||||
use ra_project_model::InlayHintOptions;
|
||||
use rustc_hash::FxHashMap;
|
||||
|
||||
use ra_project_model::CargoFeatures;
|
||||
|
@ -30,7 +31,7 @@ pub struct ServerConfig {
|
|||
|
||||
pub lru_capacity: Option<usize>,
|
||||
|
||||
pub max_inlay_hint_length: Option<usize>,
|
||||
pub inlay_hint_opts: InlayHintOptions,
|
||||
|
||||
pub cargo_watch_enable: bool,
|
||||
pub cargo_watch_args: Vec<String>,
|
||||
|
@ -57,7 +58,7 @@ impl Default for ServerConfig {
|
|||
exclude_globs: Vec::new(),
|
||||
use_client_watching: false,
|
||||
lru_capacity: None,
|
||||
max_inlay_hint_length: None,
|
||||
inlay_hint_opts: Default::default(),
|
||||
cargo_watch_enable: true,
|
||||
cargo_watch_args: Vec::new(),
|
||||
cargo_watch_command: "check".to_string(),
|
||||
|
|
|
@ -177,7 +177,7 @@ pub fn main_loop(
|
|||
.and_then(|it| it.folding_range.as_ref())
|
||||
.and_then(|it| it.line_folding_only)
|
||||
.unwrap_or(false),
|
||||
max_inlay_hint_length: config.max_inlay_hint_length,
|
||||
inlay_hint_opts: config.inlay_hint_opts.clone(),
|
||||
cargo_watch: CheckOptions {
|
||||
enable: config.cargo_watch_enable,
|
||||
args: config.cargo_watch_args,
|
||||
|
|
|
@ -15,7 +15,7 @@ use ra_cargo_watch::{url_from_path_with_drive_lowercasing, CheckOptions, CheckWa
|
|||
use ra_ide::{
|
||||
Analysis, AnalysisChange, AnalysisHost, CrateGraph, FileId, LibraryData, SourceRootId,
|
||||
};
|
||||
use ra_project_model::{get_rustc_cfg_options, ProjectWorkspace};
|
||||
use ra_project_model::{get_rustc_cfg_options, InlayHintOptions, ProjectWorkspace};
|
||||
use ra_vfs::{LineEndings, RootEntry, Vfs, VfsChange, VfsFile, VfsRoot, VfsTask, Watch};
|
||||
use relative_path::RelativePathBuf;
|
||||
|
||||
|
@ -32,7 +32,7 @@ pub struct Options {
|
|||
pub publish_decorations: bool,
|
||||
pub supports_location_link: bool,
|
||||
pub line_folding_only: bool,
|
||||
pub max_inlay_hint_length: Option<usize>,
|
||||
pub inlay_hint_opts: InlayHintOptions,
|
||||
pub rustfmt_args: Vec<String>,
|
||||
pub cargo_watch: CheckOptions,
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue