Commit graph

97 commits

Author SHA1 Message Date
Lukas Wirth
8ce30264c8 cargo clippy --fix 2025-07-31 10:55:10 +02:00
Chayim Refael Friedman
b1914e420f Support cfg_select! 2025-07-20 11:56:45 +03:00
Chayim Refael Friedman
de312d0c71 Don't run doctests 2025-06-23 00:50:22 +03:00
Chayim Refael Friedman
1fe060719a shrink_to_fit() in more places
This saves 18mb on `analysis-stats .`, without regressing speed.
2025-04-25 10:55:12 +03: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
Lukas Wirth
500ea05aef chore: Bump dependencies 2025-03-23 08:46:10 +01:00
Lukas Wirth
7edfeb9674 refactor: Remove CrateGraphBuilder::iter_mut 2025-03-16 10:24:15 +01:00
BenjaminBrienen
7535bb4661 cargo fmt 2025-03-15 21:32:01 +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
b685ada098
Merge pull request #19243 from Veykril/push-qrrqsywkwyzp
Allow unsetting default cfgs
2025-03-03 11:42:40 +00:00
Lukas Wirth
5e18ad0770 Allow unsetting default cfgs 2025-02-27 17:34:29 +01:00
BenjaminBrienen
bd7375a58f enable doctest 2025-02-27 14:58:46 +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
Chayim Refael Friedman
074050c242 Support cfg(true) and cfg(false)
As per RFC 3695.
2024-10-27 10:46:49 +02:00
Chayim Refael Friedman
4a06675e9c Gate #[test] expansion under cfg(test).
This will mean users opting to not activate `cfg(test)` will lose IDE experience on them, which is quite unfortunate, but this is unavoidable if we want to avoid false positives on e.g. diagnostics. The real fix is to provide IDE experience even for cfg'ed out code, but this is out of scope for this PR.
2024-09-30 00:12:45 +03:00
Lukas Wirth
d2fe906a62 Remove unnecessary CfgFlag definition in project-model 2024-08-07 14:27:59 +02:00
Vincent Esche
7dec7e92ea Replace [package.repository] = "…" of published crates with [package.repository.workspace] = true 2024-08-06 00:26:42 +02:00
Vincent Esche
624f2ead7b Unify package descriptions by adding references to "rust-analyzer"
With the lack of a README on the individually published library crates and the somewhat cryptic `ra_ap_` prefix it is hard to figure out where those crates belong to, so mentioning "rust-analyzer" feels like auseful hint there.
2024-08-06 00:25:02 +02:00
Vincent Esche
6f329e6d5b Add repository URL for published crates' missing [package.repository] fields 2024-08-06 00:25:02 +02:00
Vincent Esche
b5b0f4bc5a Replace "TBD" with more helpful desciptions in published crates' [package.description] fields 2024-08-06 00:25:02 +02:00
Lukas Wirth
d2dd4f6d5f Split out syntax-bridge into a separate crate 2024-08-05 13:45:00 +02:00
Lukas Wirth
1141c35a4b Make CfgExpr slimmer 2024-07-21 14:50:44 +02:00
Lukas Wirth
c30bdfcc84 Use symbol in cfg 2024-07-16 10:41:42 +02:00
Lukas Wirth
93024ad411 Switch token trees to use Symbols 2024-07-16 10:11:59 +02:00
Lukas Wirth
21a3d01875 Remove inline rust_2018_idioms, unused_lifetimes lint warn, Cargo.toml already enforces this 2024-06-30 15:23:54 +02:00
Lukas Wirth
36c1c77cf9 fix: Fix doc comment desugaring for proc-macros 2024-04-27 13:30:51 +02:00
Lukas Wirth
cdb8c3a327 Fix tests being non-deterministic 2024-04-19 13:22:00 +02:00
Lukas Wirth
a483d3bc37 internal: Thread edition through to parsing/tt-to-syntax-tree routines for macros 2024-04-14 16:02:38 +02:00
Wyatt Herkamp
447de3d788 Review Updates and added tests. 2024-03-11 11:05:59 -04:00
Wyatt Herkamp
79f2651262 Add cfg_attr and cleanup code 2024-03-09 13:25:56 -05:00
Wyatt Herkamp
f45b080965 Starting Fix for cfg stripping 2024-03-08 11:10:29 -05:00
Lukas Wirth
d8ef6c24cc Cleanup convert_path 2024-01-26 19:28:39 +01:00
Lukas Wirth
e320004dad Remove tt -> ast -> tt round trips in attrs lowering 2024-01-26 19:28:39 +01:00
Tetsuharu Ohzeki
efc87092b3 Use Cargo's [workspace.lints.*] to config clippy 2023-12-29 23:51:32 +09:00
Lukas Wirth
7b804552a5 Remove Delimiter::DUMMY_INVISIBLE 2023-12-20 14:00:14 +01:00
Lukas Wirth
f49a2fed3f internal: Move out WithFixture into dev-dep only crate 2023-12-18 15:24:08 +01:00
Igor Matuszewski
a7224c998d Don't explicitly warn against semicolon_in_expressions_from_macros
This has been warn-by-default for two years now and has already been
added to the future-incompat lints in 1.68.
2023-12-05 11:35:09 +01:00
Lukas Wirth
6208960c48 Deduplicate dummy test span maps 2023-11-28 10:55:40 +01:00
Lukas Wirth
30093a6d81 spans always come from real file 2023-11-28 10:55:39 +01:00
Lukas Wirth
e36b3f7b8c Proper span representation with syntax context 2023-11-28 10:55:39 +01:00
Lukas Wirth
890eb17b4e Replace ID based TokenMap with proper relative text-ranges / spans 2023-11-28 10:55:39 +01:00
Ali Bektas
f79e8182c1 v3 2023-11-23 02:15:47 +01:00
Ali Bektas
25e990d753 v3 2023-11-23 02:15:47 +01:00
Ali Bektas
7e4aad5ba5 v2 2023-11-23 02:15:47 +01:00
Ali Bektas
886eaa0a7d Relaxation for crate graph mergin
Partially fixes #15656 . When a crate graph is extended which is the case when new workspaces are added to the project
the rules for deduplication were too strict. One problem that arises from this is that in certain conditions
when we see the same crate having different `CrateOrigin`s the first form would be maintained. This approach however
results in some unwanted results such as making renaming forbidden as this has been recently only made available for
local crates. The given example in #15656 can still not be resolved with this PR as that involves taking inconsistencies
between dependencies into consideration. This will be addressed in a future PR.
2023-11-23 02:15:46 +01:00
Laurențiu Nicola
8ea06c8ec8 Bump arbitrary and derive-arbitrary 2023-11-15 21:22:34 +02:00
Lukas Wirth
853f8a21f7 Fix cfg completions not working 2023-09-08 10:49:15 +02:00
hkalbasi
3a1054fc1c Replace x with it 2023-07-06 17:33:17 +03:30
Lukas Wirth
4fa3f1ef5c Bump serde 2 things 2023-06-22 11:44:10 +02:00
Lukas Wirth
cea84427e0 Allow setting cfgs 2023-05-28 13:43:21 +02:00