mirror of
				https://github.com/rust-lang/rust-analyzer.git
				synced 2025-11-03 13:13:18 +00:00 
			
		
		
		
	Simplify some config serialization stuff
This commit is contained in:
		
							parent
							
								
									e972dd2385
								
							
						
					
					
						commit
						1dcb11be5d
					
				@ -19,13 +19,6 @@ pub struct CallItem {
 | 
				
			|||||||
    pub ranges: Vec<TextRange>,
 | 
					    pub ranges: Vec<TextRange>,
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
impl CallItem {
 | 
					 | 
				
			||||||
    #[cfg(test)]
 | 
					 | 
				
			||||||
    pub(crate) fn debug_render(&self) -> String {
 | 
					 | 
				
			||||||
        format!("{} : {:?}", self.target.debug_render(), self.ranges)
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
pub(crate) fn call_hierarchy(
 | 
					pub(crate) fn call_hierarchy(
 | 
				
			||||||
    db: &RootDatabase,
 | 
					    db: &RootDatabase,
 | 
				
			||||||
    position: FilePosition,
 | 
					    position: FilePosition,
 | 
				
			||||||
@ -159,6 +152,10 @@ mod tests {
 | 
				
			|||||||
        expected_incoming: Expect,
 | 
					        expected_incoming: Expect,
 | 
				
			||||||
        expected_outgoing: Expect,
 | 
					        expected_outgoing: Expect,
 | 
				
			||||||
    ) {
 | 
					    ) {
 | 
				
			||||||
 | 
					        fn debug_render(item: crate::CallItem) -> String {
 | 
				
			||||||
 | 
					            format!("{} : {:?}", item.target.debug_render(), item.ranges)
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        let (analysis, pos) = fixture::position(ra_fixture);
 | 
					        let (analysis, pos) = fixture::position(ra_fixture);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        let mut navs = analysis.call_hierarchy(pos).unwrap().unwrap().info;
 | 
					        let mut navs = analysis.call_hierarchy(pos).unwrap().unwrap().info;
 | 
				
			||||||
@ -169,12 +166,10 @@ mod tests {
 | 
				
			|||||||
        let item_pos =
 | 
					        let item_pos =
 | 
				
			||||||
            FilePosition { file_id: nav.file_id, offset: nav.focus_or_full_range().start() };
 | 
					            FilePosition { file_id: nav.file_id, offset: nav.focus_or_full_range().start() };
 | 
				
			||||||
        let incoming_calls = analysis.incoming_calls(item_pos).unwrap().unwrap();
 | 
					        let incoming_calls = analysis.incoming_calls(item_pos).unwrap().unwrap();
 | 
				
			||||||
        expected_incoming
 | 
					        expected_incoming.assert_eq(&incoming_calls.into_iter().map(debug_render).join("\n"));
 | 
				
			||||||
            .assert_eq(&incoming_calls.into_iter().map(|call| call.debug_render()).join("\n"));
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
        let outgoing_calls = analysis.outgoing_calls(item_pos).unwrap().unwrap();
 | 
					        let outgoing_calls = analysis.outgoing_calls(item_pos).unwrap().unwrap();
 | 
				
			||||||
        expected_outgoing
 | 
					        expected_outgoing.assert_eq(&outgoing_calls.into_iter().map(debug_render).join("\n"));
 | 
				
			||||||
            .assert_eq(&outgoing_calls.into_iter().map(|call| call.debug_render()).join("\n"));
 | 
					 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    #[test]
 | 
					    #[test]
 | 
				
			||||||
 | 
				
			|||||||
@ -28,7 +28,7 @@ pub(super) fn highlight_escape_string<T: IsString>(
 | 
				
			|||||||
pub(super) fn highlight_escape_char(stack: &mut Highlights, char: &Char, start: TextSize) {
 | 
					pub(super) fn highlight_escape_char(stack: &mut Highlights, char: &Char, start: TextSize) {
 | 
				
			||||||
    if char.value().is_err() {
 | 
					    if char.value().is_err() {
 | 
				
			||||||
        // We do not emit invalid escapes highlighting here. The lexer would likely be in a bad
 | 
					        // We do not emit invalid escapes highlighting here. The lexer would likely be in a bad
 | 
				
			||||||
        // state and this token contains junks, since `'` is not a reliable delimiter (consider
 | 
					        // state and this token contains junk, since `'` is not a reliable delimiter (consider
 | 
				
			||||||
        // lifetimes). Nonetheless, parser errors should already be emitted.
 | 
					        // lifetimes). Nonetheless, parser errors should already be emitted.
 | 
				
			||||||
        return;
 | 
					        return;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
				
			|||||||
@ -968,8 +968,6 @@ macro_rules! try_or_def {
 | 
				
			|||||||
    };
 | 
					    };
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
type ParallelCachePrimingNumThreads = u8;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
#[derive(Debug, Clone, Eq, PartialEq)]
 | 
					#[derive(Debug, Clone, Eq, PartialEq)]
 | 
				
			||||||
pub enum LinkedProject {
 | 
					pub enum LinkedProject {
 | 
				
			||||||
    ProjectManifest(ProjectManifest),
 | 
					    ProjectManifest(ProjectManifest),
 | 
				
			||||||
@ -2205,51 +2203,6 @@ macro_rules! create_bool_or_string_serde {
 | 
				
			|||||||
create_bool_or_string_serde!(true_or_always<true, "always">);
 | 
					create_bool_or_string_serde!(true_or_always<true, "always">);
 | 
				
			||||||
create_bool_or_string_serde!(false_or_never<false, "never">);
 | 
					create_bool_or_string_serde!(false_or_never<false, "never">);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
macro_rules! named_unit_variant {
 | 
					 | 
				
			||||||
    ($variant:ident) => {
 | 
					 | 
				
			||||||
        pub(super) mod $variant {
 | 
					 | 
				
			||||||
            pub(in super::super) fn deserialize<'de, D>(deserializer: D) -> Result<(), D::Error>
 | 
					 | 
				
			||||||
            where
 | 
					 | 
				
			||||||
                D: serde::Deserializer<'de>,
 | 
					 | 
				
			||||||
            {
 | 
					 | 
				
			||||||
                struct V;
 | 
					 | 
				
			||||||
                impl<'de> serde::de::Visitor<'de> for V {
 | 
					 | 
				
			||||||
                    type Value = ();
 | 
					 | 
				
			||||||
                    fn expecting(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
 | 
					 | 
				
			||||||
                        f.write_str(concat!("\"", stringify!($variant), "\""))
 | 
					 | 
				
			||||||
                    }
 | 
					 | 
				
			||||||
                    fn visit_str<E: serde::de::Error>(self, value: &str) -> Result<Self::Value, E> {
 | 
					 | 
				
			||||||
                        if value == stringify!($variant) {
 | 
					 | 
				
			||||||
                            Ok(())
 | 
					 | 
				
			||||||
                        } else {
 | 
					 | 
				
			||||||
                            Err(E::invalid_value(serde::de::Unexpected::Str(value), &self))
 | 
					 | 
				
			||||||
                        }
 | 
					 | 
				
			||||||
                    }
 | 
					 | 
				
			||||||
                }
 | 
					 | 
				
			||||||
                deserializer.deserialize_str(V)
 | 
					 | 
				
			||||||
            }
 | 
					 | 
				
			||||||
            pub(in super::super) fn serialize<S>(serializer: S) -> Result<S::Ok, S::Error>
 | 
					 | 
				
			||||||
            where
 | 
					 | 
				
			||||||
                S: serde::Serializer,
 | 
					 | 
				
			||||||
            {
 | 
					 | 
				
			||||||
                serializer.serialize_str(stringify!($variant))
 | 
					 | 
				
			||||||
            }
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
    };
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
mod unit_v {
 | 
					 | 
				
			||||||
    named_unit_variant!(all);
 | 
					 | 
				
			||||||
    named_unit_variant!(skip_trivial);
 | 
					 | 
				
			||||||
    named_unit_variant!(mutable);
 | 
					 | 
				
			||||||
    named_unit_variant!(reborrow);
 | 
					 | 
				
			||||||
    named_unit_variant!(fieldless);
 | 
					 | 
				
			||||||
    named_unit_variant!(with_block);
 | 
					 | 
				
			||||||
    named_unit_variant!(decimal);
 | 
					 | 
				
			||||||
    named_unit_variant!(hexadecimal);
 | 
					 | 
				
			||||||
    named_unit_variant!(both);
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
#[derive(Serialize, Deserialize, Debug, Clone, Copy, PartialEq)]
 | 
					#[derive(Serialize, Deserialize, Debug, Clone, Copy, PartialEq)]
 | 
				
			||||||
#[serde(rename_all = "snake_case")]
 | 
					#[serde(rename_all = "snake_case")]
 | 
				
			||||||
#[derive(Default)]
 | 
					#[derive(Default)]
 | 
				
			||||||
@ -2364,10 +2317,10 @@ pub(crate) enum CallableCompletionDef {
 | 
				
			|||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#[derive(Serialize, Deserialize, Debug, Clone)]
 | 
					#[derive(Serialize, Deserialize, Debug, Clone)]
 | 
				
			||||||
#[serde(untagged)]
 | 
					#[serde(rename_all = "snake_case")]
 | 
				
			||||||
enum CargoFeaturesDef {
 | 
					enum CargoFeaturesDef {
 | 
				
			||||||
    #[serde(with = "unit_v::all")]
 | 
					 | 
				
			||||||
    All,
 | 
					    All,
 | 
				
			||||||
 | 
					    #[serde(untagged)]
 | 
				
			||||||
    Selected(Vec<String>),
 | 
					    Selected(Vec<String>),
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -2389,25 +2342,27 @@ enum InvocationLocation {
 | 
				
			|||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#[derive(Serialize, Deserialize, Debug, Clone)]
 | 
					#[derive(Serialize, Deserialize, Debug, Clone)]
 | 
				
			||||||
#[serde(untagged)]
 | 
					#[serde(rename_all = "snake_case")]
 | 
				
			||||||
enum LifetimeElisionDef {
 | 
					enum LifetimeElisionDef {
 | 
				
			||||||
 | 
					    SkipTrivial,
 | 
				
			||||||
    #[serde(with = "true_or_always")]
 | 
					    #[serde(with = "true_or_always")]
 | 
				
			||||||
 | 
					    #[serde(untagged)]
 | 
				
			||||||
    Always,
 | 
					    Always,
 | 
				
			||||||
    #[serde(with = "false_or_never")]
 | 
					    #[serde(with = "false_or_never")]
 | 
				
			||||||
 | 
					    #[serde(untagged)]
 | 
				
			||||||
    Never,
 | 
					    Never,
 | 
				
			||||||
    #[serde(with = "unit_v::skip_trivial")]
 | 
					 | 
				
			||||||
    SkipTrivial,
 | 
					 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#[derive(Serialize, Deserialize, Debug, Clone)]
 | 
					#[derive(Serialize, Deserialize, Debug, Clone)]
 | 
				
			||||||
#[serde(untagged)]
 | 
					#[serde(rename_all = "snake_case")]
 | 
				
			||||||
enum ClosureReturnTypeHintsDef {
 | 
					enum ClosureReturnTypeHintsDef {
 | 
				
			||||||
 | 
					    WithBlock,
 | 
				
			||||||
    #[serde(with = "true_or_always")]
 | 
					    #[serde(with = "true_or_always")]
 | 
				
			||||||
 | 
					    #[serde(untagged)]
 | 
				
			||||||
    Always,
 | 
					    Always,
 | 
				
			||||||
    #[serde(with = "false_or_never")]
 | 
					    #[serde(with = "false_or_never")]
 | 
				
			||||||
 | 
					    #[serde(untagged)]
 | 
				
			||||||
    Never,
 | 
					    Never,
 | 
				
			||||||
    #[serde(with = "unit_v::with_block")]
 | 
					 | 
				
			||||||
    WithBlock,
 | 
					 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#[derive(Serialize, Deserialize, Debug, Clone)]
 | 
					#[derive(Serialize, Deserialize, Debug, Clone)]
 | 
				
			||||||
@ -2420,36 +2375,39 @@ enum ClosureStyle {
 | 
				
			|||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#[derive(Serialize, Deserialize, Debug, Clone)]
 | 
					#[derive(Serialize, Deserialize, Debug, Clone)]
 | 
				
			||||||
#[serde(untagged)]
 | 
					#[serde(rename_all = "snake_case")]
 | 
				
			||||||
enum ReborrowHintsDef {
 | 
					enum ReborrowHintsDef {
 | 
				
			||||||
    #[serde(with = "true_or_always")]
 | 
					 | 
				
			||||||
    Always,
 | 
					 | 
				
			||||||
    #[serde(with = "false_or_never")]
 | 
					 | 
				
			||||||
    Never,
 | 
					 | 
				
			||||||
    #[serde(with = "unit_v::mutable")]
 | 
					 | 
				
			||||||
    Mutable,
 | 
					    Mutable,
 | 
				
			||||||
 | 
					    #[serde(with = "true_or_always")]
 | 
				
			||||||
 | 
					    #[serde(untagged)]
 | 
				
			||||||
 | 
					    Always,
 | 
				
			||||||
 | 
					    #[serde(with = "false_or_never")]
 | 
				
			||||||
 | 
					    #[serde(untagged)]
 | 
				
			||||||
 | 
					    Never,
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#[derive(Serialize, Deserialize, Debug, Clone)]
 | 
					#[derive(Serialize, Deserialize, Debug, Clone)]
 | 
				
			||||||
#[serde(untagged)]
 | 
					#[serde(rename_all = "snake_case")]
 | 
				
			||||||
enum AdjustmentHintsDef {
 | 
					enum AdjustmentHintsDef {
 | 
				
			||||||
 | 
					    Reborrow,
 | 
				
			||||||
    #[serde(with = "true_or_always")]
 | 
					    #[serde(with = "true_or_always")]
 | 
				
			||||||
 | 
					    #[serde(untagged)]
 | 
				
			||||||
    Always,
 | 
					    Always,
 | 
				
			||||||
    #[serde(with = "false_or_never")]
 | 
					    #[serde(with = "false_or_never")]
 | 
				
			||||||
 | 
					    #[serde(untagged)]
 | 
				
			||||||
    Never,
 | 
					    Never,
 | 
				
			||||||
    #[serde(with = "unit_v::reborrow")]
 | 
					 | 
				
			||||||
    Reborrow,
 | 
					 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#[derive(Serialize, Deserialize, Debug, Clone)]
 | 
					#[derive(Serialize, Deserialize, Debug, Clone)]
 | 
				
			||||||
#[serde(untagged)]
 | 
					#[serde(rename_all = "snake_case")]
 | 
				
			||||||
enum DiscriminantHintsDef {
 | 
					enum DiscriminantHintsDef {
 | 
				
			||||||
 | 
					    Fieldless,
 | 
				
			||||||
    #[serde(with = "true_or_always")]
 | 
					    #[serde(with = "true_or_always")]
 | 
				
			||||||
 | 
					    #[serde(untagged)]
 | 
				
			||||||
    Always,
 | 
					    Always,
 | 
				
			||||||
    #[serde(with = "false_or_never")]
 | 
					    #[serde(with = "false_or_never")]
 | 
				
			||||||
 | 
					    #[serde(untagged)]
 | 
				
			||||||
    Never,
 | 
					    Never,
 | 
				
			||||||
    #[serde(with = "unit_v::fieldless")]
 | 
					 | 
				
			||||||
    Fieldless,
 | 
					 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#[derive(Serialize, Deserialize, Debug, Clone)]
 | 
					#[derive(Serialize, Deserialize, Debug, Clone)]
 | 
				
			||||||
@ -2473,9 +2431,11 @@ enum FilesWatcherDef {
 | 
				
			|||||||
#[serde(rename_all = "snake_case")]
 | 
					#[serde(rename_all = "snake_case")]
 | 
				
			||||||
enum ImportPrefixDef {
 | 
					enum ImportPrefixDef {
 | 
				
			||||||
    Plain,
 | 
					    Plain,
 | 
				
			||||||
    #[serde(alias = "self")]
 | 
					    #[serde(rename = "self")]
 | 
				
			||||||
 | 
					    #[serde(alias = "by_self")]
 | 
				
			||||||
    BySelf,
 | 
					    BySelf,
 | 
				
			||||||
    #[serde(alias = "crate")]
 | 
					    #[serde(rename = "crate")]
 | 
				
			||||||
 | 
					    #[serde(alias = "by_crate")]
 | 
				
			||||||
    ByCrate,
 | 
					    ByCrate,
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -2502,13 +2462,9 @@ enum WorkspaceSymbolSearchKindDef {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
#[derive(Serialize, Deserialize, Debug, Copy, Clone, PartialEq)]
 | 
					#[derive(Serialize, Deserialize, Debug, Copy, Clone, PartialEq)]
 | 
				
			||||||
#[serde(rename_all = "snake_case")]
 | 
					#[serde(rename_all = "snake_case")]
 | 
				
			||||||
#[serde(untagged)]
 | 
					 | 
				
			||||||
enum MemoryLayoutHoverRenderKindDef {
 | 
					enum MemoryLayoutHoverRenderKindDef {
 | 
				
			||||||
    #[serde(with = "unit_v::decimal")]
 | 
					 | 
				
			||||||
    Decimal,
 | 
					    Decimal,
 | 
				
			||||||
    #[serde(with = "unit_v::hexadecimal")]
 | 
					 | 
				
			||||||
    Hexadecimal,
 | 
					    Hexadecimal,
 | 
				
			||||||
    #[serde(with = "unit_v::both")]
 | 
					 | 
				
			||||||
    Both,
 | 
					    Both,
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -2533,10 +2489,10 @@ pub enum TargetDirectory {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq)]
 | 
					#[derive(Serialize, Deserialize, Debug, Clone, PartialEq)]
 | 
				
			||||||
#[serde(rename_all = "snake_case")]
 | 
					#[serde(rename_all = "snake_case")]
 | 
				
			||||||
#[serde(untagged)]
 | 
					 | 
				
			||||||
pub enum NumThreads {
 | 
					pub enum NumThreads {
 | 
				
			||||||
    Physical,
 | 
					    Physical,
 | 
				
			||||||
    Logical,
 | 
					    Logical,
 | 
				
			||||||
 | 
					    #[serde(untagged)]
 | 
				
			||||||
    Concrete(usize),
 | 
					    Concrete(usize),
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -2792,6 +2748,10 @@ impl FullConfigInput {
 | 
				
			|||||||
        ClientConfigInput::schema_fields(&mut fields);
 | 
					        ClientConfigInput::schema_fields(&mut fields);
 | 
				
			||||||
        fields.sort_by_key(|&(x, ..)| x);
 | 
					        fields.sort_by_key(|&(x, ..)| x);
 | 
				
			||||||
        fields
 | 
					        fields
 | 
				
			||||||
 | 
					            .iter()
 | 
				
			||||||
 | 
					            .tuple_windows()
 | 
				
			||||||
 | 
					            .for_each(|(a, b)| assert!(a.0 != b.0, "{a:?} duplicate field"));
 | 
				
			||||||
 | 
					        fields
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    fn json_schema() -> serde_json::Value {
 | 
					    fn json_schema() -> serde_json::Value {
 | 
				
			||||||
@ -3050,11 +3010,6 @@ fn field_props(field: &str, ty: &str, doc: &[&str], default: &str) -> serde_json
 | 
				
			|||||||
                "Search for all symbols kinds."
 | 
					                "Search for all symbols kinds."
 | 
				
			||||||
            ],
 | 
					            ],
 | 
				
			||||||
        },
 | 
					        },
 | 
				
			||||||
        "ParallelCachePrimingNumThreads" => set! {
 | 
					 | 
				
			||||||
            "type": "number",
 | 
					 | 
				
			||||||
            "minimum": 0,
 | 
					 | 
				
			||||||
            "maximum": 255
 | 
					 | 
				
			||||||
        },
 | 
					 | 
				
			||||||
        "LifetimeElisionDef" => set! {
 | 
					        "LifetimeElisionDef" => set! {
 | 
				
			||||||
            "type": "string",
 | 
					            "type": "string",
 | 
				
			||||||
            "enum": [
 | 
					            "enum": [
 | 
				
			||||||
@ -3276,13 +3231,12 @@ fn field_props(field: &str, ty: &str, doc: &[&str], default: &str) -> serde_json
 | 
				
			|||||||
                },
 | 
					                },
 | 
				
			||||||
            ],
 | 
					            ],
 | 
				
			||||||
        },
 | 
					        },
 | 
				
			||||||
        "Option<NumThreads>" => set! {
 | 
					        "NumThreads" => set! {
 | 
				
			||||||
            "anyOf": [
 | 
					            "anyOf": [
 | 
				
			||||||
                {
 | 
					                {
 | 
				
			||||||
                    "type": "null"
 | 
					                    "type": "number",
 | 
				
			||||||
                },
 | 
					                    "minimum": 0,
 | 
				
			||||||
                {
 | 
					                    "maximum": 255
 | 
				
			||||||
                    "type": "number"
 | 
					 | 
				
			||||||
                },
 | 
					                },
 | 
				
			||||||
                {
 | 
					                {
 | 
				
			||||||
                    "type": "string",
 | 
					                    "type": "string",
 | 
				
			||||||
@ -3294,7 +3248,27 @@ fn field_props(field: &str, ty: &str, doc: &[&str], default: &str) -> serde_json
 | 
				
			|||||||
                },
 | 
					                },
 | 
				
			||||||
            ],
 | 
					            ],
 | 
				
			||||||
        },
 | 
					        },
 | 
				
			||||||
        _ => panic!("missing entry for {ty}: {default}"),
 | 
					        "Option<NumThreads>" => set! {
 | 
				
			||||||
 | 
					            "anyOf": [
 | 
				
			||||||
 | 
					                {
 | 
				
			||||||
 | 
					                    "type": "null"
 | 
				
			||||||
 | 
					                },
 | 
				
			||||||
 | 
					                {
 | 
				
			||||||
 | 
					                    "type": "number",
 | 
				
			||||||
 | 
					                    "minimum": 0,
 | 
				
			||||||
 | 
					                    "maximum": 255
 | 
				
			||||||
 | 
					                },
 | 
				
			||||||
 | 
					                {
 | 
				
			||||||
 | 
					                    "type": "string",
 | 
				
			||||||
 | 
					                    "enum": ["physical", "logical", ],
 | 
				
			||||||
 | 
					                    "enumDescriptions": [
 | 
				
			||||||
 | 
					                        "Use the number of physical cores",
 | 
				
			||||||
 | 
					                        "Use the number of logical cores",
 | 
				
			||||||
 | 
					                    ],
 | 
				
			||||||
 | 
					                },
 | 
				
			||||||
 | 
					            ],
 | 
				
			||||||
 | 
					        },
 | 
				
			||||||
 | 
					        _ => panic!("missing entry for {ty}: {default} (field {field})"),
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    map.into()
 | 
					    map.into()
 | 
				
			||||||
 | 
				
			|||||||
@ -19,7 +19,7 @@ Term search fuel in "units of work" for assists (Defaults to 400).
 | 
				
			|||||||
--
 | 
					--
 | 
				
			||||||
Warm up caches on project load.
 | 
					Warm up caches on project load.
 | 
				
			||||||
--
 | 
					--
 | 
				
			||||||
[[rust-analyzer.cachePriming.numThreads]]rust-analyzer.cachePriming.numThreads (default: `0`)::
 | 
					[[rust-analyzer.cachePriming.numThreads]]rust-analyzer.cachePriming.numThreads (default: `"physical"`)::
 | 
				
			||||||
+
 | 
					+
 | 
				
			||||||
--
 | 
					--
 | 
				
			||||||
How many worker threads to handle priming caches. The default `0` means to pick automatically.
 | 
					How many worker threads to handle priming caches. The default `0` means to pick automatically.
 | 
				
			||||||
 | 
				
			|||||||
@ -609,10 +609,25 @@
 | 
				
			|||||||
                "properties": {
 | 
					                "properties": {
 | 
				
			||||||
                    "rust-analyzer.cachePriming.numThreads": {
 | 
					                    "rust-analyzer.cachePriming.numThreads": {
 | 
				
			||||||
                        "markdownDescription": "How many worker threads to handle priming caches. The default `0` means to pick automatically.",
 | 
					                        "markdownDescription": "How many worker threads to handle priming caches. The default `0` means to pick automatically.",
 | 
				
			||||||
                        "default": 0,
 | 
					                        "default": "physical",
 | 
				
			||||||
 | 
					                        "anyOf": [
 | 
				
			||||||
 | 
					                            {
 | 
				
			||||||
                                "type": "number",
 | 
					                                "type": "number",
 | 
				
			||||||
                                "minimum": 0,
 | 
					                                "minimum": 0,
 | 
				
			||||||
                                "maximum": 255
 | 
					                                "maximum": 255
 | 
				
			||||||
 | 
					                            },
 | 
				
			||||||
 | 
					                            {
 | 
				
			||||||
 | 
					                                "type": "string",
 | 
				
			||||||
 | 
					                                "enum": [
 | 
				
			||||||
 | 
					                                    "physical",
 | 
				
			||||||
 | 
					                                    "logical"
 | 
				
			||||||
 | 
					                                ],
 | 
				
			||||||
 | 
					                                "enumDescriptions": [
 | 
				
			||||||
 | 
					                                    "Use the number of physical cores",
 | 
				
			||||||
 | 
					                                    "Use the number of logical cores"
 | 
				
			||||||
 | 
					                                ]
 | 
				
			||||||
 | 
					                            }
 | 
				
			||||||
 | 
					                        ]
 | 
				
			||||||
                    }
 | 
					                    }
 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
            },
 | 
					            },
 | 
				
			||||||
@ -2225,11 +2240,27 @@
 | 
				
			|||||||
                    "rust-analyzer.numThreads": {
 | 
					                    "rust-analyzer.numThreads": {
 | 
				
			||||||
                        "markdownDescription": "How many worker threads in the main loop. The default `null` means to pick automatically.",
 | 
					                        "markdownDescription": "How many worker threads in the main loop. The default `null` means to pick automatically.",
 | 
				
			||||||
                        "default": null,
 | 
					                        "default": null,
 | 
				
			||||||
                        "type": [
 | 
					                        "anyOf": [
 | 
				
			||||||
                            "null",
 | 
					                            {
 | 
				
			||||||
                            "integer"
 | 
					                                "type": "null"
 | 
				
			||||||
 | 
					                            },
 | 
				
			||||||
 | 
					                            {
 | 
				
			||||||
 | 
					                                "type": "number",
 | 
				
			||||||
 | 
					                                "minimum": 0,
 | 
				
			||||||
 | 
					                                "maximum": 255
 | 
				
			||||||
 | 
					                            },
 | 
				
			||||||
 | 
					                            {
 | 
				
			||||||
 | 
					                                "type": "string",
 | 
				
			||||||
 | 
					                                "enum": [
 | 
				
			||||||
 | 
					                                    "physical",
 | 
				
			||||||
 | 
					                                    "logical"
 | 
				
			||||||
                                ],
 | 
					                                ],
 | 
				
			||||||
                        "minimum": 0
 | 
					                                "enumDescriptions": [
 | 
				
			||||||
 | 
					                                    "Use the number of physical cores",
 | 
				
			||||||
 | 
					                                    "Use the number of logical cores"
 | 
				
			||||||
 | 
					                                ]
 | 
				
			||||||
 | 
					                            }
 | 
				
			||||||
 | 
					                        ]
 | 
				
			||||||
                    }
 | 
					                    }
 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
            },
 | 
					            },
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user