Commit graph

710 commits

Author SHA1 Message Date
bors
d9dda8f84f Auto merge of #17279 - Veykril:format_args-escape, r=Veykril
fix: Fix format_args lowering passing incorrect parameters to `rustc_parse_format`
2024-05-22 14:12:22 +00:00
Lukas Wirth
2ff9bab2eb fix: Fix format_args lowering passing incorrect parameters to rustc_parse_format 2024-05-22 16:11:06 +02:00
bors
39e6032445 Auto merge of #17248 - mladedav:dm/delay-clear, r=Veykril
Clear diagnostics only after new ones were received

Closes #15934

This adds a flag inside the global state which controls when old diagnostics are cleared. Now, old diagnostics should be cleared only after at least one new diagnostic is available.
2024-05-22 13:01:08 +00:00
bors
24bf53d993 Auto merge of #17268 - Veykril:signatures, r=Veykril
feat: More callable info

With this PR we retain more info about callables other than functions, allowing for closure parameter type inlay hints to be linkable as well as better signature help around closures and `Fn*` implementors.
2024-05-22 12:48:17 +00:00
Lukas Wirth
b1830a5fe6 Update assists test fixtures 2024-05-22 14:46:33 +02:00
Lukas Wirth
b29c755572 expectify find_path tests 2024-05-22 14:05:24 +02:00
Lukas Wirth
5992af6506 fix: Fix general find-path inconsistencies 2024-05-22 14:05:24 +02:00
roife
719eee2d82 test: add tests for extern preludes resolving in local mods 2024-05-21 20:35:55 +08:00
Laurențiu Nicola
c944b01b81 Bump rustc crates 2024-05-19 11:22:58 +03:00
Laurențiu Nicola
6ead205843 Merge from rust-lang/rust 2024-05-19 11:20:26 +03:00
Laurențiu Nicola
2018426f56 Preparing for merge from rust-lang/rust 2024-05-19 11:20:20 +03:00
Lukas Wirth
6438554bce Show fn traits in signature info for trait implementors 2024-05-18 16:22:59 +02:00
Lukas Wirth
f42e55dfc8 Enable linked locations for closure param inlay hints 2024-05-18 15:06:46 +02:00
Lukas Wirth
4b3d7f6039 Render closure fn trait kind in siganture help 2024-05-18 15:01:37 +02:00
Lukas Wirth
7045044da3 Allow hir::Param to refer to other entity params aside from functions 2024-05-18 12:35:55 +02:00
Lukas Wirth
9ff4ffb817 Update builtin tool list 2024-05-18 10:52:05 +02:00
Luuk Wester
ab86352789 implement assist to switch between doc and normal comments 2024-05-18 02:38:41 +02:00
roife
ea2a16cadb fix: resolve extern prelude for local mods in block modules 2024-05-17 23:29:00 +08:00
Adam Szkoda
9099862687
Correct Neovim 0.10 inlay hints config example 2024-05-17 12:42:17 +02:00
David Mládek
1287e868e9 Clear diagnostics only after new ones were received 2024-05-17 01:30:01 +02:00
bors
57062170c5 Auto merge of #17243 - Veykril:static-lt-hir, r=Veykril
internal: Add StaticLifetime to hir API
2024-05-16 06:04:52 +00:00
Lukas Wirth
b7e194ed82 internal: Add StaticLifetime to hir API 2024-05-16 08:02:51 +02:00
blyxyas
15983f496b Fix typos 2024-05-15 18:55:27 +02:00
Lukas Wirth
2dca5431c4 Use actions/cache again in metrics CI 2024-05-15 15:25:58 +02:00
bors
98d768bf75 Auto merge of #17239 - Veykril:metrics-caching, r=Veykril
internal: Key ignoring the job-id in metrics cache
2024-05-15 11:32:48 +00:00
Lukas Wirth
b5fbde7f1c Key ignoring the job-id in metrics cache 2024-05-15 13:31:11 +02:00
bors
38640806cc Auto merge of #17238 - Veykril:metrics-caching, r=Veykril
Fix metrics workflow not actually updating the toolchain

The install won't persist across jobs
2024-05-15 10:57:26 +00:00
Lukas Wirth
9db0b656e8 Fix metrics workflow not actually updating the toolchain 2024-05-15 12:54:24 +02:00
bors
d5878844a8 Auto merge of #17235 - Veykril:metrics-caching, r=Veykril
internal: Use Swatinem/rust-cache for metrics CI

Current metrics caching uses a base cache action, whereas I think the one we use for general ci works here as well. Saw this while noticing that our metrics CI is broken as it for some reason uses an outdated rust stable? (unsure why that is)
2024-05-15 09:36:33 +00:00
Lukas Wirth
2e0f2a23a4 Bump Swatinem/rust-cache 2024-05-15 09:50:34 +02:00
Lukas Wirth
4b2998d4c5 Use Swatinem/rust-cache for metrics CI 2024-05-15 09:49:42 +02:00
bors
f915c94f38 Auto merge of #17232 - Veykril:build-scripts-keep-going, r=Veykril
fix: Don't emit --keep-going for custom build script commands

Might be the cause for https://github.com/rust-lang/rust-analyzer/issues/17231
2024-05-14 19:28:22 +00:00
Lukas Wirth
dd0ea024d4 fix: Don't emit --keep-going for custom build script commands 2024-05-14 21:26:37 +02:00
bors
652426ce65 Auto merge of #17216 - Young-Flash:mod_with_path, r=Veykril
fix: extract mod to file should respect path attribute

close https://github.com/rust-lang/rust-analyzer/issues/17181
2024-05-14 14:29:00 +00:00
bors
473b262b6c Auto merge of #17227 - Veykril:build-deps-changed-hashes, r=Veykril
fix: Hash file contents to verify whether file actually changed

Fixes https://github.com/rust-lang/rust-analyzer/issues/16580
2024-05-14 10:48:18 +00:00
Lukas Wirth
e32a0a6acc internal: Sort computed runnables 2024-05-14 12:32:48 +02:00
Lukas Wirth
32827d21d8 Hash file contents to verify whether file actually changed 2024-05-14 11:55:12 +02:00
bors
24cd4439ce Auto merge of #17225 - Veykril:expand-macro-interlocked, r=Veykril
Expand macro recursively expands both fp-like and attribute macros when intertwined
2024-05-14 09:22:04 +00:00
Lukas Wirth
13770a2fb0 Track hashes for file contents 2024-05-14 11:21:04 +02:00
bors
b0ecc29a54 Auto merge of #17224 - Veykril:lock-bump, r=Veykril
Bump Cargo.lock
2024-05-14 08:59:34 +00:00
Lukas Wirth
5fa2b06819 Expand macro recursively expands both fp-like and attribute macros intertwined 2024-05-14 10:58:18 +02:00
Lukas Wirth
fc71d49bc1 Bump Cargo.lock 2024-05-14 10:57:02 +02:00
bors
d891ec697a Auto merge of #17221 - Veykril:lazier-validation, r=Veykril
internal: Lazier macro parse tree validation
2024-05-13 15:16:46 +00:00
Lukas Wirth
f1aa040ef6 parse_macro_expansion_error almost never contains values so Option it 2024-05-13 17:02:08 +02:00
Lukas Wirth
490994f9fb Push macro-parsing error calculation out of fundamental queries 2024-05-13 16:56:26 +02:00
bors
6e0c33d1ba Auto merge of #17220 - Veykril:hov-lit, r=Veykril
fix: Improve confusing literal hovers
2024-05-13 10:58:29 +00:00
Lukas Wirth
3e510eb147 Don't render multi-line literal values 2024-05-13 12:56:02 +02:00
Lukas Wirth
60ed071ecc Render literal escaping errors in hovers 2024-05-13 12:51:57 +02:00
bors
197856dca5 Auto merge of #17203 - kilpkonn:collapse_terms, r=Veykril
Fix OOM caused by term search

The issue came from multi Cartesian product for exprs with many (25+) arguments, each having multiple options.
The solution is two fold:
### Avoid blowing up in Cartesian product
**Before the logic was:**
    1. Find expressions for each argument/param - there may be many
    2. Take the Cartesian product (which blows up in some cases)
    4. If there are more than 2 options throw them away by squashing them to `Many`
**Now the logic is:**
    1. Find expressions for each argument/param and squash them to `Many` if there are more than 2 as otherwise we are guaranteed to also have more than 2 after taking the product which means squashing them anyway.
    2. Take the Cartesian product on iterator
    3. Start consuming it one by one
    4. If there are more than 2 options throw them away by squashing them to `Many`  (same as before)

This is also why I had to update some tests as the expressions get squashed to many more eagerly.

### Use fuel to avoid long search times and high memory usage
Now all the tactics use `should_continue:  Fn() -> bool` to chech if they should keep iterating _(Similarly to chalk)_.
This reduces the search times by a magnitude, for example from ~139ms/hole to ~14ms/hole for `ripgrep` crate.
There are slightly less expressions found, but I think speed gain worth it for usability.
Also note that syntactic hits decreases more because of squashing so you simple need to run search multiple times to get full terms.
Also the worst case time (For example `nalgebra` crate cus it has tons of generics) has search times mostly under 200ms.

Benchmarks on `ripgrep` crate
Before:
```
Tail Expr syntactic hits: 291/1692 (17%)
Tail Exprs found: 1253/1692 (74%)
Term search avg time: 139ms
````
After:
```
Tail Expr syntactic hits: 239/1692 (14%)
Tail Exprs found: 1226/1692 (72%)
Term search avg time: 14ms
```
2024-05-13 10:30:12 +00:00
Lukas Wirth
a73973934f Fix literal hovers being confusing and wrong for floats 2024-05-13 12:26:45 +02:00