mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-30 13:51:31 +00:00
Regenrate docs and package.json
This commit is contained in:
parent
aecf26d09b
commit
dd4b53402d
5 changed files with 26 additions and 6 deletions
|
@ -301,6 +301,8 @@ config_data! {
|
|||
/// Internal config, path to proc-macro server executable (typically,
|
||||
/// this is rust-analyzer itself, but we override this in tests).
|
||||
procMacro_server: Option<PathBuf> = "null",
|
||||
/// Replaces the proc-macro expanders for the named proc-macros in the named crates with
|
||||
/// an identity expander that outputs the input again.
|
||||
procMacro_dummies: FxHashMap<Box<str>, Box<[Box<str>]>> = "{}",
|
||||
|
||||
/// Command to be executed instead of 'cargo' for runnables.
|
||||
|
@ -1167,7 +1169,13 @@ fn get_field<T: DeserializeOwned>(
|
|||
.find_map(move |field| {
|
||||
let mut pointer = field.replace('_', "/");
|
||||
pointer.insert(0, '/');
|
||||
json.pointer_mut(&pointer).and_then(|it| serde_json::from_value(it.take()).ok())
|
||||
json.pointer_mut(&pointer).and_then(|it| match serde_json::from_value(it.take()) {
|
||||
Ok(it) => Some(it),
|
||||
Err(e) => {
|
||||
tracing::warn!("Failed to deserialize config field at {}: {:?}", pointer, e);
|
||||
None
|
||||
}
|
||||
})
|
||||
})
|
||||
.unwrap_or(default)
|
||||
}
|
||||
|
@ -1228,6 +1236,9 @@ fn field_props(field: &str, ty: &str, doc: &[&str], default: &str) -> serde_json
|
|||
"items": { "type": "string" },
|
||||
"uniqueItems": true,
|
||||
},
|
||||
"FxHashMap<Box<str>, Box<[Box<str>]>>" => set! {
|
||||
"type": "object",
|
||||
},
|
||||
"FxHashMap<String, SnippetDef>" => set! {
|
||||
"type": "object",
|
||||
},
|
||||
|
|
|
@ -291,9 +291,6 @@ impl GlobalState {
|
|||
}
|
||||
},
|
||||
};
|
||||
self.analysis_host
|
||||
.raw_database_mut()
|
||||
.set_enable_proc_attr_macros(self.config.expand_proc_attr_macros());
|
||||
}
|
||||
|
||||
let watch = match files_config.watcher {
|
||||
|
@ -514,6 +511,8 @@ impl SourceRootConfig {
|
|||
}
|
||||
}
|
||||
|
||||
/// Load the proc-macros for the given lib path, replacing all expanders whose names are in `dummy_replace`
|
||||
/// with an identity dummy expander.
|
||||
pub(crate) fn load_proc_macro(
|
||||
client: Option<&ProcMacroServer>,
|
||||
path: &AbsPath,
|
||||
|
@ -586,6 +585,7 @@ pub(crate) fn load_proc_macro(
|
|||
}
|
||||
}
|
||||
|
||||
/// Dummy identity expander, used for proc-macros that are deliberately ignored by the user.
|
||||
#[derive(Debug)]
|
||||
struct DummyExpander;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue