Commit graph

5124 commits

Author SHA1 Message Date
Ekaterina Babshukova
311dbb8545 remove visitor module 2019-10-05 17:48:31 +03:00
Ekaterina Babshukova
2fc2290173 replace AST visitors with macro 2019-10-05 17:03:03 +03:00
bors[bot]
dbf869b4d2
Merge #1952
1952: Create an assist for applying De Morgan's Law r=matklad a=cronokirby

Fixes #1807

This assist can transform expressions of the form `!x || !y` into
`!(x && y)`. This also works with `&&`.

This assist will only trigger if the cursor is on the central logical
operator.

The main limitation of this current implementation is that both operands
need to be an explicit negation, either of the form `!x`, or `x != y`.
More operands could be accepted, but this would complicate the implementation
quite a bit.

Co-authored-by: Lúcás Meier <cronokirby@gmail.com>
2019-10-05 09:09:38 +00:00
bors[bot]
cce32719cf
Merge #1957
1957: Add alternative setup instruction for vim/neovim r=matklad a=Luke-Nukem

Provide another option hint for vim/neovim users who do not want to run nodejs

Co-authored-by: Luke Jones <luke@ljones.dev>
2019-10-04 21:51:44 +00:00
bors[bot]
7359bb94a8
Merge #1956
1956: don't keep history for gh-pages r=matklad a=matklad



Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2019-10-04 21:41:59 +00:00
Luke Jones
4bc4cd71b2
Add alternative setup instruction for vim/neovim
Provide another option hint for vim/neovim users who do not want to run nodejs
2019-10-05 10:41:04 +13:00
Aleksey Kladov
f749a1b846 don't keep history for gh-pages
docs weigh a lot, and change a lot. Keeping their changes in history
inflates repo size. By specifying `keep-history: false` we should be
able to avoid that.
2019-10-05 00:40:35 +03:00
Lúcás Meier
e06ad80d49
Fix typo about De Morgan's law assist 2019-10-04 12:45:22 +02:00
Lúcás Meier
fe8ec1c045 [#1807] Add entry in docs/user/features 2019-10-04 11:03:46 +02:00
Lúcás Meier
e17243d698 [#1807] Refactor file structure
Use the more conventional way of importing the ast types, and
put the assist at the top of the file.
2019-10-04 10:51:41 +02:00
Lúcás Meier
1ed1e3d4a7 Fix formatting 2019-10-04 08:21:24 +02:00
Lúcás Meier
e769a54502 Create an assist for applying De Morgan's law
Fixes #1807

This assist can transform expressions of the form `!x || !y` into
`!(x && y)`. This also works with `&&`.

This assist will only trigger if the cursor is on the central logical
operator.

The main limitation of this current implementation is that both operands
need to be an explicit negation, either of the form `!x`, or `x != y`.
More operands could be accepted, but this would complicate the implementation
quite a bit.
2019-10-03 22:48:35 +02:00
Lúcás Meier
ad65ba4062 WIP: Add demorgan application with naive negation 2019-10-03 22:19:46 +02:00
bors[bot]
7d1bb35fb1
Merge #1950
1950: Fix parsing of block expressions in "forbid_structs" contexts. r=kjeremy a=goffrie

Forbidding block expressions entirely is too strict; instead, we should only
forbid them in contexts where we are parsing an optional RHS (i.e. the RHS of a
range expression).

Fixes #1773.

Co-authored-by: Geoffry Song <goffrie@gmail.com>
2019-10-03 15:03:29 +00:00
Geoffry Song
9638adaa40 Fix parsing of block expressions in "forbid_structs" contexts.
Forbidding block expressions entirely is too strict; instead, we should only
forbid them in contexts where we are parsing an optional RHS (i.e. the RHS of a
range expression).
2019-10-03 00:39:52 -07:00
bors[bot]
e1c3675951
Merge #1945
1945: Handle divergence in type inference for blocks r=flodiebold a=lnicola

Fixes #1944.

The `infer_basics` test is failing, not sure what to do about it.

Co-authored-by: Laurențiu Nicola <lnicola@dend.ro>
2019-10-02 18:57:20 +00:00
bors[bot]
ba3ec8b150
Merge #1948
1948: Update pico-args, flexi_logger and either r=matklad a=kjeremy



Co-authored-by: kjeremy <kjeremy@gmail.com>
2019-10-02 17:26:57 +00:00
kjeremy
b4e6939760 Update pico-args 2019-10-02 10:58:15 -04:00
kjeremy
79979db944 flexi_logger and either 2019-10-02 10:48:14 -04:00
Laurențiu Nicola
f491567fb3 Handle divergence in type inference for blocks 2019-10-02 17:31:34 +03:00
bors[bot]
31f22d8549
Merge #1938
1938: ⬆️ deps r=matklad a=matklad



Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2019-09-30 19:10:57 +00:00
Aleksey Kladov
2643ab1d11 ⬆️ deps 2019-09-30 22:05:46 +03:00
bors[bot]
ebfba46112
Merge #1937
1937: Added test for check doc strings in directory crates/ r=andreevlex a=andreevlex

#1856 

Co-authored-by: Alexander Andreev <andreevlex.as@gmail.com>
2019-09-30 10:46:13 +00:00
Alexander Andreev
a47bca636c Change user message. 2019-09-30 13:31:28 +03:00
Alexander Andreev
506222a9b1 Drop debug strings. 2019-09-30 12:09:56 +03:00
Alexander Andreev
81efd696cc Merge branch 'master' into feature/issue/1856
# Conflicts:
#	crates/ra_assists/src/ast_editor.rs
2019-09-30 12:07:26 +03:00
Alexander Andreev
fdbd6bb11a Added test for check doc strings in crates.
#1856
2019-09-30 11:58:53 +03:00
bors[bot]
733f1d8b70
Merge #1934
1934: Parse Path and AttrInput in Attr r=matklad a=uHOOCCOOHu

[Syntax reference](https://doc.rust-lang.org/reference/attributes.html#attributes)

Co-authored-by: uHOOCCOOHu <hooccooh1896@gmail.com>
2019-09-30 08:46:08 +00:00
uHOOCCOOHu
f7e12559cb
Fixes 2019-09-30 16:17:54 +08:00
uHOOCCOOHu
5a4b4f507e
Fix API of Attr 2019-09-30 16:17:53 +08:00
uHOOCCOOHu
71efdaa636
Parse correct AttrInput 2019-09-30 16:11:40 +08:00
bors[bot]
c913b48928
Merge #1936
1936: cleanup editor r=matklad a=matklad



Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2019-09-30 07:16:23 +00:00
Aleksey Kladov
4acadbdca6 cleanup editor 2019-09-30 10:08:28 +03:00
Aleksey Kladov
05ca252fb5 remove ast_editor.rs 2019-09-30 10:05:12 +03:00
Aleksey Kladov
054c53aeb9 move remove bounds to ast/edit.rs 2019-09-30 09:56:20 +03:00
Aleksey Kladov
e010b144d5 move field list to ast/edit.rs 2019-09-30 09:27:26 +03:00
Aleksey Kladov
0840ec038b migrate add impl items to the new editing API 2019-09-28 20:10:53 +03:00
Aleksey Kladov
5dbbfda34a simplify strip attrs 2019-09-28 19:50:16 +03:00
bors[bot]
dbdf0e24d5
Merge #1931
1931: Support the new deprecated tag r=matklad a=arsdragonfly

Which is rendered as a strike-through line. Fixes #1671 .
![深度截图_选择区域_20190927162008](https://user-images.githubusercontent.com/4067473/65799714-ccb4c180-e142-11e9-8e45-ab18964605f3.png)


Co-authored-by: arsdragonfly <arsdragonfly@gmail.com>
2019-09-28 15:59:28 +00:00
bors[bot]
12f617e661
Merge #1932
1932: correctly reset chalk state after a panic r=matklad a=matklad



Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2019-09-28 15:51:02 +00:00
Aleksey Kladov
e60677178e correctly reset chalk state after a panic 2019-09-28 18:49:00 +03:00
arsdragonfly
17d1405a8b Fix 2019-09-27 20:02:51 -04:00
arsdragonfly
945679e42f Fix tests 2019-09-27 17:33:14 -04:00
arsdragonfly
84340db87a Merge branch 'master' of https://github.com/rust-analyzer/rust-analyzer 2019-09-27 16:17:23 -04:00
arsdragonfly
d1988a17f4 Support the new deprecated tag 2019-09-27 16:17:02 -04:00
bors[bot]
21fa889cf3
Merge #1930
1930: replace horrible hack with a slightly less horrible one r=matklad a=matklad



Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2019-09-27 17:48:00 +00:00
Aleksey Kladov
35f1655b0b replace horrible hack with a slightly less horrible one 2019-09-27 20:47:36 +03:00
bors[bot]
2b69c84396
Merge #1815
1815: Support correct `$crate` expansion in macros r=uHOOCCOOHu a=uHOOCCOOHu

This PR makes normal use cases of `$crate` from macros work as expected.

It makes more macros from `std` work. Type inference works well with `panic`, `unimplemented`, `format`, and maybe more.
Sadly that `vec![1, 2, 3]` still not works, but it is not longer an issue about macro.

Screenshot:
![Screenshot_20190927_022136](https://user-images.githubusercontent.com/14816024/65714465-b4568f80-e0cd-11e9-8043-dd44c2ae8040.png)




Co-authored-by: uHOOCCOOHu <hooccooh1896@gmail.com>
2019-09-27 02:58:26 +00:00
uHOOCCOOHu
edadeb95be
Fix 2019-09-27 10:55:25 +08:00
bors[bot]
fc218ec0d0
Merge #1923
1923: Add SubstsBuilder r=flodiebold a=flodiebold

+ further refactoring.

Co-authored-by: Florian Diebold <flodiebold@gmail.com>
2019-09-26 21:04:20 +00:00