124 Commits

Author SHA1 Message Date
bit-aloo
41dade9006
return error on combination of bidirectional message and json framing 2025-12-23 23:14:47 +05:30
bit-aloo
336f025424
remove internal callbacks, and move callback to rust-analyzer level 2025-12-23 07:58:53 +05:30
bit-aloo
a79fa074fe
remove envelop and keep it simple 2025-12-22 20:04:35 +05:30
bit-aloo
f010e28689
remove request_id, rename postcardNew to BidirectionalPostcardPrototype and remove JsonNew 2025-12-22 19:21:05 +05:30
bit-aloo
19e816d3bf
change request id to u32 to make powerpc happy 2025-12-18 14:47:07 +05:30
bit-aloo
28a3b808c4
add request id to requests 2025-12-18 10:21:34 +05:30
bit-aloo
376bca919e
Add bidirectional messaging proc-macro-srv 2025-12-15 19:28:13 +05:30
The rustc-josh-sync Cronjob Bot
f6c67ed0a4 Format code 2025-12-15 04:30:49 +00:00
Jieyou Xu
acb575c6ab
rust-analyzer: prep crates for testing against in-tree rustc_private 2025-12-11 20:22:49 +08:00
Lukas Wirth
d659c2eab3 fix: Disable postcard use temporarily 2025-12-07 14:52:10 +01:00
Lukas Wirth
633cff2520
Merge pull request #21195 from Veykril/push-nnzprznzurwz
fix: More proc-macro-srv proto fixes
2025-12-03 16:15:37 +00:00
Lukas Wirth
c3afa4406f fix: More proc-macro-srv proto fixes 2025-12-03 16:17:51 +01:00
Lukas Wirth
686320cc52
Merge pull request #21188 from Wilfred/fix_rustdoc_and_add_ci
Fix rustdoc warnings and add CI
2025-12-03 08:51:04 +00:00
Lukas Wirth
5ca77bd0bc fix: Fix proc-macro-srv passing invalid extra none group to proc-macros 2025-12-01 16:28:18 +01:00
Wilfred Hughes
86bc07e91a Fix rustdoc warnings and add CI
rustdoc has a separate environment variable for banning warnings, so
set that in the GitHub action configuration.

https://github.com/rust-lang/cargo/issues/8424#issuecomment-1070988443

Fix all the rustdoc warnings on unknown types or functions. I've
updated references wherever it's obvious, otherwise I've replaced the
rustdoc link with plain backticks.

There were also some cases where rustdoc links referred to private
APIs. I've disabled the rustdoc private API warning in those crates.
2025-12-01 13:06:15 +00: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