Commit Graph

9730 Commits

Author SHA1 Message Date
bors[bot]
bf2d91b26a
Merge #3858
3858: Hide unit function return types r=flodiebold a=lnicola

r? @flodiebold 

This might be a bit heavy-handed (e.g. `|| -> ()` to `||`), what do you think?

Co-authored-by: Laurențiu Nicola <lnicola@dend.ro>
2020-04-05 18:27:44 +00:00
Laurențiu Nicola
7d62280a71 Hide unit fn return types 2020-04-05 21:06:47 +03:00
Florian Diebold
952714685a Upgrade Chalk again
The big change here is counting binders, not
variables (https://github.com/rust-lang/chalk/pull/360). We have to adapt to the
same scheme for our `Ty::Bound`. It's mostly fine though, even makes some things
more clear.
2020-04-05 19:23:18 +02:00
Florian Diebold
3659502816 Upgrade Chalk 2020-04-05 19:23:18 +02:00
bors[bot]
3431312418
Merge #3857
3857: Fix inference of function pointer return types r=flodiebold a=lnicola

Fixes #3852.

r? @flodiebold

Co-authored-by: Laurențiu Nicola <lnicola@dend.ro>
2020-04-05 15:23:10 +00:00
Laurențiu Nicola
b58a7f41f1 Fix inference of function pointer return types 2020-04-05 18:18:40 +03:00
Edwin Cheng
53058dd73a Add back deny_c 2020-04-05 21:45:57 +08:00
bors[bot]
e300e1e8d8
Merge #3849
3849: Cargo update r=kjeremy a=kjeremy



Co-authored-by: kjeremy <kjeremy@gmail.com>
2020-04-04 22:10:00 +00:00
kjeremy
e37e8d52f1 Cargo update 2020-04-04 17:47:19 -04:00
bors[bot]
7c2f141591
Merge #3848
3848: Remove unused dependencies r=kjeremy a=est31

Found by cargo-udeps

Co-authored-by: est31 <MTest31@outlook.com>
2020-04-04 18:00:45 +00:00
est31
dc142152e6 Remove unused dependencies 2020-04-04 19:22:14 +02:00
bors[bot]
45b9d6d553
Merge #3844
3844: vscode: restore removed default values r=matklad a=Veetaha

After refactoring the config we forgot to set defaults for
some properties like workspaceLoaded, callInfo.full, etc.
This commit restored them to being turned on by defult,
as well added defaults for other props to be more explicit
on their defualt value.
cc @matklad 

Co-authored-by: veetaha <veetaha2@gmail.com>
2020-04-04 13:32:18 +00:00
bors[bot]
2071d0b827
Merge #3845
3845: Simplify config r=matklad a=Veetaha



Co-authored-by: veetaha <veetaha2@gmail.com>
2020-04-04 13:25:20 +00:00
bors[bot]
cdb80ef039
Merge #3846
3846: vscode: log server binary path r=matklad a=Veetaha



Co-authored-by: veetaha <veetaha2@gmail.com>
2020-04-04 13:18:51 +00:00
veetaha
a1773f8a67 Remove explicit generic type parameter 2020-04-04 16:12:09 +03:00
veetaha
90959b29e0 vscode: log server binary path 2020-04-04 16:10:06 +03:00
veetaha
b5a7cb331f Simplify config 2020-04-04 16:04:49 +03:00
veetaha
486cb5b79a vscode: restore removed default values
After refactoring the config we forgot to set defaults for
some properties like workspaceLoaded, callInfo.full, etc.
This commit restored them to being turned on by defult,
as well added defaults for other props to be more explicit
on their defualt value.
2020-04-04 15:57:23 +03:00
bors[bot]
6207ac90da
Merge #3840
3840: Add parens for enums r=matklad a=matklad



bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2020-04-03 19:11:40 +00:00
Aleksey Kladov
a5e8dfd024 Add parens for enums 2020-04-03 21:11:05 +02:00
Aleksey Kladov
b1cf95f691 Generalize call parenthesis insertion 2020-04-03 21:01:18 +02:00
Aleksey Kladov
adbcedde18 Remove the second code-path for completing names in patterns 2020-04-03 21:00:15 +02:00
bors[bot]
cde92d0fe1
Merge #3837
3837: Include grammar for syntax trees into vsix r=matklad a=matklad



bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2020-04-03 18:05:43 +00:00
Aleksey Kladov
ab29806f32 Include grammar for syntax trees into vsix 2020-04-03 20:00:06 +02:00
bors[bot]
6a2dd7bafc
Merge #3836
3836: Macro patterns are not confused with expressions. r=matklad a=matklad

We treat macro calls as expressions (there's appropriate Into impl),
which causes problem if there's expresison and non-expression macro in
the same node (like in the match arm).

We fix this problem by nesting macor patterns into another node (the
same way we nest path into PathExpr or PathPat). Ideally, we probably
should add a similar nesting for macro expressions, but that needs
some careful thinking about macros in blocks: `{ am_i_expression!() }`.



bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2020-04-03 14:13:15 +00:00
Aleksey Kladov
da8eb29a2f Macro patterns are not confused with expressions.
We treat macro calls as expressions (there's appropriate Into impl),
which causes problem if there's expresison and non-expression macro in
the same node (like in the match arm).

We fix this problem by nesting macor patterns into another node (the
same way we nest path into PathExpr or PathPat). Ideally, we probably
should add a similar nesting for macro expressions, but that needs
some careful thinking about macros in blocks: `{ am_i_expression!() }`.
2020-04-03 16:12:38 +02:00
Aleksey Kladov
0e46ed8420 Cleanups 2020-04-03 15:44:06 +02:00
bors[bot]
795b8cf9c5
Merge #3834
3834: Set semantic tokens supertypes r=matklad a=matklad

bors r+

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2020-04-03 12:16:40 +00:00
Aleksey Kladov
2a968d4554 Set semantic tokens supertypes 2020-04-03 14:09:12 +02:00
bors[bot]
1a8779bce0
Merge #3800
3800: Introduce ra_proc_macro_srv r=matklad a=edwin0cheng

This PR add preliminary for server side of proc macro : 

1. Add crate setup
2. IO for server side


Co-authored-by: Edwin Cheng <edwin0cheng@gmail.com>
2020-04-03 12:06:04 +00:00
Edwin Cheng
9a2114b0dd Add doc comment on main.rs 2020-04-03 19:16:54 +08:00
Edwin Cheng
84fb9b44c3 Introduce ra_proc_macro_srv 2020-04-03 19:01:44 +08:00
Aleksey Kladov
ac91de1525
Merge pull request #3833 from edwin0cheng/remove-deny-c
Remove deny_c in CI
2020-04-03 12:46:29 +02:00
Edwin Cheng
3277079412 Remove deny_c in CI 2020-04-03 18:11:28 +08:00
bors[bot]
77462bba62
Merge #3746
3746: Add create_function assist r=flodiebold a=TimoFreiberg

The function part of #3639, creating methods will come later

- [X] Function arguments
     - [X] Function call arguments
     - [x] Method call arguments
     - [x] Literal arguments
     - [x] Variable reference arguments
- [X] Migrate to `ast::make` API
    Done, but there are some ugly spots.

Issues to handle in another PR:
- function reference arguments: Their type isn't printed properly right now.
    The "insert explicit type" assist has the same issue and this is probably a relatively rare usecase.

- generating proper names for all kinds of argument expressions (if, loop, ...?)
    Without this, it's totally possible for the assist to generate invalid argument names.
    I think the assist it's already helpful enough to be shipped as it is, at least for me the main usecase involves passing in named references.
    Besides, the Rust tooling ecosystem is immature enough that some janky behaviour in a new assist probably won't scare anyone off.

- select the generated placeholder body so it's a bit easier to overwrite it

- create method (`self.foo<|>(..)` or `some_foo.foo<|>(..)`) instead of create_function.
    The main difference would be finding (or creating) the impl block and inserting the `self` argument correctly

- more specific default arg names for literals.
    So far, every generated argument whose name can't be taken from the call site is called `arg` (with a number suffix if necessary).

- creating functions in another module of the same crate.
    E.g. when typing `some_mod::foo<|>(...)` when in `lib.rs`, I'd want to have `foo` generated in `some_mod.rs` and jump there.
    Issues: the mod could exist in `some_mod.rs`, in `lib.rs` as `mod some_mod`, or inside another mod but be imported via `use other_mod::some_mod`.

- refer to arguments of the generated function with a qualified path if the types aren't imported yet
    (alternative: run autoimport. i think starting with a qualified path is cleaner and there's already an assist to replace a qualified path with an import and an unqualified path)

- add type arguments of the arguments to the generated function

- Autocomplete functions with information from unresolved calls (see https://github.com/rust-analyzer/rust-analyzer/pull/3746#issuecomment-605281323)
    Issues: see https://github.com/rust-analyzer/rust-analyzer/pull/3746#issuecomment-605282542. The unresolved call could be anywhere. But just offering this autocompletion for unresolved calls in the same module would already be cool.

Co-authored-by: Timo Freiberg <timo.freiberg@gmail.com>
2020-04-03 08:23:44 +00:00
bors[bot]
2cee8531c5
Merge #3814
3814: Add impl From for enum variant assist r=flodiebold a=mattyhall

Basically adds a From impl for tuple enum variants with one field. It was recommended to me on the zulip to maybe try using the trait solver, but I had trouble with that as, although it could resolve the trait impl, it couldn't resolve the variable unambiguously in real use. I'm also unsure of how it would work if there were already multiple From impls to resolve - I can't see a way we could get more than one solution to my query.

Fixes #3766

Co-authored-by: Matthew Hall <matthew@quickbeam.me.uk>
2020-04-03 07:46:46 +00:00
Leander Tentrup
bb45aca909 Flatten nested highlight ranges during DFS traversal 2020-04-03 09:46:07 +02:00
Mikhail Modin
35a2cd08c1 Adds to SSR match for semantically equivalent call and method call 2020-04-02 20:18:44 +01:00
bors[bot]
642f3f4bd6
Merge #3798
3798: Simplify r=Veetaha a=Veetaha

bear with me

Co-authored-by: veetaha <veetaha2@gmail.com>
2020-04-02 18:13:38 +00:00
veetaha
c0cf60dca2 Apply cargo xtask format 2020-04-02 21:12:28 +03:00
veetaha
6190caeeae Migrate to privacy as per review commets 2020-04-02 21:09:03 +03:00
veetaha
bef899aa78 Less mutability 2020-04-02 21:07:05 +03:00
veetaha
a90401aeed Migrate to iters some more 2020-04-02 21:07:05 +03:00
veetaha
987fb26a5b Migrate to iterators 2020-04-02 21:07:05 +03:00
veetaha
b7d5172f69 Simpify workspace handling 2020-04-02 21:07:05 +03:00
veetaha
4b2bf9cf66 Don't clone where you can copy 2020-04-02 21:07:05 +03:00
Matthew Hall
6a2127be28 Cleanup checking for existing impls in impl From assist
Use the trait solver to check if there's an existing implementation of
From<type_in_enum_variant> for the enum.
2020-04-02 18:42:30 +01:00
bors[bot]
09b8ee30ba
Merge #3828
3828: Bumps vsce to 1.75 r=kjeremy a=kjeremy

Fixes a security vulnerability

Co-authored-by: kjeremy <kjeremy@gmail.com>
2020-04-02 16:04:31 +00:00
kjeremy
db102c4766 Bumps vsce to 1.75
Fixes a security vulnerability
2020-04-02 12:03:30 -04:00
bors[bot]
23c4ef5aef
Merge #3811
3811: Add inference for literal and range patterns r=kjeremy a=flodiebold

(cc @JoshMcguigan )

Co-authored-by: Florian Diebold <flodiebold@gmail.com>
2020-04-02 15:14:44 +00:00