Commit Graph

15496 Commits

Author SHA1 Message Date
XFFXFF 0121cc1e29 make generated test pass and make tidy happy 2022-06-11 07:11:56 +08:00
XFFXFF bb62180714 add more tests and some doc 2022-06-11 07:11:56 +08:00
XFFXFF 872536821c Make add_label_to_loop basically work 2022-06-11 07:11:56 +08:00
bors 9ef01d0895 Auto merge of #12490 - yue4u:fix/show-enum-in-fresh-use-tree, r=Veykril
fix: complete non-std enum at the start of `use` completions

close: #12421
2022-06-10 20:33:17 +00:00
bors 7b663a3a4a Auto merge of #12464 - harpsword:fix-inline-variable-mismatched-type, r=Veykril
feat: fix inline variable produce mismatched type

wrap reference for RefExpr initializer to fix #12453
2022-06-10 20:24:06 +00:00
bors 0bbead9fa0 Auto merge of #12473 - yue4u:fix/no-enum-parens-in-use, r=Veykril
fix: avoid adding enum parens in use path

close #12420
2022-06-10 20:03:29 +00:00
bors e9d3fe0484 Auto merge of #12502 - Veykril:deps, r=Veykril
internal: Bump Dependencies
2022-06-10 19:51:04 +00:00
Lukas Wirth 76ae5434fa internal: Bump Dependencies 2022-06-10 17:30:02 +02:00
bors f58c26e0ba Auto merge of #12501 - Veykril:dashmap, r=Veykril
internal: Update dashmap and freeze its version
2022-06-10 14:20:46 +00:00
Lukas Wirth 0cf677ab42 internal: Update dashmap and freeze its version 2022-06-10 16:19:52 +02:00
yue4u 2942863709 feat: append :: after 2022-06-09 16:45:46 +09:00
bors 79a4a464b0 Auto merge of #12487 - lukechu10:master, r=lnicola
minor: hide param inlay hint when argument is fn-like macro with similar name

Closes #12486
2022-06-08 14:55:17 +00:00
bors b967f1797c Auto merge of #12493 - bjorn3:fix_warnings, r=lnicola
Fix a couple of weak warnings found by rust-analyzer itself
2022-06-08 14:46:40 +00:00
Luke Chu 6079eeb1bf Hide param inlay hint when argument is fn-like macro with similar name 2022-06-08 14:37:57 +00:00
bjorn3 c81608c6d2 Fix a couple of weak warnings found by rust-analyzer itself 2022-06-08 14:35:11 +00:00
bjorn3 f9e1ff6846 Add doc comment 2022-06-08 14:31:36 +00:00
bjorn3 c6827e2f47 Rustfmt 2022-06-08 14:22:17 +00:00
bjorn3 a07b3103b1 Add proc macro ABI for rustc 1.63 2022-06-08 13:41:10 +00:00
yue4u 55bc693356 fix: show non-std enum in a fresh use tree completion 2022-06-08 20:55:16 +09:00
KOLANICH b3d2012659 Remove the unneeded destructuring assignment in run in project-model/src/build_scripts.rs 2022-06-06 14:02:34 +03:00
Lukas Wirth 0be31d945e fix: Fix trait impl completions using wrong insert position 2022-06-05 20:29:36 +02:00
yue4u 11693dad88 fix: avoid adding enum parens in use 2022-06-06 01:34:01 +09:00
bors 6d3396a492 Auto merge of #12466 - lnicola:worker-thread-stack, r=lnicola
Increase worker thread stack and name them

CC #11370
2022-06-05 07:59:42 +00:00
Lukas Wirth d38b7b88c6 minor: Don't log cancelled diagnostics 2022-06-05 01:38:46 +02:00
Lukas Wirth fbffe73612 fix: Fix match to if let assist for wildcard pats 2022-06-05 01:02:24 +02:00
Laurențiu Nicola 0b9cd8a468 Increase worker thread stack and name them 2022-06-04 20:48:51 +03:00
Lukas Wirth 62fede212a Only record build script outputs when the output has been changed 2022-06-04 15:04:56 +02:00
harpsword 061c5ef075 feat: fix inline variable produce mismatched type
wrap reference for RefExpr initializer
2022-06-04 17:07:28 +08:00
bors 312913a640 Auto merge of #12461 - Veykril:completions, r=Veykril
Move trait_impl completion analysis into CompletionContext
2022-06-03 18:49:37 +00:00
Lukas Wirth a2a74bf278 Remove some of the unnecessary helpfer functions from CompletionContext 2022-06-03 20:49:25 +02:00
Lukas Wirth a0c1816e3a Simplify 2022-06-03 19:55:30 +02:00
Lukas Wirth 98c0578f15 Move trait_impl completion analysis into CompletionContext 2022-06-03 19:49:02 +02:00
bors d06d0f8774 Auto merge of #12459 - Veykril:completions, r=Veykril
internal: Clean up keyword completion handling

https://github.com/rust-lang/rust-analyzer/issues/12144
2022-06-03 15:20:30 +00:00
bors d0a7ad4a7f Auto merge of #12457 - Veykril:logging, r=Veykril
internal: Don't log default build script outputs
2022-06-03 15:11:02 +00:00
bors 43d9c3f649 Auto merge of #12460 - Veykril:move-guard, r=Veykril
minor: Reduce move-guard trigger range
2022-06-03 15:00:26 +00:00
Lukas Wirth b34e27d25e minor: Reduce move-guard trigger range 2022-06-03 17:00:03 +02:00
Lukas Wirth d0e3114441 internal: Don't log default build script outputs 2022-06-03 16:46:16 +02:00
Lukas Wirth 2a60b8452e Deduplicate 2022-06-03 16:33:37 +02:00
Lukas Wirth 522f66545f Remove prev-sibling completion machinery 2022-06-03 16:25:37 +02:00
Lukas Wirth 6550a241fb More precise where keyword completions 2022-06-03 16:11:26 +02:00
Lukas Wirth c522669f00 Remove dead code 2022-06-03 15:46:17 +02:00
Lukas Wirth c5dcc77b40 Fix visibility mods not being completed for field defs 2022-06-03 15:42:28 +02:00
Lukas Wirth 519ac81b57 internal: Move most remaining keyword completions to item list completions 2022-06-03 15:15:21 +02:00
bors 58b6d46d5a Auto merge of #12333 - nolanderc:order-import-assist, r=Veykril
Order auto-imports by relevance

Fixes #10337.

Basically we sort the imports according to how "far away" the imported item is from where we want to import it to. This change makes it so that imports from the current crate are sorted before any third-party crates. Additionally, we make an exception for builtin crates (`std`, `core`, etc.) so that they are sorted before any third-party crates.

There are probably other heuristics that should be added to improve the experience (such as preferring imports that are common elsewhere in the same crate, and ranking crates depending on the dependency graph). However, I think this is a first good step.

PS. This is my first time contributing here, so please be gentle if I have missed something obvious :-)
2022-06-03 07:49:59 +00:00
bors ea15e1000f Auto merge of #12452 - iDawer:assist.merge_selected_imports, r=Veykril
feature: `Merge imports` assist can merge multiple selected imports.

The selected imports have to have a common prefix in paths.

Select imports or use trees to merge:
```rust
$0use std::fmt::Display;
use std::fmt::Debug;
use std::fmt::Write;$0
```
Apply `Merge imports`:
```rust
use std::fmt::{Display, Debug, Write};
```

Closes #12426
2022-06-03 07:40:34 +00:00
bors 29fae10345 Auto merge of #12451 - TimNN:double-dollar, r=Veykril
feat: Support `$$` in macros.

The implementation mirrors what `rustc` currently does [1]. Part of #11952.

\[1]: https://github.com/rust-lang/rust/blob/0595ea1d12cf745e0a672d05341429ecb0917e66/compiler/rustc_expand/src/mbe/quoted.rs#L230-L241
2022-06-03 07:23:48 +00:00
Laurențiu Nicola 7066b8e0ca Shorten main thread name 2022-06-03 07:27:48 +03:00
bitgaoshu 1a97ab34db fix: #12441 False-positive type-mismatch error with generic future 2022-06-03 10:47:41 +08:00
Tim Neumann 40bfb29e50 feat: Support $$ in macros.
The implementation mirrors what `rustc` currently does [1]. Part of #11952.

[1]: https://github.com/rust-lang/rust/blob/0595ea1d12cf745e0a672d05341429ecb0917e66/compiler/rustc_expand/src/mbe/quoted.rs#L230-L241
2022-06-02 21:48:28 +02:00
iDawer ea8899a445 Allow merging of multiple selected imports.
The selected imports have to have a common prefix in paths.

Before
```rust
$0use std::fmt::Display;
use std::fmt::Debug;$0
```
After
```rust
use std::fmt::{Display, Debug};
```
2022-06-02 23:15:55 +05:00