mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-27 20:42:04 +00:00
Merge commit '426d2842c1' into sync-from-ra2
This commit is contained in:
parent
e37cf75791
commit
932d85b529
240 changed files with 6941 additions and 3102 deletions
|
|
@ -39,10 +39,22 @@ fn run() -> io::Result<()> {
|
|||
msg::Request::ListMacros { dylib_path } => {
|
||||
msg::Response::ListMacros(srv.list_macros(&dylib_path))
|
||||
}
|
||||
msg::Request::ExpandMacro(task) => msg::Response::ExpandMacro(srv.expand(task)),
|
||||
msg::Request::ExpandMacro(task) => match srv.span_mode() {
|
||||
msg::SpanMode::Id => msg::Response::ExpandMacro(srv.expand(task).map(|(it, _)| it)),
|
||||
msg::SpanMode::RustAnalyzer => msg::Response::ExpandMacroExtended(
|
||||
srv.expand(task).map(|(tree, span_data_table)| msg::ExpandMacroExtended {
|
||||
tree,
|
||||
span_data_table,
|
||||
}),
|
||||
),
|
||||
},
|
||||
msg::Request::ApiVersionCheck {} => {
|
||||
msg::Response::ApiVersionCheck(proc_macro_api::msg::CURRENT_API_VERSION)
|
||||
}
|
||||
msg::Request::SetConfig(config) => {
|
||||
srv.set_span_mode(config.span_mode);
|
||||
msg::Response::SetConfig(config)
|
||||
}
|
||||
};
|
||||
write_response(res)?
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue