Commit graph

14 commits

Author SHA1 Message Date
Lukas Wirth
02a788bfaa Deduplicate code in proc-macro-srv 2025-06-05 07:25:15 +02:00
Chayim Refael Friedman
bf8d03c1b5 Correctly set the span of the proc_macro crate's Group delimiters
Previously only the open delimiter's span was set, and this caused... weird problems.
2025-05-21 18:31:14 +03:00
Lukas Wirth
361a927a71 fix: Fix proc-macro API creating malformed negative literals 2025-05-05 14:10:42 +02:00
Laurențiu Nicola
6225bb9c44 Merge from rust-lang/rust 2025-04-28 11:06:53 +03:00
Mara Bos
44885be61f Update rust-analyzer for new proc_macro span api. 2025-04-11 15:30:03 +02:00
BenjaminBrienen
2462624a7d prefer default over new 2025-04-04 15:49:50 +02:00
BenjaminBrienen
7535bb4661 cargo fmt 2025-03-15 21:32:01 +01:00
Chayim Refael Friedman
3f2fb17042 Make proc_macro span's line & column 1-indexed, as documented
That is, make the fake number that we return 1 and not 0.
2025-01-26 08:27:24 +02:00
Chayim Refael Friedman
ceba289f80 Store token trees in contiguous Vec instead of as a tree
I expected this to be faster (due to less allocations and better cache locality), but benchmarked it is not (neither it is slower). Memory usage, however, drops by ~50mb (of `analysis-stats .`). I guess tt construction is just not hot.

This also simplifies using even less memory for token trees by compressing equal span, which I plan to do right after.

Some workflows are more easily expressed with a flat tt, while some are better expressed with a tree. With the right helpers, though (which was mostly a matter of trial and error), even the worst workflows become very easy indeed.
2025-01-02 19:21:46 +02:00
Lukas Wirth
714b81bec1 Decouple proc-macro server protocol from the server implementation 2024-12-30 10:33:57 +01:00
Lukas Wirth
d6666b16c4 fix: Fix proc-macro server crashing when parsing a non-lexable string into a TokenStream 2024-08-29 08:45:19 +02:00
Lukas Wirth
93024ad411 Switch token trees to use Symbols 2024-07-16 10:11:59 +02:00
Lukas Wirth
e846c04fbe Encode ident rawness and literal kind separately in tt::Leaf 2024-07-15 12:24:40 +02:00
Lukas Wirth
0b88dfc8b1 Rename proc-macro-srv::server to server_impl 2024-06-30 15:36:46 +02:00
Renamed from crates/proc-macro-srv/src/server/token_id.rs (Browse further)