rust/crates
bors e91fdf7860 Auto merge of #15959 - Veykril:macro-shower3, r=lnicola
TokenMap -> SpanMap rewrite

Opening early so I can have an overview over the full diff more easily, still very unfinished and lots of work to be done.

The gist of what this PR does is move away from assigning IDs to tokens in arguments and expansions and instead gives the subtrees the text ranges they are sourced from (made relative to some item for incrementality). This means we now only have a single map per expension, opposed to map for expansion and arguments.

A few of the things that are not done yet (in arbitrary order):
- [x] generally clean up the current mess
- [x] proc-macros, have been completely ignored so far
- [x] syntax fixups, has been commented out for the time being needs to be rewritten on top of some marker SyntaxContextId
- [x] macro invocation syntax contexts are not properly passed around yet, so $crate hygiene does not work in all cases (but most)
  - [x] builtin macros do not set spans properly, $crate basically does not work with them rn (which we use)
~~- [ ] remove all uses of dummy spans (or if that does not work, change the dummy entries for dummy spans so that tests will not silently pass due to havin a file id for the dummy file)~~
  - [x] de-queryfy `macro_expand`, the sole caller of it is `parse_macro_expansion`, and both of these are lru-cached with the same limit so having it be a query is pointless
- [x] docs and more docs
- [x] fix eager macro spans and other stuff
  - [x] simplify include! handling
- [x] Figure out how to undo the sudden `()` expression wrapping in expansions / alternatively prioritize getting invisible delimiters working again
- [x] Simplify InFile stuff and HirFIleId extensions
~~- [ ] span crate containing all the file ids, span stuff, ast ids. Then remove the dependency injection generics from tt and mbe~~

Fixes https://github.com/rust-lang/rust-analyzer/issues/10300
Fixes https://github.com/rust-lang/rust-analyzer/issues/15685
2023-12-04 19:59:53 +00:00
..
base-db Some more minor cleanups 2023-12-02 17:04:13 +01:00
cfg Deduplicate dummy test span maps 2023-11-28 10:55:40 +01:00
flycheck Merge commit '141fc695dca1df7cfc3c9803972ec19bb178dcbc' into sync-from-ra 2023-11-16 22:27:35 +02:00
hir Auto merge of #15959 - Veykril:macro-shower3, r=lnicola 2023-12-04 19:59:53 +00:00
hir-def Auto merge of #15959 - Veykril:macro-shower3, r=lnicola 2023-12-04 19:59:53 +00:00
hir-expand Some final touches 2023-12-03 20:20:59 +01:00
hir-ty Auto merge of #15959 - Veykril:macro-shower3, r=lnicola 2023-12-04 19:59:53 +00:00
ide Auto merge of #15959 - Veykril:macro-shower3, r=lnicola 2023-12-04 19:59:53 +00:00
ide-assists Merge commit 'e402c494b7c7d94a37c6d789a216187aaf9ccd3e' into sync-from-ra 2023-12-04 09:19:15 +02:00
ide-completion Auto merge of #15959 - Veykril:macro-shower3, r=lnicola 2023-12-04 19:59:53 +00:00
ide-db Cleanup FileId stuff 2023-12-02 19:32:53 +01:00
ide-diagnostics Auto merge of #15959 - Veykril:macro-shower3, r=lnicola 2023-12-04 19:59:53 +00:00
ide-ssr Merge commit '141fc695dca1df7cfc3c9803972ec19bb178dcbc' into sync-from-ra 2023-11-16 22:27:35 +02:00
intern Merge commit '3b7c7f97e4a7bb253a8d398ee4f8346f6cf2817b' into sync-from-ra 2023-11-08 08:15:03 +02:00
limit
load-cargo Pass calling span through to builtin macro expansions 2023-12-01 14:11:57 +01:00
mbe Some final touches 2023-12-03 20:20:59 +01:00
parser Merge commit 'e402c494b7c7d94a37c6d789a216187aaf9ccd3e' into sync-from-ra 2023-12-04 09:19:15 +02:00
paths
proc-macro-api Pass calling span through to builtin macro expansions 2023-12-01 14:11:57 +01:00
proc-macro-srv Pass calling span through to builtin macro expansions 2023-12-01 14:11:57 +01:00
proc-macro-srv-cli Re-enable proc-macros 2023-11-28 16:28:56 +01:00
proc-macro-test Merge commit '141fc695dca1df7cfc3c9803972ec19bb178dcbc' into sync-from-ra 2023-11-16 22:27:35 +02:00
profile Merge commit '141fc695dca1df7cfc3c9803972ec19bb178dcbc' into sync-from-ra 2023-11-16 22:27:35 +02:00
project-model Merge commit '237712fa314237e428e7ef2ab83b979f928a43a1' into sync-from-ra 2023-11-27 12:40:39 +02:00
rust-analyzer Auto merge of #15959 - Veykril:macro-shower3, r=lnicola 2023-12-04 19:59:53 +00:00
rustc-dependencies Merge commit '237712fa314237e428e7ef2ab83b979f928a43a1' into sync-from-ra 2023-11-27 12:40:39 +02:00
sourcegen Merge commit '141fc695dca1df7cfc3c9803972ec19bb178dcbc' into sync-from-ra 2023-11-16 22:27:35 +02:00
stdx spans always come from real file 2023-11-28 10:55:39 +01:00
syntax Replace ID based TokenMap with proper relative text-ranges / spans 2023-11-28 10:55:39 +01:00
test-utils Auto merge of #15959 - Veykril:macro-shower3, r=lnicola 2023-12-04 19:59:53 +00:00
text-edit Merge commit '141fc695dca1df7cfc3c9803972ec19bb178dcbc' into sync-from-ra 2023-11-16 22:27:35 +02:00
toolchain
tt Some final touches 2023-12-03 20:20:59 +01:00
vfs Some final touches 2023-12-03 20:20:59 +01:00
vfs-notify Merge commit '141fc695dca1df7cfc3c9803972ec19bb178dcbc' into sync-from-ra 2023-11-16 22:27:35 +02:00