Commit Graph

3784 Commits

Author SHA1 Message Date
Aleksey Kladov
f5bb704568 avoid 'ignored' in test output 2019-02-08 14:34:30 +03:00
Aleksey Kladov
4d0e58afef rename rename to references 2019-02-08 14:34:30 +03:00
Aleksey Kladov
bddd124298 move crate for 2019-02-08 14:34:30 +03:00
Aleksey Kladov
842e8001b2 move changes to a separate file 2019-02-08 14:34:30 +03:00
bors[bot]
9a1d2a46c2 Merge #760
760: Add new assist to remove dbg!() calls r=matklad a=vipentti

This fixes #758.

Currently we try to maintain the cursor position relative to the statement under
cursor, if the cursor is inside the dbg! macro call.

Meaning:
```rust
let foo = dbg!(some.complex<|>().expression());
```
Should turn into:
```rust
let foo = some.complex<|>().expression();
```
With the cursor staying in place.

Co-authored-by: Ville Penttinen <villem.penttinen@gmail.com>
2019-02-07 22:56:14 +00:00
bors[bot]
7e3776ca56 Merge #761
761: Update npm packages r=matklad a=kjeremy



Co-authored-by: kjeremy <kjeremy@gmail.com>
2019-02-07 20:13:17 +00:00
kjeremy
2c7a07e4e8 Update npm packages 2019-02-07 14:55:09 -05:00
Ville Penttinen
be7c5eecc4 Remove unnecessary dbg! calls 2019-02-07 20:42:00 +02:00
Ville Penttinen
6cbf83c946 Add new assist to remove dbg!() calls
This fixes #758.

Currently we try to maintain the cursor position relative to the statement under
cursor, if the cursor is inside the dbg! macro call.

Meaning:

let foo = dbg!(some.complex<|>().expression());

Should turn into:

let foo = some.complex<|>().expression();

With the cursor staying in place.
2019-02-07 20:34:33 +02:00
bors[bot]
d0fd05142f Merge #755
755: Add new configuration "enableEnhancedTyping" to control registering of "type" command r=matklad a=vipentti

This further fixes problems when having a VIM extension (at least vscodevim)
enabled, by not calling `overrideCommand('type', commands.onEnter.handle)` when
enableEnhancedTyping is set to `false`.

The problem is dependent on the order in which extensions are activated, if
rust-analyzer is activated before `vscodevim`, rust-analyzer will register the
`type` command, and when `vscodevim` finally attempts to activate, it will fail
to register the command. This causes `vscodevim` to stop working properly.

This setting allows users to disable the registerCommand `type` in
rust-analyzer, allowing `vscodevim` to work. The setting defaults to `true`.

Currently changing the setting requires reloading of the window.

Co-authored-by: Ville Penttinen <villem.penttinen@gmail.com>
2019-02-07 12:42:53 +00:00
Ville Penttinen
a4d0aebcb8 Run prettier 2019-02-07 12:54:41 +02:00
Ville Penttinen
77a4a311fe Add new configuration "enableEnhancedTyping" to control registering of "type" command
This further fixes problems when having a VIM extension (at least vscodevim)
enabled, by not calling `overrideCommand('type', commands.onEnter.handle)` when
enableEnhancedTyping is set to `false`.

The problem is dependent on the order in which extensions are activated, if
rust-analyzer is activated before `vscodevim`, rust-analyzer will register the
`type` command, and when `vscodevim` finally attempts to activate, it will fail
to register the command. This causes `vscodevim` to stop working properly.

This setting allows users to disable the registerCommand `type` in
rust-analyzer, allowing `vscodevim` to work. The setting defaults to `true`.

Currently changing the setting requires reloading of the window.
2019-02-07 12:37:36 +02:00
bors[bot]
a69ee774ca Merge #754
754: Some clippy things r=matklad a=kjeremy



Co-authored-by: kjeremy <kjeremy@gmail.com>
2019-02-06 21:11:24 +00:00
kjeremy
6753051a45 Some clippy cleanups 2019-02-06 15:50:26 -05:00
bors[bot]
c1e10a24fa Merge #753
753: assists: compute edit r=matklad a=kjeremy

Fixes #751 

Co-authored-by: kjeremy <kjeremy@gmail.com>
2019-02-06 16:18:47 +00:00
kjeremy
bcbee10b89 assists: compute edit 2019-02-06 11:15:18 -05:00
bors[bot]
85ecc463d5 Merge #752
752: cargo update r=kjeremy a=kjeremy

Removes a few crates from the dep chain.

Co-authored-by: kjeremy <kjeremy@gmail.com>
2019-02-06 15:07:36 +00:00
kjeremy
c386328ac0 cargo update 2019-02-06 10:04:48 -05:00
bors[bot]
f6cf9393a8 Merge #750
750: Move assists to a separate crate r=matklad a=matklad

I am slowly coming to conclusion that ide_api_light does not make a lot of sense after all :D 

This PR moves assists to a separate crate, so that assists can use database (so, inspect types, do name-resolution, etc)

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2019-02-06 14:01:07 +00:00
Aleksey Kladov
0c5fd8f7cb move assists to a separate crate 2019-02-06 17:00:00 +03:00
bors[bot]
736a55c97e Merge #748
748: Fill deprecation for LSP r=kjeremy a=kjeremy



Co-authored-by: kjeremy <kjeremy@gmail.com>
Co-authored-by: Jeremy Kolb <kjeremy@gmail.com>
2019-02-06 12:23:26 +00:00
Jeremy Kolb
d107926f86 Remove stray dbg! 2019-02-06 07:22:16 -05:00
kjeremy
852b083794 Fill deprecation for LSP 2019-02-05 17:05:46 -05:00
bors[bot]
569e1e871e Merge #746
746: Rename assits to assists r=kjeremy a=kjeremy



Co-authored-by: Jeremy Kolb <kjeremy@gmail.com>
2019-02-05 13:21:42 +00:00
Jeremy Kolb
e696342afa Rename assits to assists 2019-02-05 08:13:16 -05:00
bors[bot]
4183825475 Merge #740
740: Update dependencies r=kjeremy a=kjeremy



Co-authored-by: kjeremy <kjeremy@gmail.com>
Co-authored-by: Jeremy Kolb <kjeremy@gmail.com>
2019-02-05 12:16:25 +00:00
Jeremy Kolb
c73cc0ab8f Remove unused imports 2019-02-05 07:15:15 -05:00
bors[bot]
4d4c46aff8 Merge #742
742: Extern crate r=matklad a=flodiebold

This implements `extern crate` declarations by lowering them to (absolute) imports, and adds support for absolute paths. It also extracts the extern prelude from the per-module item map, and handles the special case of extern crates in the crate root adding to the extern prelude.

This means we finally resolve `Arc`, so it fixes #523 😄 

Co-authored-by: Florian Diebold <flodiebold@gmail.com>
2019-02-05 07:53:08 +00:00
bors[bot]
94d5d0d7e8 Merge #743
743: Move comment r=matklad a=kjeremy

As pointed out in https://github.com/rust-analyzer/rust-analyzer/pull/738/files#r253651450

Co-authored-by: kjeremy <kjeremy@gmail.com>
2019-02-05 07:36:51 +00:00
bors[bot]
d914ac0069 Merge #744
744: mbe: Ensure repetition separator matches r=matklad a=jrmuizel



Co-authored-by: Jeff Muizelaar <jrmuizel@gmail.com>
2019-02-05 07:28:31 +00:00
Jeff Muizelaar
a4b473226b mbe: Ensure repetition separator matches 2019-02-04 20:19:23 -05:00
Florian Diebold
de4c5e381f Fix ReachedFixedPoint value for unresolved external prelude items 2019-02-04 23:26:25 +01:00
kjeremy
7f92fd858a Move comment 2019-02-04 16:34:02 -05:00
Florian Diebold
699ce06ac3 Complete extern prelude (again) 2019-02-04 22:09:56 +01:00
Florian Diebold
ccef48b6c3 Make it possible to have multiple crate in a mock analysis fixture 2019-02-04 21:49:34 +01:00
Florian Diebold
0c2fedc2cb Add alloc to std deps 2019-02-04 21:49:34 +01:00
Florian Diebold
1056b480d6 Make extern crates in the root module add to the extern prelude
To accomplish this, separate the extern prelude from the per-module item maps.
2019-02-04 21:49:34 +01:00
Florian Diebold
d69023fc72 Lower extern crates to imports
This is probably not completely correct, but it kind of works.
2019-02-04 21:49:34 +01:00
Florian Diebold
397d84ee29 Add test for extern crate renames 2019-02-04 21:49:34 +01:00
Florian Diebold
e163c908ac Add AST for extern crate
Also change it to parse the crate name as a NAME_REF, not a NAME.
2019-02-04 21:49:34 +01:00
bors[bot]
77a824c6a0 Merge #741
741: Test more Self inference r=flodiebold a=kjeremy

These cases didn't look covered.

Co-authored-by: kjeremy <kjeremy@gmail.com>
2019-02-04 20:28:09 +00:00
kjeremy
5227102c12 Test more Self inference 2019-02-04 14:44:06 -05:00
kjeremy
8ec4b84013 Bump insta and proptest to latest 2019-02-04 14:11:51 -05:00
bors[bot]
cc3423c662 Merge #739
739: Future proof by explicitly matching against None r=DJMcNab a=kjeremy



Co-authored-by: kjeremy <kjeremy@gmail.com>
2019-02-04 18:05:33 +00:00
kjeremy
4190bc62c4 cargo update 2019-02-04 12:55:52 -05:00
kjeremy
20e9aa2364 Future proof by explicitly matching against None 2019-02-04 12:49:29 -05:00
bors[bot]
88702a758f Merge #738
738: Implement lens for impls and support resolving lenses. r=matklad a=kjeremy

Closes #620 

Co-authored-by: Jeremy Kolb <kjeremy@gmail.com>
Co-authored-by: kjeremy <kjeremy@gmail.com>
2019-02-04 15:42:29 +00:00
kjeremy
0f7a714c63 Add comment 2019-02-04 10:26:43 -05:00
Jeremy Kolb
6ac4cca6c1 Implement lens for impls and support resolving lenses. 2019-02-04 08:45:33 -05:00
bors[bot]
13a2bdb0a8 Merge #736
736: mbe: Add support matching for matching idents r=jrmuizel a=jrmuizel

Factors out a helper and adds support for matching idents.

Co-authored-by: Jeff Muizelaar <jrmuizel@gmail.com>
2019-02-04 00:50:48 +00:00