]>
git.lizzy.rs Git - rust.git/log
Galilée 'Bill' Enguehard [Fri, 22 May 2020 18:11:24 +0000 (20:11 +0200)]
Update tests to accept new hover formatting
Galilée 'Bill' Enguehard [Fri, 22 May 2020 18:10:37 +0000 (20:10 +0200)]
Fix formatting error when no modpath is present
Galilée 'Bill' Enguehard [Fri, 22 May 2020 17:04:39 +0000 (19:04 +0200)]
Modify hover info to show module path separated by a line
Galilée 'Bill' Enguehard [Thu, 21 May 2020 21:27:38 +0000 (23:27 +0200)]
Merge branch 'master' of github.com:rust-analyzer/rust-analyzer into modname_spacing
Galilée 'Bill' Enguehard [Thu, 21 May 2020 10:06:29 +0000 (12:06 +0200)]
Add extra newline after module path in hover info
Closes issue #3813
bors[bot] [Thu, 21 May 2020 18:05:58 +0000 (18:05 +0000)]
Merge #4557
4557: Formalize JoinLines protocol extension r=matklad a=matklad
bors r+
🤖
Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
Aleksey Kladov [Thu, 21 May 2020 17:50:23 +0000 (19:50 +0200)]
Formalize JoinLines protocol extension
bors[bot] [Thu, 21 May 2020 14:14:53 +0000 (14:14 +0000)]
Merge #4553
4553: Cleanup r=matklad a=matklad
bors r+
🤖
Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
Aleksey Kladov [Thu, 21 May 2020 14:11:37 +0000 (16:11 +0200)]
Cleanup
Aleksey Kladov [Thu, 21 May 2020 13:56:18 +0000 (15:56 +0200)]
Cleanup TextEdit
bors[bot] [Thu, 21 May 2020 13:10:00 +0000 (13:10 +0000)]
Merge #4552
4552: Transition OnEnter to WorkspaceSnippetEdit r=matklad a=matklad
This also changes our handiling of snippet edits on the client side.
`editor.insertSnippet` unfortunately forces indentation, which we
really don't want to have to deal with. So, let's just implement our
manual hacky way of dealing with a simple subset of snippets we
actually use in rust-analyzer
bors r+
🤖
Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
Aleksey Kladov [Thu, 21 May 2020 12:34:27 +0000 (14:34 +0200)]
Remove dead code for handling cursor positions
Aleksey Kladov [Thu, 21 May 2020 12:26:44 +0000 (14:26 +0200)]
Transition OnEnter to WorkspaceSnippetEdit
This also changes our handiling of snippet edits on the client side.
`editor.insertSnippet` unfortunately forces indentation, which we
really don't want to have to deal with. So, let's just implement our
manual hacky way of dealing with a simple subset of snippets we
actually use in rust-analyzer
bors[bot] [Thu, 21 May 2020 12:51:52 +0000 (12:51 +0000)]
Merge #4550
4550: Fix phrasing in inlay hints settings r=matklad a=lnicola
Part of #4549
r? @LucianoBestia
Co-authored-by: Laurențiu Nicola <lnicola@dend.ro>
Laurențiu Nicola [Thu, 21 May 2020 09:24:18 +0000 (12:24 +0300)]
Fix phrasing in inlay hints settings
bors[bot] [Thu, 21 May 2020 08:38:55 +0000 (08:38 +0000)]
Merge #4547
4547: Remove unused cursor positions r=matklad a=matklad
bors r+
🤖
Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
Aleksey Kladov [Wed, 20 May 2020 22:46:08 +0000 (00:46 +0200)]
Remove unused cursor positions
bors[bot] [Wed, 20 May 2020 23:48:02 +0000 (23:48 +0000)]
Merge #4506
4506: Make `find_path_inner` a query r=matklad a=jonas-schievink
This eliminates the remaining performance problems in the "Implement default members" assist (at least those that I've found).
Closes https://github.com/rust-analyzer/rust-analyzer/issues/4498
Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
bors[bot] [Wed, 20 May 2020 23:07:23 +0000 (23:07 +0000)]
Merge #4543
4543: Remove unused cursor positions r=matklad a=matklad
bors r+
🤖
Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
Aleksey Kladov [Wed, 20 May 2020 22:46:08 +0000 (00:46 +0200)]
Remove unused cursor positions
bors[bot] [Wed, 20 May 2020 22:04:42 +0000 (22:04 +0000)]
Merge #4541
4541: Remove set_cursor r=matklad a=matklad
bors r+
🤖
Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
Aleksey Kladov [Wed, 20 May 2020 22:03:42 +0000 (00:03 +0200)]
Remove set_cursor
Aleksey Kladov [Wed, 20 May 2020 22:01:08 +0000 (00:01 +0200)]
Snippetify unwrap -> match
Jonas Schievink [Mon, 18 May 2020 22:39:50 +0000 (00:39 +0200)]
Make `find_path_inner` a query
This eliminates any remaining performance problems in the
"Implement default members" assist (at least that I've found).
Aleksey Kladov [Wed, 20 May 2020 21:50:29 +0000 (23:50 +0200)]
More snippets
bors[bot] [Wed, 20 May 2020 21:33:36 +0000 (21:33 +0000)]
Merge #4540
4540: More snippets r=matklad a=matklad
bors r+
🤖
Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
Aleksey Kladov [Wed, 20 May 2020 21:14:31 +0000 (23:14 +0200)]
More snippets
bors[bot] [Wed, 20 May 2020 21:23:13 +0000 (21:23 +0000)]
Merge #4526
4526: Use a flat play icon instead of the blue emoji with test code lens r=kjeremy a=aloucks
@lnicola
Restores this commit:
https://github.com/rust-analyzer/rust-analyzer/commit/
55e914a2a179aba63bd9948d6e0cf3e2a4bf5960
That was effectively wiped out by this code formatting commit:
https://github.com/rust-analyzer/rust-analyzer/commit/
dc217bdf90d555eaa1780041fc3a14e64173994d
https://github.com/rust-analyzer/rust-analyzer/commit/
3d445256fe56f4a7ead64514fb57b79079973d84
Co-authored-by: Aaron Loucks <aloucks@cofront.net>
Aleksey Kladov [Wed, 20 May 2020 21:07:17 +0000 (23:07 +0200)]
Snippetify introduce/inline var
bors[bot] [Wed, 20 May 2020 20:56:28 +0000 (20:56 +0000)]
Merge #4539
4539: Relax cursor position tests in assists r=matklad a=matklad
Those will be replaced with snippets anyway
bors r+
🤖
Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
Aleksey Kladov [Wed, 20 May 2020 20:55:37 +0000 (22:55 +0200)]
Relax cursor position tests in assists
Those will be replaced with snippets anyway
bors[bot] [Wed, 20 May 2020 19:04:02 +0000 (19:04 +0000)]
Merge #4536
4536: Fix names of launch configuration in dev docs r=kjeremy a=kuy
Follows renaming of launch configurations in https://github.com/rust-analyzer/rust-analyzer/commit/
80a42a0628f7655c3299fbf4c5a15e31990b35d3
Co-authored-by: Yuki Kodama <endflow.net@gmail.com>
bors[bot] [Wed, 20 May 2020 18:18:18 +0000 (18:18 +0000)]
Merge #4537
4537: Fix GNOME spelling r=matklad a=afranke
GNOME is a trademark. :-)
Co-authored-by: Alexandre Franke <alexandre.franke@gmail.com>
Alexandre Franke [Wed, 20 May 2020 18:11:14 +0000 (20:11 +0200)]
Fix GNOME spelling
GNOME is a trademark. :-)
Yuki Kodama [Wed, 20 May 2020 18:01:37 +0000 (03:01 +0900)]
Fix names of launch configuration in dev docs
bors[bot] [Wed, 20 May 2020 12:16:26 +0000 (12:16 +0000)]
Merge #4533
4533: More snippets r=matklad a=matklad
bors r+
🤖
Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
Aleksey Kladov [Wed, 20 May 2020 12:13:17 +0000 (14:13 +0200)]
Snippetify fix_visibility
Aleksey Kladov [Wed, 20 May 2020 12:00:37 +0000 (14:00 +0200)]
Snippetify fill_match_arms
Aleksey Kladov [Wed, 20 May 2020 11:48:31 +0000 (13:48 +0200)]
Don't set cursor in change_visibility
Aleksey Kladov [Wed, 20 May 2020 11:41:58 +0000 (13:41 +0200)]
Cleanup imports
bors[bot] [Wed, 20 May 2020 11:33:48 +0000 (11:33 +0000)]
Merge #4532
4532: Split change_ and fix_ visibility assists r=matklad a=matklad
bors r+
🤖
Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
Aleksey Kladov [Wed, 20 May 2020 11:33:13 +0000 (13:33 +0200)]
Split change_ and fix_ visibility assists
bors[bot] [Wed, 20 May 2020 11:03:18 +0000 (11:03 +0000)]
Merge #4520
4520: Marks 2.0 r=matklad a=matklad
The main benefit here is that we no longer need to declare marks. The main drawback is that this is ~~glorious~~ horrible. WDYT?
Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
Aleksey Kladov [Wed, 20 May 2020 10:59:20 +0000 (12:59 +0200)]
Switch to new magic marks
Aleksey Kladov [Wed, 20 May 2020 09:54:57 +0000 (11:54 +0200)]
Remove cross-crate marks
They create quite a bit of friction. Really, we should just move the
tests to the same crate, rather than paper over existing split.
Aleksey Kladov [Tue, 19 May 2020 22:19:59 +0000 (00:19 +0200)]
Significantly more glorious marks
bors[bot] [Wed, 20 May 2020 09:10:52 +0000 (09:10 +0000)]
Merge #4530
4530: Use snippets in change_return_type_to_result r=matklad a=matklad
bors r+
🤖
Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
Aleksey Kladov [Wed, 20 May 2020 09:10:15 +0000 (11:10 +0200)]
Use snippets in change_return_type_to_result
bors[bot] [Wed, 20 May 2020 08:52:34 +0000 (08:52 +0000)]
Merge #4529
4529: Fix Some|None order in fill_match_arms r=matklad a=matklad
bors r+
🤖
Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
Aleksey Kladov [Wed, 20 May 2020 08:51:48 +0000 (10:51 +0200)]
Fix Some|None order in fill_match_arms
Aleksey Kladov [Wed, 20 May 2020 08:30:18 +0000 (10:30 +0200)]
wip
Aleksey Kladov [Wed, 20 May 2020 08:28:58 +0000 (10:28 +0200)]
Cleanup
Aleksey Kladov [Wed, 20 May 2020 08:26:14 +0000 (10:26 +0200)]
Minor
Aleksey Kladov [Wed, 20 May 2020 08:20:21 +0000 (10:20 +0200)]
Minor
Aleksey Kladov [Wed, 20 May 2020 08:17:46 +0000 (10:17 +0200)]
Snippetify add_new
bors[bot] [Wed, 20 May 2020 07:57:49 +0000 (07:57 +0000)]
Merge #4528
4528: Debug lens fix for a binary. r=matklad a=vsrs
Fixes an issue reported here: https://github.com/rust-analyzer/rust-analyzer/pull/4222#issuecomment-
631073448
Co-authored-by: vsrs <vit@conrlab.com>
bors[bot] [Wed, 20 May 2020 07:22:53 +0000 (07:22 +0000)]
Merge #4505
4505: Infer return type of loops with value breaks r=flodiebold a=ruabmbua
Creates a type variable to represent the return value of the loop.
Uses `coerce_merge_branch` on each break with the previous value, to determine the actual return value of the loop.
Resolves: https://github.com/rust-analyzer/rust-analyzer/issues/4492 , https://github.com/rust-analyzer/rust-analyzer/issues/4512
Co-authored-by: Roland Ruckerbauer <roland.rucky@gmail.com>
vsrs [Wed, 20 May 2020 06:42:00 +0000 (09:42 +0300)]
Debug lens fix for a binary.
Aaron Loucks [Wed, 20 May 2020 00:29:49 +0000 (20:29 -0400)]
Use a flat play icon instead of the blue emoji with test code lens
bors[bot] [Wed, 20 May 2020 00:11:25 +0000 (00:11 +0000)]
Merge #4525
4525: Better cursor placement when adding impl members r=matklad a=matklad
bors r+
🤖
Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
Aleksey Kladov [Wed, 20 May 2020 00:07:21 +0000 (02:07 +0200)]
Better cursor placement when adding impl members
bors[bot] [Tue, 19 May 2020 23:54:08 +0000 (23:54 +0000)]
Merge #4524
4524: Use snippets in add_missing_members r=matklad a=matklad
bors r+
🤖
Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
Aleksey Kladov [Tue, 19 May 2020 23:53:21 +0000 (01:53 +0200)]
Use snippets in add_missing_members
bors[bot] [Tue, 19 May 2020 23:30:48 +0000 (23:30 +0000)]
Merge #4521 #4522
4521: Use snippets in add_function r=matklad a=matklad
bors r+
🤖
4522: Explain the purpose of `ast::make` module more clearly r=matklad a=matklad
bors r+
🤖
Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
Aleksey Kladov [Tue, 19 May 2020 21:12:01 +0000 (23:12 +0200)]
Moderate cleanup of add_function
Aleksey Kladov [Tue, 19 May 2020 23:28:11 +0000 (01:28 +0200)]
Explain the purpose of `ast::make` module more clearly
Aleksey Kladov [Tue, 19 May 2020 20:25:07 +0000 (22:25 +0200)]
Use snippets in add function
Aleksey Kladov [Tue, 19 May 2020 19:43:14 +0000 (21:43 +0200)]
Cleanup
Aleksey Kladov [Tue, 19 May 2020 19:40:47 +0000 (21:40 +0200)]
Cleanup
Aleksey Kladov [Tue, 19 May 2020 19:39:27 +0000 (21:39 +0200)]
Use new format for all assists that don't change cursor positon
bors[bot] [Tue, 19 May 2020 22:50:26 +0000 (22:50 +0000)]
Merge #4519
4519: Fix client-side snippets r=matklad a=matklad
bors r+
🤖
Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
Aleksey Kladov [Tue, 19 May 2020 22:49:08 +0000 (00:49 +0200)]
Fix client-side snippets
bors[bot] [Tue, 19 May 2020 22:27:55 +0000 (22:27 +0000)]
Merge #4518
4518: New assist: add turbo fish r=matklad a=matklad
bors r+
🤖
Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
Aleksey Kladov [Tue, 19 May 2020 22:07:00 +0000 (00:07 +0200)]
New assist: add turbo fish
Roland Ruckerbauer [Tue, 19 May 2020 20:52:15 +0000 (22:52 +0200)]
Apply suggestion of @flodiebold: Get rid of multiple unwraps
Roland Ruckerbauer [Tue, 19 May 2020 19:49:45 +0000 (21:49 +0200)]
loop return value inference: add tests
Roland Ruckerbauer [Tue, 19 May 2020 19:18:43 +0000 (21:18 +0200)]
Move false negative expr_diverges_missing_arm() to working tests
Roland Ruckerbauer [Tue, 19 May 2020 19:03:59 +0000 (21:03 +0200)]
loop return value inference: coerce_merge branches
bors[bot] [Tue, 19 May 2020 18:29:46 +0000 (18:29 +0000)]
Merge #4494
4494: Support snippet text edit r=matklad a=matklad
bors r+
🤖
Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
Aleksey Kladov [Tue, 19 May 2020 18:27:14 +0000 (20:27 +0200)]
Update test data
Aleksey Kladov [Sun, 17 May 2020 23:53:55 +0000 (01:53 +0200)]
Implement client-side of SnippetTextEdit
Aleksey Kladov [Sun, 17 May 2020 22:11:40 +0000 (00:11 +0200)]
Server side of SnippetTextEdit
Aleksey Kladov [Sun, 17 May 2020 19:24:33 +0000 (21:24 +0200)]
Add snippetTextEdit protocol extension
Aleksey Kladov [Sun, 17 May 2020 12:21:24 +0000 (14:21 +0200)]
Add snippet support for some assists
Aleksey Kladov [Sun, 17 May 2020 10:09:53 +0000 (12:09 +0200)]
Add AssistConfig
bors[bot] [Tue, 19 May 2020 18:16:20 +0000 (18:16 +0000)]
Merge #4491
4491: fix doctest inside impl block r=matklad a=bnjjj
close #4449
Co-authored-by: Benjamin Coenen <5719034+bnjjj@users.noreply.github.com>
Co-authored-by: Coenen Benjamin <benjamin.coenen@hotmail.com>
bors[bot] [Tue, 19 May 2020 15:03:41 +0000 (15:03 +0000)]
Merge #4514
4514: find_path cleanups r=matklad a=matklad
bors r+
🤖
Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
Aleksey Kladov [Tue, 19 May 2020 14:54:45 +0000 (16:54 +0200)]
Cleanup query fn naming
Aleksey Kladov [Tue, 19 May 2020 14:46:33 +0000 (16:46 +0200)]
Move public API to the top
Aleksey Kladov [Tue, 19 May 2020 14:45:57 +0000 (16:45 +0200)]
Simplify
Aleksey Kladov [Tue, 19 May 2020 14:43:26 +0000 (16:43 +0200)]
Cleanup imports
bors[bot] [Tue, 19 May 2020 14:35:21 +0000 (14:35 +0000)]
Merge #4513
4513: Update crates r=kjeremy a=kjeremy
Co-authored-by: kjeremy <kjeremy@gmail.com>
kjeremy [Tue, 19 May 2020 14:11:34 +0000 (10:11 -0400)]
Update crates
Roland Ruckerbauer [Mon, 18 May 2020 21:39:10 +0000 (23:39 +0200)]
Infer return type of loops with value breaks.
bors[bot] [Mon, 18 May 2020 19:43:12 +0000 (19:43 +0000)]
Merge #4501
4501: Querify `importable_locations_in_crate` r=jonas-schievink a=jonas-schievink
This brings the time needed to compute the `add_missing_impl_members` assist down from ~5 minutes to 20 seconds on my test workload (which is editing within an impl of a MIR [`MutVisitor`](https://doc.rust-lang.org/nightly/nightly-rustc/rustc_middle/mir/visit/trait.MutVisitor.html))
cc #4498
Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
Jonas Schievink [Mon, 18 May 2020 19:42:39 +0000 (21:42 +0200)]
Querify `importable_locations_in_crate`
This brings the time needed to compute the `add_missing_impl_members`
assist down from ~5 minutes to 20 seconds
bors[bot] [Mon, 18 May 2020 11:03:44 +0000 (11:03 +0000)]
Merge #4497
4497: Create LowerCtx on the fly r=matklad a=edwin0cheng
Previously we create `LowerCtx` at the beginning of lowering, however, the hygiene content is in fact changing between macro expression expanding.
This PR change it to create the `LowerCtx` on the fly to fix above bug.
However, #4465 is not fixed by this PR, the goto-def is still not work yet. It only fixed the infer part.
Co-authored-by: Edwin Cheng <edwin0cheng@gmail.com>
bors[bot] [Mon, 18 May 2020 07:44:44 +0000 (07:44 +0000)]
Merge #4493
4493: Provide builtin impls of Fn traits for fn-pointers r=flodiebold a=hban
Meant to be, but isn't actually a fix for #2880.
Consider this snippet:
```rust
use std::marker::PhantomData;
use std::ops::Deref;
struct Lazy<T, F/* = fn() -> T*/>(F, PhantomData<T>);
impl<T, F> Lazy<T, F> {
pub fn new(f: F) -> Lazy<T, F> {
Lazy(f, PhantomData)
}
}
impl<T, F: FnOnce() -> T> Deref for Lazy<T, F> {
type Target = T;
fn deref(&self) -> &T { todo!() }
}
fn test() {
let lazy1: Lazy<u32, _> = Lazy::new(|| 0u32);
let r1 = lazy1.to_string();
fn make_u32_fn() -> u32 { todo!() }
let make_u32_fn_ptr: fn() -> u32 = make_u32_fn;
let lazy2: Lazy<u32, _> = Lazy::new(make_u32_fn_ptr);
let r2 = lazy2.to_string();
}
```
* On current master:
* When type default is commented-out, `r1` is correctly inferred, `r2` in _{unknown}_.
* When type default is not commented-out, both `r1` and `r2` are _{unknown}_.
* With this PR:
* When type default is commented-out, both `r1` and `r2` are correctly inferred.
* When type default is not commented-out, both `r1` and `r2` are _{unknown}_.
Well, it's a improvement at least. I guess this thing with type defaults is a different problem.
I also tried add Fn impls for fn items, but wasn't successful. So this PR only adds those impls for fn pointers.
Co-authored-by: Hrvoje Ban <hban@users.noreply.github.com>
bors[bot] [Mon, 18 May 2020 07:37:04 +0000 (07:37 +0000)]
Merge #4499
4499: CodeLens configuration options r=vsrs a=vsrs
This PR
- adds an option to granularly enable\disable all CodeLens, just like the TypeScript extension.
- fixes a minor bug for doctests. It makes no sense to show `Debug` lens for them as cargo `Can't skip running doc tests with --no-run`.
Co-authored-by: vsrs <vit@conrlab.com>
vsrs [Mon, 18 May 2020 07:27:00 +0000 (10:27 +0300)]
Add "rust-analyzer.lens.enable"