Lukas Wirth
5ca77bd0bc
fix: Fix proc-macro-srv passing invalid extra none group to proc-macros
2025-12-01 16:28:18 +01:00
Lukas Wirth
f8a7fd5a4d
internal: Ensure proc-macro-api version check works with postcard across protocol versions
2025-11-30 18:46:29 +01:00
Lukas Wirth
be3ecb2082
proc-macro-srv: Fix unnecessary subtree wrapping in protocol
2025-11-28 11:32:35 +01:00
Lukas Wirth
c9472ba921
Merge pull request #21145 from Veykril/push-prwwrlwmoxzx
...
proc-macro-srv: Fix `<TokenStream as Display>::fmt` impl producing trailing whitespace
2025-11-27 13:01:10 +00:00
Lukas Wirth
f2bbb97e1c
proc-macro-srv: Fix <TokenStream as Display>::fmt impl producing trailing whitespace
2025-11-27 13:51:20 +01:00
Lukas Wirth
0bc8802223
Gate spawning proc-macro-srv with --format on toolchain version
2025-11-26 17:30:45 +01:00
Lukas Wirth
3a0d3d5b51
Merge pull request #21135 from Shourya742/2025-11-26-default-json
...
fix: Fix proc-macro-srv protocol read implementation
2025-11-26 10:20:54 +00:00
Lukas Wirth
268df15ee2
Revert to spawning proc-macro-srv without format flag
2025-11-26 11:06:58 +01:00
bit-aloo
dc04aeac6e
return Some(T) and not T in read method Message trait
2025-11-26 14:56:46 +05:30
Lukas Wirth
157e09ecf1
fix: Do not try to connect via postcard to proc-macro-srv
2025-11-26 09:03:00 +01:00
Lukas Wirth
82bd7ddb5d
minor: Rename proc-macro-srv protocol flags
2025-11-26 09:03:00 +01:00
bit-aloo
cae902c6e7
add codec and framing to abstract encoding and decoding logic from run
2025-11-24 21:44:13 +05:30
bit-aloo
c7435a9bdf
add review suggestions
2025-11-24 15:28:28 +05:30
bit-aloo
e344bfa7ea
add postcard abstraction inside Message trait
2025-11-24 15:28:28 +05:30
bit-aloo
f31214f96a
add postcard related methods to proc-macro-apo
2025-11-24 15:28:27 +05:30
Lukas Wirth
b5fc29e252
Fix up feature gates
2025-11-22 18:53:32 +01:00
Lukas Wirth
5409a40efc
Implement rpc protocol changes
2025-11-22 16:58:35 +01:00
Lukas Wirth
87625cc166
Add version command to proc-macro-srv
2025-07-31 10:10:50 +02:00
Lukas Wirth
4d5bb86ad7
Abtract away json protocol for proc-macro-srv
2025-07-30 15:52:10 +02:00
Chayim Refael Friedman
3e834add61
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.
2025-06-12 16:08:48 +03:00
Chayim Refael Friedman
4bcf03e28b
Use stable AST IDs
...
Instead of simple numbering, we hash important bits, like the name of the item.
This will allow for much better incrementality, e.g. when you add an item. Currently, this invalidates the IDs of all following items, which invalidates pretty much everything.
2025-06-12 08:47:22 +03:00
Chayim Refael Friedman
db72e2ff41
Adjust for salsa::Id::from_u32() being unsafe
...
This impacts our manual `salsa::Id` wrappers. I refactored them a bit to improve safety.
2025-04-22 15:19:35 +03:00
Lukas Wirth
34e7d60e30
Merge pull request #19644 from ChayimFriedman2/const-syms
...
internal: Make predefined symbols `const` instead of `static`
2025-04-21 12:34:59 +00:00
Chayim Refael Friedman
0f325c7ff8
Remove unnecessary predefined symbol clones
...
Now that they're const it's no longer needed.
Nothing manual was performed: only a regexp search of `sym::([\w][\w\d]*)\.clone\(\)` and replace by `sym::$1`.
2025-04-21 03:10:13 +03:00
jyn
3b964a7105
allow using null to unset an environment variable
...
this makes three changes:
- all callsites of `toolchain::command` are changed to use
`command(path, extra_env)`, instead of manually adding the env after
the fact.
- all `map<str, str>` are changed to `map<str, option<str>>`.
- `command` checks for None and calls `env_remove` if so.
this caught several places where environment variables weren't being
propagated:
- when running `rustc --print=target-libdir`
- when running `cargo rustc -- --print=target-spec-json`
- when running the custom DiscoverLinkedProjects config. I *think* this
is for use with non-cargo build systems, so I didn't change it.
2025-04-19 12:15:22 -04:00
Lukas Wirth
1e1571e1c8
fix: Fix new nightly lints
2025-03-31 13:27:54 +02:00
Lukas Wirth
faf1b49a9a
fix: Fix, clarify and require a value for proc_macro_cwd of CrateData
2025-03-29 08:08:48 +01:00
Lukas Wirth
64d39c1abc
Merge pull request #19329 from Shourya742/2025-03-10-add-proc-macro-api-doc
...
doc: add doc to proc-macro-api
2025-03-17 09:17:35 +00:00
BenjaminBrienen
7535bb4661
cargo fmt
2025-03-15 21:32:01 +01:00
Neil
1e3026ccb7
refactor: Simplify by removing ? operator
...
`out.flush()` already returns a `io::Result<()>`, so there is no need for `?` operator and `Ok(())`
2025-03-15 12:34:48 -07: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
bit-aloo
3546ef2f06
doc: add doc to proc-macro-api
2025-03-10 18:43:41 +05:30
Lukas Wirth
3fe50ef83c
Merge pull request #18861 from ChayimFriedman2/await-edition
...
fix: Make edition per-token, not per-file
2025-01-09 10:20:11 +00: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
Lukas Wirth
4b6007115a
minor: New clippy lints
2025-01-06 17:57:17 +01: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
b2d9486ebd
Move proc-macro protocol into legacy module
2024-12-30 11:47:08 +01:00
Lukas Wirth
714b81bec1
Decouple proc-macro server protocol from the server implementation
2024-12-30 10:33:57 +01:00
Lukas Wirth
5ce14b0439
Enforce a current directory being set for spawned commands
2024-12-29 12:51:13 +01:00
Lukas Wirth
c966876f85
Revert "internal: Drop proc-macro server support for ~1.66.0 and older toolchains"
2024-12-20 20:51:09 +01:00
Lukas Wirth
5211972743
internal: Split serde derive feature into serde_derive usage
...
Ideally we'd not have any dependency pull in the derive feature for faster build times, once that is the case this change would have an actual effect.
See https://github.com/matklad/macro-dep-test/blob/master/README.md for context.
2024-12-20 11:55:02 +01:00
Lukas Wirth
3d63140758
Remove salsa from proc-macro server dep tree
2024-12-18 10:24:26 +01:00
Lukas Wirth
f0b5b8333d
internal: Drop proc-macro server support for ~1.66.0 and older toolchains
2024-12-12 15:06:14 +01:00
benluiwj
1c71a50e01
Improve error message for too new proc-macro server
2024-11-02 21:46:05 +08:00
Lukas Wirth
6c23f25e7f
Fix new nightly lints
2024-10-22 11:48:41 +02:00
Lukas Wirth
c2258d8880
Properly set the working directory for proc-macro execution
2024-09-11 12:23:12 +02:00
Lukas Wirth
9a47e6f2c8
Expand proc-macros in workspace root, not package root
2024-08-27 13:40:24 +02:00
Lukas Wirth
188c577855
Newtype ErasedFileAstId
2024-08-05 13:46:47 +02:00
Lukas Wirth
5264f86242
Encode edition within FileId in the hir layer
2024-07-18 08:49:10 +02:00