10 Commits

Author SHA1 Message Date
Jonas Schievink
3dd5e273b6 Shrink diagnostic spans for errors inside macros 2022-01-08 15:40:42 +01:00
Anatol Ulrich
a6df2b16df implement Literal::from_str 2021-11-03 16:50:43 +01:00
Laurențiu Nicola
ca44b6892e Use array IntoIter 2021-10-22 09:23:29 +03:00
Aramis Razzaghipour
9583dd5725
Replace if let with match where appropriate 2021-10-05 09:00:21 +11:00
bors[bot]
533ca584c3
Merge #10378
10378: fix: Implement most proc_macro span handling methods r=jonas-schievink a=jonas-schievink

This closes https://github.com/rust-analyzer/rust-analyzer/issues/10368 – some APIs are still missing, but they are either for unstable features or require https://github.com/rust-analyzer/rust-analyzer/issues/9403

bors r+

Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
2021-09-27 18:00:08 +00:00
Jonas Schievink
577aedb8cf Implement most proc_macro span handling methods 2021-09-27 19:58:07 +02:00
Jonas Schievink
9641bc7369 Implement save_span / recover_proc_macro_span 2021-09-27 19:42:39 +02:00
Jonas Schievink
d05eae6ada Make stringify! prettify its input
This will insert whitespace if the invocation is inside another macro
2021-09-27 19:02:03 +02:00
Aleksey Kladov
d8a3d6f378 internal: cleanup proc macro server error handlig
When dealing with proc macros, there are two very different kinds of
errors:

* first, usual errors of "proc macro panicked on this particular input"
* second, the proc macro server might day if the user, eg, kills it

First kind of errors are expected and are a normal output, while the
second kind are genuine IO-errors.

For this reason, we use a curious nested result here: `Result<Result<T,
E1>, E2>` pattern, which is 100% inspired by http://sled.rs/errors.html
2021-08-31 19:01:39 +03:00
Alex Good
b111357b54
Copy the proc_macro crate for the 1.56 ABI 2021-08-07 16:34:59 +01:00