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
Laurențiu Nicola
9e86544698
Merge from rust-lang/rust
2025-05-20 10:01:00 +03:00
Pietro Albini
11328b0e4f
update cfg(bootstrap)
2025-05-12 15:33:37 +02:00
Lukas Wirth
361a927a71
fix: Fix proc-macro API creating malformed negative literals
2025-05-05 14:10:42 +02:00
Lukas Wirth
cb18ead726
minor: Add more proc-macro tests for parsing negative literals
2025-05-05 13:44:45 +02:00
Laurențiu Nicola
6225bb9c44
Merge from rust-lang/rust
2025-04-28 11:06:53 +03:00
Mara Bos
963d076989
Disable some r-a tests in bootstrap.
2025-04-14 16:53:24 +02:00
Lukas Wirth
a505420751
chore: Bump Edition::CURRENT to 2024
2025-03-17 12:29:19 +01:00
Lukas Wirth
a06aadb9f0
internal: Render root syntax contexts more clearly
2025-03-16 16:26:07 +01:00
BenjaminBrienen
7535bb4661
cargo fmt
2025-03-15 21:32:01 +01:00
Lukas Wirth
02a793bd59
chore: Remove legacy SyntaxContextId re-export
2025-03-15 17:09:17 +01:00
Chayim Refael Friedman
c94e9efbef
Salsify the crate graph
...
I.e. make it not one giant input but multiple, for incrementality and decreased memory usage for Salsa 3 reasons.
2025-03-12 21:02:30 +02:00
Lukas Wirth
5ec0057418
Use interior mutability for loaded ProcMacrorv::expanders
2025-02-05 12:01:57 +01:00
Lukas Wirth
bf669dab84
Re-implement rust string highlighting via tool attribute
2025-01-10 13:49:35 +01:00
Chayim Refael Friedman
97afb7bfba
Make edition per-token, not per-file
...
More correctly, *also* per-token. Because as it turns out, while the top-level edition affects parsing (I think), the per-token edition affects escaping of identifiers/keywords.
2025-01-09 05:43:08 +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
8a86fa01ac
Fix clippy lints in proc-macro-srv
2024-12-12 13:30:42 +01:00
bors
fbed308ebe
Auto merge of #17799 - Veykril:syntax-bridge, r=Veykril
...
Split out syntax-bridge into a separate crate
This functionality is not really tied to mbe macros, so imo it has no place in that crate.
2024-08-05 12:31:45 +00:00
Lukas Wirth
188c577855
Newtype ErasedFileAstId
2024-08-05 13:46:47 +02:00
Lukas Wirth
d2dd4f6d5f
Split out syntax-bridge into a separate crate
2024-08-05 13:45:00 +02:00
Lukas Wirth
5264f86242
Encode edition within FileId in the hir layer
2024-07-18 08:49:10 +02:00
Lukas Wirth
7011094685
Add always disabled gen parse support
2024-07-17 10:49:12 +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
2fb38ceb66
Faster env snapshotting in proc-macro-srv
2024-06-30 16:10:20 +02:00
Lukas Wirth
0b88dfc8b1
Rename proc-macro-srv::server to server_impl
2024-06-30 15:36:46 +02:00
Lukas Wirth
8e324e98a1
Rename ProcMacroKind::FuncLike to Bang
2024-03-22 11:20:56 +01:00
Lukas Wirth
d085ade631
Remove dead test code
2024-03-14 16:24:51 +01:00
Lukas Wirth
d2f8eae2ec
feat: Support macro calls in eager macros for IDE features
2024-03-14 15:40:35 +01:00
Lukas Wirth
cdfb73ab9c
fix: Fix proc-macro server not accounting for string delimiters correctly
2024-02-22 22:34:03 +01:00
Lukas Wirth
ed57008510
fix: Validate literals in proc-macro-srv FreeFunctions::literal_from_str
2024-02-13 12:33:51 +01:00
Lukas Wirth
9e8e124269
Special case fixup spans in server::Span impl, they are immutable
2023-12-22 10:13:00 +01:00
Lukas Wirth
9197b541c2
Fix dead code warnings
2023-12-21 17:23:56 +01:00
Lukas Wirth
f427f56812
Implement other non-db reliant server::Span functions
2023-12-21 17:23:04 +01:00
Lukas Wirth
428a34a9b4
Implement server::Span::Join
2023-12-21 17:23:04 +01:00
Lukas Wirth
a892237ed4
Add rust-analyzer-span server feature equivalent to the ID server
2023-12-21 17:22:59 +01:00
Lukas Wirth
0003e568ca
Pass calling span through to builtin macro expansions
2023-12-01 14:11:57 +01:00
Lukas Wirth
b98597f06d
Re-enable proc-macros
2023-11-28 16:28:56 +01:00
Lukas Wirth
7498ec730e
Drop support for non-syroot proc macro ABIs
2023-03-29 10:57:32 +02:00
Lukas Wirth
41a46a78f2
Make tt generic over the span data
2023-01-31 14:58:16 +01:00
Daniel Eades
77051679d7
use inline format args
2023-01-02 14:52:32 +00:00
Ryo Yoshida
de591f08d6
Handle raw identifiers in proc macro server
2022-12-04 00:26:05 +09:00
Ryo Yoshida
7577c44c65
Update proc-macro-srv tests
2022-11-17 01:42:56 +09:00
Lukas Wirth
f57cd838d8
Don't run proc-macro-srv tests on the rust-analyzer repo
...
proc-macro ABI breakage still affects the tests when a new stable version
releases. Ideally we'd still be able to run the tests on the rust-analyzer
repo without having to update the proc-macro ABI, but for now just to
unblock CI we will ignore them here, as they are still run in upstream.
2022-09-24 00:08:28 +02:00
Edwin Cheng
c47914c6cf
Fixes tests
2022-08-10 16:29:23 +08:00
Amos Wenger
246947b779
Fix raw ident handling (a little)
2022-07-21 19:13:44 +02:00
Amos Wenger
941416a1d6
Add test for idents incl. raw idents
2022-07-21 18:48:19 +02:00
Amos Wenger
9cf99a9c71
Stringify literals create client-side properly
2022-07-21 18:44:41 +02:00
Amos Wenger
36d825fd5d
Add test for literals created client-side
2022-07-21 18:29:28 +02:00
Amos Wenger
f5042947ce
Add proc-macro-srv integration test that clones literals
...
This exercises some of the upcoming proc_macro bridge changes. It
should also pass for all supported ABIs, with the older-style bridge.
2022-07-20 16:43:40 +02:00