rust-analyzer/crates/syntax/src
Chayim Refael Friedman 4eb19df5e9 Use more correct handling of lint attributes
The previous analysis was top-down, and worked on a single file (expanding macros). The new analysis is bottom-up, starting from the diagnostics and climbing up the syntax and module tree.

While this is more efficient (and in fact, efficiency was the motivating reason to work on this), unfortunately the code was already fast enough. But luckily, it also fixes a correctness problem: outline parent modules' attributes were not respected for the previous analysis. Case lints specifically did their own analysis to accommodate that, but it was limited to only them. The new analysis works on all kinds of lints, present and future.

It was basically impossible to fix the old analysis without rewriting it because navigating the module hierarchy must come bottom-up, and if we already have a bottom-up analysis (including syntax analysis because modules can be nested in other syntax elements, including macros), it makes sense to use only this kind of analysis.

Few other bugs (not fundamental ti the previous analysis) are also fixed, e.g. overwriting of lint levels (i.e. `#[allow(lint)] mod foo { #[warn(lint)] mod bar; }`.
2024-09-12 15:24:38 +03:00
..
ast Use more correct handling of lint attributes 2024-09-12 15:24:38 +03:00
parsing Fix edition used for include macro parsing 2024-07-19 20:29:53 +02:00
syntax_editor bundle old root into SyntaxEdit result 2024-09-03 11:20:23 -04:00
validation Implement unsafe attribute parsing 2024-05-06 12:11:29 +02:00
algo.rs Avoid ref when using format! in compiler 2024-07-19 14:41:59 -04:00
ast.rs HasGenericArgs syntax trait 2024-07-07 11:18:28 +02:00
fuzz.rs internal: Thread edition through to parsing/tt-to-syntax-tree routines for macros 2024-04-14 16:02:38 +02:00
hacks.rs Modify hacks::parse_expr_from_str() to take an edition too 2024-08-24 23:46:32 +03:00
lib.rs wip: new syntax tree editor 2024-09-02 00:02:32 -04:00
parsing.rs Fix edition used for include macro parsing 2024-07-19 20:29:53 +02:00
ptr.rs internal: Thread edition through to parsing/tt-to-syntax-tree routines for macros 2024-04-14 16:02:38 +02:00
syntax_editor.rs bundle old root into SyntaxEdit result 2024-09-03 11:20:23 -04:00
syntax_error.rs Run cargo fix --edition-idioms 2022-07-20 15:02:08 +02:00
syntax_node.rs ⬆️ rust-analyzer 2023-02-13 13:55:14 +02:00
ted.rs Complete desugared and resugared async fn in trait impls 2024-09-01 11:22:50 +02:00
tests.rs internal: Remove AbsPathBuf::TryFrom impl that checks too many things at once 2024-08-02 11:08:19 +02:00
token_text.rs Merge commit '457b966b171b09a7e57acb710fbca29a4b3526f0' into sync-from-ra 2023-12-11 11:16:01 +02:00
utils.rs Properly account for editions in names 2024-08-16 16:46:24 +03:00
validation.rs chore: Prefer tracing span shorthand macros 2024-06-06 16:52:25 -07:00