Commit graph

77 commits

Author SHA1 Message Date
Chayim Refael Friedman
de312d0c71 Don't run doctests 2025-06-23 00:50:22 +03:00
Lukas Wirth
03f1003637 chore: Start infesting ide crates with 'db lifetime 2025-06-17 10:42:38 +02:00
Chayim Refael Friedman
87529e8631 Properly implement might_be_inside_macro_call() using semantic information instead of syntactical hacks
And rename it to `is_inside_macro_call()` accordingly.
2025-05-25 20:15:58 +03:00
Chayim Refael Friedman
c58ddafe90 Make HirFileId, EditionedFileId and macro files Salsa struct
And make more queries non-interned.

Also flip the default for queries, now the default is to not intern and to intern a query you need to say `invoke_interned`.
2025-04-19 22:10:52 +03:00
Lukas Wirth
1e1571e1c8 fix: Fix new nightly lints 2025-03-31 13:27:54 +02:00
Lukas Wirth
500ea05aef chore: Bump dependencies 2025-03-23 08:46:10 +01:00
Lukas Wirth
d4122434dd chore: Remove unused dependencies 2025-03-23 08:08:17 +01:00
BenjaminBrienen
7535bb4661 cargo fmt 2025-03-15 21:32:01 +01:00
David Barsky
788232b355 internal: don't panic when the crate graph isn't ready #19351 2025-03-13 15:14:08 -04: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
David Barsky
74620e64ec internal: port rust-analyzer to new Salsa 2025-03-10 13:30:51 -04:00
Chayim Refael Friedman
2fc0dc0f13 Pass the target crate in HirFormatter
This is required to format evaluated consts, because we need trait env, and it needs the crate (currently it uses the last crate in topological order, which is wrong, the next commit will fix that).
2025-03-06 21:00:05 +02:00
BenjaminBrienen
bd7375a58f enable doctest 2025-02-27 14:58:46 +01:00
Lukas Wirth
07a09c154e
Merge pull request #19015 from Wilfred/mdbook
manual: Convert to mdbook
2025-01-28 16:19:37 +00:00
Lukas Wirth
b31f53e0d6 Fix flyimport not filtering via stability of import path 2025-01-25 12:18:54 +01:00
Wilfred Hughes
deda58e8f1 manual: Convert to mdbook
Split manual.adoc into markdown files, one for each chapter.

For the parts of the manual that are generated from source code doc
comments, update the comments to use markdown syntax and update the
code generators to write to `generated.md` files.

For the weekly release, stop copying the .adoc files to the
`rust-analyzer/rust-analyzer.github.io` at release time. Instead,
we'll sync the manual hourly from this repository.

See https://github.com/rust-analyzer/rust-analyzer.github.io/pull/226
for the sync. This PR should be merged first, and that PR needs to be
merged before the next weekly release.

This change is based on #15795, but rebased and updated. I've also
manually checked each page for markdown syntax issues and fixed any I
encountered.

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
Co-authored-by: Josh Rotenberg <joshrotenberg@gmail.com>
2025-01-24 13:23:22 -08:00
Lukas Wirth
28fbecff42 Show expansion errors in expand_macro feature 2024-12-13 09:36:03 +01:00
Lukas Wirth
65c0b29720 Fix parsing of parenthesized type args and RTN 2024-12-04 11:48:47 +01:00
Lukas Wirth
64f56f458f Move text-edit into ide-db 2024-10-28 14:37:41 +01:00
Lukas Wirth
98935325ca minor: Remove intermediate allocations 2024-10-24 13:34:32 +02:00
David Barsky
ccee36e8dd chore: rename salsa to ra_salsa 2024-10-14 10:09:22 -04:00
Chayim Refael Friedman
9d3368f2c2 Properly account for editions in names
This PR touches a lot of parts. But the main changes are changing
`hir_expand::Name` to be raw edition-dependently and only when necessary
(unrelated to how the user originally wrote the identifier),
and changing `is_keyword()` and `is_raw_identifier()` to be edition-aware
(this was done in #17896, but the FIXMEs were fixed here).

It is possible that I missed some cases, but most IDE parts should properly
escape (or not escape) identifiers now.

The rules of thumb are:

 - If we show the identifier to the user, its rawness should be determined
   by the edition of the edited crate. This is nice for IDE features,
   but really important for changes we insert to the source code.
 - For tests, I chose `Edition::CURRENT` (so we only have to (maybe) update
   tests when an edition becomes stable, to avoid churn).
 - For debugging tools (helper methods and logs), I used `Edition::LATEST`.
2024-08-16 16:46:24 +03: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
b5b0f4bc5a Replace "TBD" with more helpful desciptions in published crates' [package.description] fields 2024-08-06 00:25:02 +02:00
Lukas Wirth
fcb88832de Simplify FileDelegate 2024-08-05 13:03:03 +02:00
Lukas Wirth
d235d09bf9 Parse try as a keyword only in edition 2018 and up 2024-07-19 15:43:20 +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
2346a80ab4 Remove Name::to_smol_str 2024-07-16 12:43:58 +02:00
bors
a5b21ea0aa Auto merge of #17555 - Veykril:grammar-inline, r=Veykril
internal: Inline generated syntax methods
2024-07-07 09:21:04 +00:00
Lukas Wirth
c08d419fba HasGenericArgs syntax trait 2024-07-07 11:18:28 +02:00
Shohei Wada
3725ab3146 squash. 2024-07-02 01:52:34 +09: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
8520a0c585 Thread more HasSource::source calls through Semantics for caching 2024-06-10 10:33:07 +02:00
David Barsky
b75301cec8 internal: refactor prefer_no_std/prefer_prelude bools into a struct 2024-05-22 20:46:30 +02:00
Lukas Wirth
c88b421853 fix: Fix general find-path inconsistencies 2024-05-22 14:05:24 +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
Lukas Wirth
9ba4493918 internal: Improve rooted upmapping 2024-03-12 13:46:58 +01:00
Tetsuharu Ohzeki
ae78dcae75 ide-ssr: Fix warnings about clippy str_to_string rule 2024-02-10 01:00:40 +09:00
Lukas Wirth
9e8a0fae0c Lint debug prints and disallowed types with clippy 2024-02-01 17:57:27 +01:00
Lukas Wirth
8a5829cf28 Re-order mod declarations 2024-01-27 11:02:34 +01:00
Johann Hemmann
0df30499d0 only_used_in_recursion 2024-01-19 17:31:01 +01:00
Johann Hemmann
3839f9a9a2 needless_borrow 2024-01-19 17:31:01 +01:00
Johann Hemmann
60dda08266 manual_find 2024-01-19 17:31:00 +01:00
Johann Hemmann
fad4fa163c cargo clippy --fix 2024-01-18 13:59:49 +01:00
Tetsuharu Ohzeki
efc87092b3 Use Cargo's [workspace.lints.*] to config clippy 2023-12-29 23:51:32 +09:00
Lukas Wirth
f49a2fed3f internal: Move out WithFixture into dev-dep only crate 2023-12-18 15:24:08 +01:00
Lukas Wirth
35620306a6 internal: Move proc-macro knowledge out of base-db 2023-12-18 12:37:18 +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