rust-analyzer/crates/parser/src
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
..
grammar fix: move use parsing to outer match arm 2024-07-23 22:36:46 +01:00
syntax_kind internal: Properly check the edition for edition dependent syntax kinds 2024-08-15 15:57:47 +02:00
tests Parse contextual dyn keyword properly in edition 2015 2024-07-19 20:20:30 +02:00
edition.rs Encode edition within FileId in the hir layer 2024-07-18 08:49:10 +02:00
event.rs Merge commit '141fc695dc' into sync-from-ra 2023-11-16 22:27:35 +02:00
grammar.rs Derive kinds information from ungrammar file 2024-07-17 10:04:45 +02:00
input.rs internal: rename 2021-12-25 22:02:26 +03:00
lexed_str.rs internal: Properly check the edition for edition dependent syntax kinds 2024-08-15 15:57:47 +02:00
lib.rs Derive kinds information from ungrammar file 2024-07-17 10:04:45 +02:00
output.rs ⬆️ rust-analyzer 2023-02-13 13:55:14 +02:00
parser.rs Fix edition used for include macro parsing 2024-07-19 20:29:53 +02:00
shortcuts.rs internal: Properly check the edition for edition dependent syntax kinds 2024-08-15 15:57:47 +02:00
syntax_kind.rs Properly account for editions in names 2024-08-16 16:46:24 +03:00
tests.rs Parse contextual dyn keyword properly in edition 2015 2024-07-19 20:20:30 +02:00
token_set.rs internal: simplify TokenSet implementation 2024-04-15 17:33:09 +03:00