mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-22 00:01:53 +00:00
Support spans with proc macro servers from before the ast id changes
The only thing changed is the value of the fixup ast id, so we just swap it.
This commit is contained in:
parent
c15fc9a344
commit
3e834add61
10 changed files with 96 additions and 102 deletions
|
@ -26,7 +26,7 @@ pub(crate) fn run() -> io::Result<()> {
|
|||
let write_response = |msg: msg::Response| msg.write(write_json, &mut io::stdout().lock());
|
||||
|
||||
let env = EnvSnapshot::default();
|
||||
let mut srv = proc_macro_srv::ProcMacroSrv::new(&env);
|
||||
let srv = proc_macro_srv::ProcMacroSrv::new(&env);
|
||||
|
||||
let mut span_mode = SpanMode::Id;
|
||||
|
||||
|
@ -78,7 +78,7 @@ pub(crate) fn run() -> io::Result<()> {
|
|||
})
|
||||
.map_err(msg::PanicMessage)
|
||||
}),
|
||||
SpanMode::RustAnalyzer { .. } => msg::Response::ExpandMacroExtended({
|
||||
SpanMode::RustAnalyzer => msg::Response::ExpandMacroExtended({
|
||||
let mut span_data_table = deserialize_span_data_index_map(&span_data_table);
|
||||
|
||||
let def_site = span_data_table[def_site];
|
||||
|
@ -122,9 +122,6 @@ pub(crate) fn run() -> io::Result<()> {
|
|||
msg::Request::ApiVersionCheck {} => msg::Response::ApiVersionCheck(CURRENT_API_VERSION),
|
||||
msg::Request::SetConfig(config) => {
|
||||
span_mode = config.span_mode;
|
||||
if let SpanMode::RustAnalyzer { fixup_ast_id } = span_mode {
|
||||
srv.set_fixup_ast_id(fixup_ast_id);
|
||||
}
|
||||
msg::Response::SetConfig(config)
|
||||
}
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue