about summary refs log tree commit diff
path: root/src/tools/rust-analyzer/crates/proc-macro-api
AgeCommit message (Collapse)AuthorLines
2025-07-31Add version command to proc-macro-srvLukas Wirth-10/+17
2025-07-30Abtract away json protocol for proc-macro-srvLukas Wirth-197/+311
2025-06-23Don't run doctestsChayim Refael Friedman-0/+1
2025-06-12Support spans with proc macro servers from before the ast id changesChayim Refael Friedman-20/+68
The only thing changed is the value of the fixup ast id, so we just swap it.
2025-06-12Use stable AST IDsChayim Refael Friedman-9/+18
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-04-22Adjust for `salsa::Id::from_u32()` being unsafeChayim Refael Friedman-1/+3
This impacts our manual `salsa::Id` wrappers. I refactored them a bit to improve safety.
2025-04-21Merge pull request #19644 from ChayimFriedman2/const-symsLukas Wirth-2/+2
internal: Make predefined symbols `const` instead of `static`
2025-04-21Remove unnecessary predefined symbol clonesChayim Refael Friedman-2/+2
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-19allow using `null` to unset an environment variablejyn-12/+23
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-03-31fix: Fix new nightly lintsLukas Wirth-3/+2
2025-03-29fix: Fix, clarify and require a value for `proc_macro_cwd` of `CrateData`Lukas Wirth-2/+2
2025-03-17Merge pull request #19329 from Shourya742/2025-03-10-add-proc-macro-api-docLukas Wirth-1/+71
doc: add doc to proc-macro-api
2025-03-15cargo fmtBenjaminBrienen-10/+10
2025-03-15refactor: Simplify by removing ? operatorNeil-2/+1
`out.flush()` already returns a `io::Result<()>`, so there is no need for `?` operator and `Ok(())`
2025-03-15chore: Remove legacy `SyntaxContextId` re-exportLukas Wirth-14/+12
2025-03-12Salsify the crate graphChayim Refael Friedman-2/+8
I.e. make it not one giant input but multiple, for incrementality and decreased memory usage for Salsa 3 reasons.
2025-03-10doc: add doc to proc-macro-apibit-aloo-1/+71
2025-02-27enable doctestBenjaminBrienen-1/+0
2025-01-09Merge pull request #18861 from ChayimFriedman2/await-editionLukas Wirth-10/+10
fix: Make edition per-token, not per-file
2025-01-09Make edition per-token, not per-fileChayim Refael Friedman-10/+10
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-06minor: New clippy lintsLukas Wirth-3/+3
2025-01-02Store token trees in contiguous `Vec` instead of as a treeChayim Refael Friedman-196/+201
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.
2024-12-30Move proc-macro protocol into legacy moduleLukas Wirth-31/+36
2024-12-30Decouple proc-macro server protocol from the server implementationLukas Wirth-26/+17
2024-12-29Enforce a current directory being set for spawned commandsLukas Wirth-0/+1
2024-12-20Revert "internal: Drop proc-macro server support for ~1.66.0 and older ↵Lukas Wirth-30/+48
toolchains"
2024-12-20internal: Split serde derive feature into `serde_derive` usageLukas Wirth-3/+5
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-18Remove salsa from proc-macro server dep treeLukas Wirth-8/+5
2024-12-12internal: Drop proc-macro server support for ~1.66.0 and older toolchainsLukas Wirth-48/+30
2024-11-02Improve error message for too new proc-macro serverbenluiwj-2/+2
2024-10-22Fix new nightly lintsLukas Wirth-2/+2
2024-09-11Properly set the working directory for proc-macro executionLukas Wirth-2/+1
2024-08-27Expand proc-macros in workspace root, not package rootLukas Wirth-1/+2
2024-08-06Replace `[package.repository] = "…"` of published crates with ↵Vincent Esche-1/+1
`[package.repository.workspace] = true`
2024-08-06Apply Veykril's change suggestionsVincent Esche-1/+1
2024-08-06Add repository URL for published crates' missing `[package.repository]` fieldsVincent Esche-0/+1
2024-08-06Replace `"TBD"` with more helpful desciptions in published crates' ↵Vincent Esche-1/+1
`[package.description]` fields
2024-08-05Newtype ErasedFileAstIdLukas Wirth-12/+7
2024-07-18Encode edition within FileId in the hir layerLukas Wirth-5/+7
2024-07-16Switch token trees to use SymbolsLukas Wirth-19/+19
2024-07-15Fix incorrect encoding of literals in the proc-macro-api on version 4Lukas Wirth-65/+108
2024-07-15Encode ident rawness and literal kind separately in tt::LeafLukas Wirth-24/+134
2024-07-01Improve error message when the proc-macro server unexpectedly exitsLukas Wirth-29/+55
2024-06-30Arc proc-macro expander pathsLukas Wirth-3/+5
2024-06-30Abstract proc-macro-srv protocol formatLukas Wirth-35/+51
2024-06-30SimplifyLukas Wirth-14/+13
2024-06-30Faster env snapshotting in proc-macro-srvLukas Wirth-32/+43
2024-06-30Remove inline `rust_2018_idioms, unused_lifetimes` lint warn, Cargo.toml ↵Lukas Wirth-2/+0
already enforces this
2024-06-30Move interior mutability into ProcMacroSrvProcessLukas Wirth-43/+31
2024-06-30Move dylib version stuff to proc-macro-srvLukas Wirth-173/+1