Commit Graph

10577 Commits

Author SHA1 Message Date
bors[bot]
30658b25d2
Merge #4648
4648: Support raw_ref_op's raw reference operator r=matklad a=robojumper

Fixes #4642.

This syntax (and its semantics) are implemented in rustc behind the `raw_ref_op` feature.

It is not entirely clear whether this is the syntax that will become stable, but [it seems like](https://github.com/rust-lang/rust/pull/72279) rust-analyzer must still support this unstable syntax to support future stable rust.

Also fixes a random inference failure involving a direct coercion from `&[T, _]` to `*const [T]`.

Co-authored-by: robojumper <robojumper@gmail.com>
2020-05-29 15:04:35 +00:00
Florian Diebold
ab28f6c249 Upgrade Chalk
Fixes #4072.
2020-05-29 16:49:52 +02:00
Florian Diebold
7d0586cb15 Use first match branch in case of type mismatch, not last
The comment says this was intentional, but I do agree with #4304 that it makes
more sense the other way around (for if/else as well).

Fixes #4304.
2020-05-29 16:04:56 +02:00
Jess Balint
bd8aa04bae add support for naming anon lifetimes in function return type 2020-05-28 15:10:14 -05:00
robojumper
367487fe88 Support raw_ref_op's raw reference operator 2020-05-28 21:42:22 +02:00
bors[bot]
190a0595a4
Merge #4640
4640: Add `inRustProject` when-clause for commands in vscode r=vsrs a=vsrs

At the moment all rust-analyzer commands always visible in the command palette, even if there is no rust project opened.

This PR adds special [when-clause](https://code.visualstudio.com/docs/getstarted/keybindings#_when-clause-contexts) context. This context also might be used in key bindings.


Co-authored-by: vsrs <vit@conrlab.com>
Co-authored-by: vsrs <62505555+vsrs@users.noreply.github.com>
2020-05-28 13:37:37 +00:00
vsrs
6d0f1e2e72
Add inRustProject context documentation. 2020-05-28 16:04:42 +03:00
bors[bot]
fc29d0e924
Merge #4641
4641: Upgrade Chalk r=matklad a=flodiebold

Chalk newly added TypeName::Never and Array; I implemented the conversion for
Never, but not Array since that expects a const argument.

Co-authored-by: Florian Diebold <flodiebold@gmail.com>
2020-05-28 09:34:33 +00:00
bors[bot]
d3d1407f50
Merge #4646
4646: Link forum topic r=matklad a=matklad



bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2020-05-28 08:20:43 +00:00
Aleksey Kladov
232a1de222 Link forum topic 2020-05-28 10:19:01 +02:00
bors[bot]
6d569c32fe
Merge #4639
4639: Fixed missing newline on each field on "Missing structure fields". r=flodiebold a=flipbit03



Co-authored-by: Cadu <cadu.coelho@gmail.com>
2020-05-27 19:14:11 +00:00
Florian Diebold
c8a4bb1445 Upgrade Chalk
Chalk newly added TypeName::Never and Array; I implemented the conversion for
Never, but not Array since that expects a const argument.
2020-05-27 21:07:08 +02:00
vsrs
f3e04fbbab Add inRustProject when-clause for commands. 2020-05-27 19:46:23 +03:00
Cadu
c011f04f55 Fixed missing newline on each field on "Missing structure fields". 2020-05-27 13:15:19 -03:00
bors[bot]
94889b6472
Merge #4592
4592: fix textedit range returned for completion when left token is a keyword r=bnjjj a=bnjjj

close #4545

Co-authored-by: Benjamin Coenen <5719034+bnjjj@users.noreply.github.com>
2020-05-27 13:22:26 +00:00
Benjamin Coenen
846cefa491 fix textedit range returned for completion when left token is a keyword
Signed-off-by: Benjamin Coenen <5719034+bnjjj@users.noreply.github.com>
2020-05-27 15:15:19 +02:00
bors[bot]
59adc7bfb6
Merge #4596
4596: Strip leading underscores of argument names in function/method r=matklad a=kuy

Closes #4510 

### Goal

When I select a function/method from completions, I get a snippet that doesn't contain leading underscores of argument names.

### Solution

- Option 1: All signatures don't contain underscores
- Option 2: Keep same signature, but inserted snippet doesn't contain underscores

I choose Option 2 because I think that leading underscores is a part of "signature". Users should get correct signatures. On the other hand, trimming underscores is an assist by IDE.

### Other impls.

rls: Complete argument names with underscores (same as actual ra)
IntelliJ Rust: Doesn't complete argument names
VSCode (TypeScript): Doesn't complete argument names

### Working example

![Screen Shot 2020-05-25 at 0 03 21](https://user-images.githubusercontent.com/151614/82757771-a05e5b80-9e1d-11ea-9dbc-1263c960e2ae.png)


Co-authored-by: Yuki Kodama <endflow.net@gmail.com>
2020-05-27 12:41:38 +00:00
bors[bot]
3c5112b079
Merge #4625 #4629
4625: Partially fix displaying inlay hints in Github PR diff views r=matklad a=Veetaha

See the comment in https://github.com/rust-analyzer/rust-analyzer/issues/4608#issuecomment-63424257

It partially fixes the left side of diff view (the one where old code is displayed), but the diff editor with new code changes still has `file` scheme and will proceed displaying inlay hints...

4629: Fix the `should_panic` snippet r=matklad a=eminence

Closes #4628

Co-authored-by: veetaha <veetaha2@gmail.com>
Co-authored-by: Andrew Chin <achin@eminence32.net>
2020-05-27 12:34:03 +00:00
bors[bot]
b65d6471ca
Merge #4633
4633: typo r=matklad a=Veetaha



Co-authored-by: Veetaha <veetaha2@gmail.com>
2020-05-27 12:25:20 +00:00
Veetaha
bfdcf73b9b
typo 2020-05-27 14:04:57 +03:00
bors[bot]
54bbbcf722
Merge #4632
4632: Document inlay hints and runnables r=matklad a=matklad

We want to change those, but let's document what we have in meantime



bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2020-05-27 10:21:31 +00:00
Aleksey Kladov
bb415c1818 Document inlay hints and runnables
We want to change those, but let's document what we have in meantime
2020-05-27 12:20:47 +02:00
bors[bot]
64a1c77ab2
Merge #4622
4622: Pass trivially copy types as copy r=matklad a=kjeremy



Co-authored-by: kjeremy <kjeremy@gmail.com>
2020-05-27 06:42:04 +00:00
Andrew Chin
36f97d39a4 Fix the should_panic snippet
Closes #4628
2020-05-26 18:45:14 -04:00
veetaha
3c749b6224 Partially fix displaying inlay hints in Github PR diff views 2020-05-26 22:55:35 +03:00
bors[bot]
7ddc3b468a
Merge #4623
4623: Update deps r=kjeremy a=kjeremy



Co-authored-by: kjeremy <kjeremy@gmail.com>
2020-05-26 19:23:53 +00:00
kjeremy
9a0353a81e Update lexer 2020-05-26 14:35:09 -04:00
kjeremy
154e376842 Update crates 2020-05-26 14:32:56 -04:00
kjeremy
bee4f8f9fe Pass trivially copy types as copy 2020-05-26 14:12:13 -04:00
bors[bot]
39470526ee
Merge #4621
4621: Highlight question mark operator r=matklad a=kuy

Fixes #4597

Co-authored-by: Yuki Kodama <endflow.net@gmail.com>
2020-05-26 18:09:41 +00:00
bors[bot]
e3280eb4ae
Merge #4534
4534: Add call postfix completion r=matklad a=vain0x

To make it easier to wrap an expression with Ok/Some/Rc::new etc.

Note I agree with conclusion of the discussion in #1431 that adding many completions is not the way to go. However, this PR still could be justified due to versatility of use.

Co-authored-by: vain0x <vainzerox@gmail.com>
2020-05-26 12:12:52 +00:00
bors[bot]
dbb2c153ff
Merge #4617
4617: Hover tooltip module name is monospace once again r=matklad a=aloucks

The line separator is also moved below the function signature to split regions between the docs. This is very similar to how IntelliJ displays tooltips. Adding an additional separator between the module name and function signature currently has rendering issues.

Fixes #4594
Alternative to #4615

@kjeremy @Veetaha 

Note that I have semantic coloring disabled so ignore any differences due to that.

![image](https://user-images.githubusercontent.com/221559/82857507-30180e80-9edf-11ea-903a-f25c60055a93.png)

![image](https://user-images.githubusercontent.com/221559/82857407-e6c7bf00-9ede-11ea-9ae0-d348279552e7.png)


Co-authored-by: Aaron Loucks <aloucks@cofront.net>
2020-05-26 07:20:56 +00:00
Aaron Loucks
a047f10839 Hover tooltip module name is monospace once again
The line separator is moved below the function signature to split
regions between the docs. This is very similar to how IntelliJ
displays tooltips. Adding an additional separator between the module
name and function signature currently has rendering issues.

Fixes #4594
Alternative to #4615
2020-05-25 23:18:45 -04:00
bors[bot]
76fa498d6c
Merge #4614
4614: Fix some clippy perf warnings r=kjeremy a=kjeremy



Co-authored-by: Jeremy Kolb <kjeremy@gmail.com>
2020-05-25 17:47:11 +00:00
Yuki Kodama
1e823d6770 Add question mark operator 2020-05-26 02:36:34 +09:00
Jeremy Kolb
a5cc9a8a9b Fix some clippy perf warnings 2020-05-25 13:35:52 -04:00
Yuki Kodama
fd83f469e9 Trim at presentation layer 2020-05-26 01:06:25 +09:00
Yuki Kodama
41d0f7f24e Fix test to consider multiple underscores 2020-05-26 01:06:25 +09:00
Yuki Kodama
408d04764c Use built-in method 2020-05-26 01:06:25 +09:00
Yuki Kodama
378bfc3c8f Separate assertions 2020-05-26 01:06:25 +09:00
Yuki Kodama
4d13691ad1 Reflect test case 2020-05-26 01:06:25 +09:00
Yuki Kodama
6c676909dd Strip leading underscore 2020-05-26 01:06:25 +09:00
Aleksey Kladov
3c2c8d7e5f Fix conflict between nightly branch and tag 2020-05-25 16:31:19 +02:00
Aleksey Kladov
cdb507e467
Merge pull request #4612 from matklad/fix-tag
Try fixing release tags
2020-05-25 16:29:24 +02:00
Aleksey Kladov
5e66045a21 Try fixing release tags
closes #4319
2020-05-25 16:26:01 +02:00
bors[bot]
30f058dfea
Merge #4602 #4603
4602: Add boolean literal semantic token type to package.json r=matklad a=lnicola

Closes #4583.

CC @GrayJack

4603: Add self keyword semantic token type r=matklad a=lnicola

Not sure if this is warranted a new token type or just a modifier.

---

CC #4583, @GrayJack

Co-authored-by: Laurențiu Nicola <lnicola@dend.ro>
2020-05-25 14:08:21 +00:00
bors[bot]
19700b2e31
Merge #4611
4611: Document `parentModule` experimental LSP request r=matklad a=matklad



bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2020-05-25 14:00:24 +00:00
Aleksey Kladov
0ebb25b29b Document parentModule experimental LSP request 2020-05-25 15:59:49 +02:00
bors[bot]
00172d0b55
Merge #4610
4610: Cleanup lsp extensions on the client side r=matklad a=matklad



bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2020-05-25 12:58:50 +00:00
Aleksey Kladov
a30bdd9795 Cleanup lsp extensions on the client side 2020-05-25 14:56:26 +02:00