Commit Graph

16865 Commits

Author SHA1 Message Date
bors[bot]
617535393b
Merge #8658
8658: Check more carefully for cases where a rename can't be done r=Veykril a=dzhu

Attempting to rename an element of a tuple field would previously replace the type with the new name, which doesn't make sense; now it fails instead.

The check is done in both `prepare_rename` and `rename` so that the case is caught before the user is prompted for a new name. Some other existing failure cases are also now additionally checked in `prepare_rename`.

Closes: #8592

(I threw in some doc edits for a relevant type; of course, I can remove those if the policy here is to be strict about scope of changes within a PR.)

Co-authored-by: Danny Zhu <dzhu@dzhu.us>
2021-04-25 21:18:57 +00:00
Danny Zhu
09fc5e1dd7 Check more carefully for cases where a rename can't be done
Attempting to rename an element of a tuple field would previously
replace the type with the new name, which doesn't make sense; now it
fails instead.

The check is done in both `prepare_rename` and `rename` so that the case
is caught before the user is prompted for a new name. Some other
existing failure cases are also now additionally checked in
`prepare_rename`.
2021-04-25 14:08:56 -07:00
Jeremy Kolb
1c927650f7 npm update 2021-04-25 16:16:01 -04:00
bors[bot]
d8578bf9bf
Merge #8656
8656: Update deps r=kjeremy a=kjeremy



Co-authored-by: Jeremy Kolb <kjeremy@gmail.com>
2021-04-25 19:44:47 +00:00
Jeremy Kolb
321aa9eb92 Update deps 2021-04-25 15:43:42 -04:00
bors[bot]
1b4defd240
Merge #8647
8647: internal: Split out merge_imports module from helpers::insert_use r=Veykril a=Veykril

bors r+

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2021-04-24 11:39:50 +00:00
Lukas Wirth
050c69c19d Split out merge_imports module from helpers::insert_use 2021-04-24 13:31:43 +02:00
bors[bot]
4d110dd118
Merge #8643
8643: fix: correct version string to contain hash, build date and channel r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2021-04-24 10:37:42 +00:00
Aleksey Kladov
8d54fd105c fix: correct version string to contain hash, build date and channel 2021-04-24 13:36:45 +03:00
Aleksey Kladov
43ea1bb9b9 minor 2021-04-24 10:31:58 +03:00
bors[bot]
dc6178ddd9
Merge #8641
8641: minor r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2021-04-24 06:09:21 +00:00
Aleksey Kladov
03f5e53678 minor 2021-04-24 09:08:56 +03:00
bors[bot]
95996ea452
Merge #8639
8639: fix: 'configuration.property' error in VS Code r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2021-04-23 19:09:37 +00:00
Aleksey Kladov
905ae2843a fix: 'configuration.property' error in VS Code
closes #7789
2021-04-23 22:08:09 +03:00
bors[bot]
5cbde9f531
Merge #8591 #8638
8591: Remove SyntaxRewriter usage in insert_use in favor of mutable syntax trees r=matklad a=Veykril

Unfortunately changing `insert_use` to not use `SyntaxRewriter` creates a lot of changes since so much relies on that. But on the other hand this should be the biggest usage of `SyntaxRewriter` I believe.

8638: Remove SyntaxRewriter::from_fn r=Veykril a=Veykril



Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2021-04-23 16:49:08 +00:00
Lukas Wirth
e6e4417bbb Remove SyntaxRewriter::from_fn 2021-04-23 18:36:43 +02:00
bors[bot]
20f82191a0
Merge #8637
8637: Tag `yield` and `await` as ControlFlow in semantic highlighting r=Veykril a=Veykril

and shuffle some code around
Closes #8634
bors r+

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2021-04-23 15:28:55 +00:00
Lukas Wirth
1e88f5ec8e Simplify highlight token match guards 2021-04-23 17:27:18 +02:00
Lukas Wirth
ef6f596b4b Sort HlMod variants and ALL const 2021-04-23 17:24:58 +02:00
Lukas Wirth
c005ce60a0 Tag yield and await as ControlFlow in semantic highlighting 2021-04-23 17:24:45 +02:00
bors[bot]
85bab7539a
Merge #8317
8317: Convert tuple struct to named struct assist r=Veykril a=unexge

Closes https://github.com/rust-analyzer/rust-analyzer/issues/8192

Co-authored-by: unexge <unexge@gmail.com>
2021-04-23 13:37:48 +00:00
unexge
5e765895cf Add missing test case for "Convert to named struct" assist 2021-04-23 16:18:10 +03:00
unexge
97270dfb91 Stop iterating reference after made an edit in "Convert to named struct" assist 2021-04-23 13:08:07 +03:00
Smittyvb
c38e3e9ee9
Support | as a surrounding pairs 2021-04-22 15:57:30 -04:00
bors[bot]
07fb65abb8
Merge #8628
8628: minor: Add one more profiling span to add_dep r=lnicola a=lnicola

CC #8623

bors r+

Co-authored-by: Laurențiu Nicola <lnicola@dend.ro>
2021-04-22 18:48:53 +00:00
Laurențiu Nicola
c37ca7841c Add one more profiling span to add_dep 2021-04-22 21:48:17 +03:00
bors[bot]
e529f73355
Merge #8627
8627: Add profiling spans under cargo_to_crate_graph r=lnicola a=lnicola

bors r+

Co-authored-by: Laurențiu Nicola <lnicola@dend.ro>
2021-04-22 18:26:09 +00:00
Laurențiu Nicola
6b187af337 Add profiling spans under cargo_to_crate_graph 2021-04-22 21:25:29 +03:00
bors[bot]
576f50637c
Merge #8605
8605: internal: Automatically categorize the changelog entries r=matklad a=lnicola



Co-authored-by: Laurențiu Nicola <lnicola@dend.ro>
2021-04-22 17:35:41 +00:00
vsrs
1b4197cb35 Use explicit rustc commit-hash
Required for lldb on mac
2021-04-22 18:59:03 +03:00
bors[bot]
0bb074aa26
Merge #8620
8620: Remove unnecessary braces for extracted block expression r=Veykril a=brandondong

This change addresses the first bullet point of https://github.com/rust-analyzer/rust-analyzer/issues/7839.

Specifically, when extracting block expressions, remove the unneeded extra braces inside the generated function.

Co-authored-by: Brandon <brandondong604@hotmail.com>
2021-04-22 15:22:43 +00:00
vsrs
1ebfe11730 Add special auto value for debug.sourceFileMap 2021-04-22 16:09:46 +03:00
vsrs
8f781e782c Autodetect rust library source file map 2021-04-22 15:27:56 +03:00
unexge
affd8d3518 Move reference editing logic into own function to make error handling more ease in "Convert to named struct" assist 2021-04-22 11:33:56 +03:00
bors[bot]
d1c9bd134d
Merge #8621
8621: feat: make sure nightly regressions don't break users r=lnicola a=matklad



Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2021-04-22 08:29:01 +00:00
Aleksey Kladov
27073f4fc3 feat: make sure nightly regressions don't break users 2021-04-22 11:15:20 +03:00
Brandon
1713f4c7cd Remove unnecessary braces for extracted block expression 2021-04-21 23:39:35 -07:00
bors[bot]
1f1a1ce4f5
Merge #8595
8595: Diagnostic paths support specifying `remapPrefix` r=rickvanprim a=rickvanprim

Currently VSCode Problem Matchers will resolve a path like `//foo_crate/src/main.rs` if `${workspaceFolder}/foo_crate/src/main.rs` exists.  Presumably their behavior is functionally a string concatenation that would produce `${workspaceFolder///foo_crate/src/main.rs` and repeated path separators get ignored.

This PR attempts to mimic this behavior by stripping any `Component::RootDir` from `file_name` before joining it to `workspace_root`, and then checking if the file exists.  If it does, this path is used, and if not, the behavior falls through to the existing Rust path join behavior.

Co-authored-by: James Leitch <rickvanprim@gmail.com>
2021-04-21 23:54:47 +00:00
Lukas Wirth
d5c9de65c5 Don't filter equal nodes in reorder assists 2021-04-22 00:54:31 +02:00
James Leitch
72718bc2d7 Code review feedback. 2021-04-21 15:10:53 -07:00
James Leitch
9fcad82980 Diagnostic Remap Path Prefixes added. 2021-04-21 15:10:53 -07:00
James Leitch
60841f4276 Diagnostic paths attempt to use VSCode's path join behavior before defaulting to Rust's path join behavior. 2021-04-21 15:10:53 -07:00
bors[bot]
32491c0978
Merge #8570
8570: Flycheck tries to parse both Cargo and Rustc messages. r=rickvanprim a=rickvanprim

This change allows non-Cargo build systems to be used for Flycheck provided they call `rustc` with `--error-format=json` and emit those JSON messages to `stdout`.

Co-authored-by: James Leitch <rickvanprim@gmail.com>
2021-04-21 21:56:54 +00:00
bors[bot]
b21701c5ee
Merge #8616
8616: minor: Bump deps r=lnicola a=lnicola

bors r+

Co-authored-by: Laurențiu Nicola <lnicola@dend.ro>
2021-04-21 16:20:56 +00:00
Laurențiu Nicola
81054a2581 Bump other deps 2021-04-21 19:20:18 +03:00
Laurențiu Nicola
27c5e2da48 Bump chalk 2021-04-21 19:20:01 +03:00
Laurențiu Nicola
e50ca6b067 Bump rustc_lexer 2021-04-21 19:19:27 +03:00
bors[bot]
163d9d31a4
Merge #8615
8615: skip: Remove `ItemTree::all_inner_items` r=jonas-schievink a=jonas-schievink

It's unused.

bors r+

Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
2021-04-21 16:10:55 +00:00
Jonas Schievink
0414b65319 Remove ItemTree::all_inner_items 2021-04-21 18:10:25 +02:00
bors[bot]
e9fea823a0
Merge #8613
8613: skip: Add failing local items test r=jonas-schievink a=jonas-schievink

This is currently broken due to the way ItemTree stores inner items. This test serves as a reminder until this gets fixed.

bors r+

Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
2021-04-21 15:58:57 +00:00