Open jonas-schievink opened 1 year ago
Thanks for reporting this bug. You are correct that it seems to be using the wrong span. Perhaps the #[tokio::main]
macro's span would be better?
Yeah, Span::call_site()
should be a good default
These were intended to improve diagnostics (https://github.com/tokio-rs/tokio/pull/3766), but I would accept a patch to improve compatibility with rust-analyzer as long as there are no diagnostics regressions.
Version
tokio-macros 1.8.2
Platform n/a
Description
In the following code, the
variable;
statement has incorrect spans attached to itself:The spans of
variable;
point totokio::runtime::Builder::new_multi_thread()
in the output of the macro. This causes rust-analyzer to (correctly) highlightvariable
as a function call and to show thenew_multi_thread
function on hover.Please consider not doing this, as it degrades IDE functionality.