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
Lukas Wirth
5264f86242
Encode edition within FileId in the hir layer
2024-07-18 08:49:10 +02:00
Lukas Wirth
2346a80ab4
Remove Name::to_smol_str
2024-07-16 12:43:58 +02:00
Lukas Wirth
df5f1777b8
More symbol usage
2024-07-16 12:05:16 +02:00
Lukas Wirth
3fe815b0f3
Use Symbol in Name
2024-07-12 16:06:44 +02:00
Lukas Wirth
8df034d453
Shrink mbe's Op
2024-06-24 10:07:32 +02:00
Lukas Wirth
9ba4493918
internal: Improve rooted upmapping
2024-03-12 13:46:58 +01:00
Lukas Wirth
558feeab61
internal: Remove synstructure const hack support
2024-03-11 09:44:40 +01:00
Lukas Wirth
d80d2fcae0
Eagerly lower enum variants in CrateDefMap construction
2024-01-15 10:24:14 +01:00
Lukas Wirth
b6e6d5d3af
internal: Consider all kinds of explicit private imports in find_path
2024-01-11 12:22:04 +01:00
Lukas Wirth
4d3a0dc329
Replace SourceRootCrates hashset output with slice for deterministic order
2024-01-10 14:51:51 +01:00
Lukas Wirth
d60638e5e6
Deduplicate some code
2024-01-05 11:34:18 +01:00
Lukas Wirth
0af780ea3e
Fix symbol_index::Query::search_maps not adhering to case-sensitivity correctly
2024-01-04 19:12:56 +01:00
bors
df94a87ea8
Auto merge of #16139 - jimmyhmiller:master, r=Veykril
...
Make functions in impl have a container name
fixes #16015
2024-01-02 14:08:37 +00:00
Lukas Wirth
071fe4e4e9
Move Intern and Lookup traits to hir-expand
2023-12-20 21:24:20 +01:00
Jimmy Miller
b67b352ac7
Make functions in impl have a container name
...
fixes #16015
2023-12-17 13:44:47 -05:00
Lukas Wirth
1604ad1a6d
Bump DEFAULT_QUERY_SEARCH_LIMIT from 40 to 100
2023-12-12 15:36:22 +01:00
Lukas Wirth
634d588fd7
Simplify
2023-12-06 14:36:39 +01:00
Lukas Wirth
9cb13b6efb
Allow navigation targets to be duplicated when the focus range lies in the macro definition site
2023-12-06 12:38:19 +01:00
Lukas Wirth
c43078f99d
Re-implement InFile wrappers as type aliases over generic InFileWrapper
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
eb6244c5f9
Record import aliases in symbol index
2023-08-18 11:46:35 +02:00
hkalbasi
a481e004b0
Lower const params with a bad id
2023-06-11 00:39:28 +03:30
alibektas
1222869b3e
Fix #14557 . Docs aliases can now be detected and used in searching for workspace symbols
2023-05-24 23:57:24 +02:00
Lukas Wirth
14dc1ac3bf
internal: Shrink ProcMacroExpander from 8 to 4 bytes
2023-05-20 11:31:28 +02:00
Lukas Wirth
d6dcfa5744
internal: Less file parsing for symbol index generation
2023-05-18 08:25:06 +02:00
Lukas Wirth
2e03b198ca
fix: Fix perf regression from symbol index refactor
2023-05-13 17:41:09 +02:00
Lukas Wirth
f501c6a516
Refactor symbol index
2023-05-02 12:11:42 +02:00
Lukas Wirth
e7285507f6
Restructure symbol queries
2023-04-22 08:27:10 +02:00
Lukas Wirth
a2a3fecae3
Option begone part 2
2023-04-16 19:20:48 +02:00
Ryo Yoshida
29c957f973
Lower and handle trait aliases in HIR
2023-03-04 00:24:07 +09:00
OleStrohm
b63234e20b
Cleaned up code
2022-09-12 20:19:49 +01:00
OleStrohm
997fc46efa
Implemented basic enum const eval
2022-09-12 20:19:13 +01:00
Amos Wenger
816f7fe12a
Run cargo fix --edition-idioms
2022-07-20 15:02:08 +02:00
Lukas Wirth
db49ac8734
internal: Record all macro definitions in ItemScope
2022-07-05 11:28:47 +02:00
Jonas Schievink
18ad750786
fix: properly import all types of macros with #[macro_use] again
2022-03-23 14:34:27 +01:00
Lukas Wirth
f9c8646d89
fix symbol index collection not collecting legacy macros
2022-03-09 01:44:20 +01:00
Lukas Wirth
55ec93a337
Remove unnecessary macro_declarations from ItemScope
2022-03-09 00:19:53 +01:00
Lukas Wirth
c04b0f435b
Move hir to new MacroId
2022-03-08 23:51:48 +01:00
Lukas Wirth
45ff51ba22
Make more precise range macro upmapping
2022-01-31 15:53:44 +01:00
Jonas Schievink
18e80e6892
Remove ModuleId
from hir
reexports
2022-01-12 20:21:13 +01:00
Jonas Schievink
09219e10f1
Mostly restore hir
API boundary
2022-01-12 19:56:47 +01:00