Commit graph

1433 commits

Author SHA1 Message Date
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
Lukas Wirth
b98597f06d Re-enable proc-macros 2023-11-28 16:28:56 +01:00
David Barsky
914a1570e2 internal: bump triomphe to 0.1.10 2023-11-28 10:27:17 -05:00
Lukas Wirth
98cfdde8ba Thinner TokenMap 2023-11-28 10:56:25 +01:00
Lukas Wirth
30093a6d81 spans always come from real file 2023-11-28 10:55:39 +01:00
Lukas Wirth
890eb17b4e Replace ID based TokenMap with proper relative text-ranges / spans 2023-11-28 10:55:39 +01:00
Laurențiu Nicola
3ccde009cb Switch to our own salsa fork 2023-11-26 13:06:36 +02:00
Laurențiu Nicola
fc880be491 Bump chalk 2023-11-25 20:38:11 +02:00
Laurențiu Nicola
aadeb66d03 Bump ra-ap-rustc_index and ra-ap-rustc_abi 2023-11-25 20:36:45 +02:00
Laurențiu Nicola
c01679eb7b Bump ra-ap-rustc_lexer 2023-11-25 20:36:06 +02:00
Laurențiu Nicola
fa74ac8457 Bump ra-ap-rustc_parse_format 2023-11-25 20:35:26 +02:00
Marc Schreiber
81c2d3552e Cancelable Initialization
This commit provides additional initialization methods to Connection in
order to support CTRL + C sigterm handling.
2023-11-21 21:29:33 +01:00
Laurențiu Nicola
480cb60be3 Bump libc 2023-11-16 21:48:49 +02:00
Laurențiu Nicola
da24b6fb12 Bump memchr 2023-11-15 21:24:20 +02:00
Laurențiu Nicola
8ea06c8ec8 Bump arbitrary and derive-arbitrary 2023-11-15 21:22:34 +02:00
Laurențiu Nicola
c6fad55c98 Bump bitflags 2023-11-15 21:20:47 +02:00
Laurențiu Nicola
3ed27d21f2 Bump cargo_metadata 2023-11-15 21:18:49 +02:00
Laurențiu Nicola
2814d646cb Bump rayon 2023-11-15 21:14:56 +02:00
Laurențiu Nicola
b18ce4f8ea Bump xshell 2023-11-15 21:12:18 +02:00
Laurențiu Nicola
83e6d7938c Bump tracing-tree again 2023-11-15 21:08:35 +02:00
Laurențiu Nicola
c66084b9c6 Bump ra-ap-rustc_index and ra-ap-rustc_abi 2023-11-15 13:42:13 +02:00
Laurențiu Nicola
b267f6b071 Bump ra-ap-rustc_lexer 2023-11-15 13:40:43 +02:00
Laurențiu Nicola
829cf8db4c Bump dissimilar 2023-11-15 13:34:56 +02:00
Laurențiu Nicola
572583262c Bump text-size 2023-11-15 13:33:03 +02:00
Laurențiu Nicola
a1f81a7e75 Bump chalk 2023-11-15 13:31:45 +02:00
Laurențiu Nicola
c4dfa06b9d Bump tracing-log 2023-11-15 13:25:19 +02:00
Laurențiu Nicola
1fc056ec93 Bump indexmap 2023-11-15 13:21:34 +02:00
Laurențiu Nicola
2bfd6b659d Bump serde_json 2023-11-15 13:17:36 +02:00
Laurențiu Nicola
970a796368 Bump serde 2023-11-15 13:16:07 +02:00
Laurențiu Nicola
cb8434e594 Bump either 2023-11-15 13:07:36 +02:00
Laurențiu Nicola
2dbdaa247b Bump tracing-subscriber 2023-11-15 13:04:39 +02:00
Laurențiu Nicola
d83620a5ba Bump tracing-tree 2023-11-15 13:01:54 +02:00
Laurențiu Nicola
f53368dd3f Bump tracing 2023-11-15 13:00:32 +02:00
Laurențiu Nicola
f66df10f87 Bump itertools 2023-11-15 12:53:56 +02:00
Laurențiu Nicola
dfc885e0fd Bump anyhow 2023-11-15 12:49:32 +02:00
hkalbasi
1086b294c2 update rustc dependencies 2023-11-08 01:16:47 +03:30
Roberto Bampi
99ec3aa8a3 scip: update crate to version 0.3.1.
While the git repo has been updated constantly, crates.io has only now
been updated after more than a year of activity.
2023-10-26 16:20:06 +02:00
Lukas Wirth
40acc5250f Update rustc_abi dependency 2023-10-15 18:57:40 +02:00
bors
aaa1e8e1b8 Auto merge of #15618 - shogo-nakano-desu:internal/port-anymap, r=Veykril
internal: port anymap

## Description
- The anymap crate has been ported. During this process, unnecessary features for rust-analyzer have been removed.
- From the tests that were checking the existing licenses, the anymap license (`BlueOak-1.0.0 OR MIT OR Apache-2.0`) has been removed.

## Requests
- While porting the code this time, I have tried to respect the original author's intentions and have kept the comments/codes as much as possible. Please don't hesitate to tell me if you think the comments/codes also need to be appropriately modified.
- If there are any necessary changes regarding the licensing or anything else, please let me know so I can fix them.

## Issue
https://github.com/rust-lang/rust-analyzer/issues/15500
2023-10-09 08:40:54 +00:00
Henry Chen
963ba59579 minor: update libc to 0.2.148
`cargo update -p libc`
2023-09-25 10:13:25 +08:00
shogo-nakano-desu
6212182739 refactor: remove hashbrown deps since we can use std 2023-09-20 09:02:10 +09:00
shogo-nakano-desu
f671b0b864 refactor: move implementation inside anymap crate into stdx crate 2023-09-20 09:02:10 +09:00
shogo-nakano-desu
4b3257a365 refactor: port anymap 2023-09-20 09:02:05 +09:00
Wilfred Hughes
3a63255d2a Update chalk version 2023-09-19 16:56:59 -07:00
hkalbasi
f4704bc8ae Switch to in-tree rustc dependencies with a cfg flag 2023-09-15 18:10:11 +03:30
Lukas Wirth
10b0cd7047 Replace format-args parser with upstream fork 2023-09-07 11:37:59 +02:00
bors
f29867bd26 Auto merge of #15559 - Veykril:builtin-format-args, r=Veykril
Implement builtin#format_args, using rustc's format_args parser

`format_args!` now expands to `builtin#format_args(template, args...)`, the actual expansion now instead happens in lowering where we desugar this expression by using lang paths.

As a bonus, we no longer need to evaluate `format_args` as an eager macro which means less macro expansions overall -> less cache thrashing!

Fixes https://github.com/rust-lang/rust-analyzer/issues/15082
2023-09-06 17:44:33 +00:00
Lukas Wirth
abe8f1ece4 Implement builtin#format_args, using rustc's format_args parser 2023-09-05 19:19:46 +02:00
Roberto Bampi
4f22e1a187 Update notify to 6.1.1
Unlike version 6.0.1, this does not pull windows-sys 0.4.5 as observed in #15077.

$ cargo tree --target=x86_64-pc-windows-gnu --charset=ascii | grep windows-sys

|           |   `-- windows-sys v0.42.0
|   |   |   |   |   |       `-- windows-sys v0.42.0 (*)
|       `-- windows-sys v0.48.0
    |   |   `-- windows-sys v0.48.0 (*)
    |   `-- windows-sys v0.48.0 (*)
|   `-- windows-sys v0.48.0 (*)
|   `-- windows-sys v0.42.0 (*)
2023-09-04 18:00:12 +02:00
Lukas Wirth
c09f175d59 Less once_cell more std 2023-09-01 17:30:59 +02:00