Commit graph

7081 commits

Author SHA1 Message Date
TomasKralCZ
f67ee69777 added eq_token() method to LetStmt 2020-01-19 18:55:56 +01:00
TomasKralCZ
514df15d9e Merge branch 'master' of https://github.com/rust-analyzer/rust-analyzer 2020-01-19 17:51:03 +01:00
TomasKralCZ
c3b9a19eb7 fix 'add_explicit_type' assist range 2020-01-19 17:40:53 +01:00
TomasKralCZ
8dc94a452c fix typo in 'inline_local_variable' 2020-01-19 17:39:53 +01:00
bors[bot]
3a7724e441
Merge #2875
2875: Improve parameter hints a bit & add emacs support r=matklad a=flodiebold

 - just include the name, not e.g. `mut`
 - don't return empty hints (or `_`)

CC @brotzeit for the Emacs change

Co-authored-by: Florian Diebold <flodiebold@gmail.com>
2020-01-18 13:00:43 +00:00
Florian Diebold
18ec4e3403 Improve parameter hints a bit & add emacs support
- just include the name, not e.g. `mut`
 - don't return empty hints (or `_`)
2020-01-18 13:40:32 +01:00
bors[bot]
d1d91dfe4d
Merge #2870
2870: Fix inference for shift operators r=matklad a=flodiebold

Fixes #2602.

Co-authored-by: Florian Diebold <florian.diebold@freiheit.com>
2020-01-17 16:03:09 +00:00
Florian Diebold
33d637f2dd Fix inference for shift operators
Fixes #2602.
2020-01-17 16:59:51 +01:00
bors[bot]
07dca1123d
Merge #2867
2867: Nest attrs into exprs in function args r=matklad a=matklad



Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2020-01-17 10:50:06 +00:00
Aleksey Kladov
3a859e587f Nest attrs into exprs in function args 2020-01-17 11:47:07 +01:00
Aleksey Kladov
b7c45fba57 Extract expr_with_attrs 2020-01-17 11:44:40 +01:00
Aleksey Kladov
90b8a31b83
Merge pull request #2813 from jyn514/arg_attributes
Allow attributes before function arguments
2020-01-17 11:15:07 +01:00
Joshua Nelson
f077d5c303
move inline function closer to relevant code
also updates generated inline tests
2020-01-16 22:20:17 -05:00
bors[bot]
ea2b27d8b9
Merge #2865
2865: fix(mixed): fixed a couple of typos and added a todo r=kjeremy a=Veetaha

Fixed a couple of typos and added a todo while studying the codebase.

Co-authored-by: Veetaha <gerzoh1@gmail.com>
2020-01-17 02:20:16 +00:00
Veetaha
ecf3b3c9a1 todo(codegen): added todo to change the reference to removed ra_tools crate 2020-01-17 01:31:03 +02:00
bors[bot]
040478834f
Merge #2864
2864: Crates up r=kjeremy a=kjeremy



Co-authored-by: kjeremy <kjeremy@gmail.com>
2020-01-16 22:34:54 +00:00
kjeremy
c27c480c46 Crates up 2020-01-16 17:34:01 -05:00
bors[bot]
91171dedd4
Merge #2863
2863: Minimize test r=matklad a=matklad



Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2020-01-16 17:40:25 +00:00
Aleksey Kladov
5398b9eeba Minimize test 2020-01-16 18:39:29 +01:00
Aleksey Kladov
ab0a11b1de Simplify array parsing 2020-01-16 18:35:03 +01:00
bors[bot]
d3c4fbbbc4
Merge #2862
2862: Move from `from_source` to `SourceBinder` r=matklad a=matklad

bors r+

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2020-01-16 16:58:13 +00:00
Aleksey Kladov
846f11c217 Fix comment 2020-01-16 17:57:50 +01:00
Aleksey Kladov
3ceb9a941a Remove dead code 2020-01-16 17:56:14 +01:00
Aleksey Kladov
6bc236253d Correctly discover module containers 2020-01-16 17:52:58 +01:00
Aleksey Kladov
595b06a1b8 Create modules via SourceBinder 2020-01-16 17:33:07 +01:00
Aleksey Kladov
9a6c26e348 Move module to SourceBinder 2020-01-16 16:53:11 +01:00
bors[bot]
e614356de1
Merge #2827
2827: Fix array element attribute position r=matklad a=edwin0cheng

This PR fixed a bug which an ATTR node insert in the wrong place in array element. ~~And introduce `precede_next` for allow outer attributes to insert into a parsed `expr`.~~  

related #2783

Co-authored-by: Edwin Cheng <edwin0cheng@gmail.com>
2020-01-16 15:49:23 +00:00
Edwin Cheng
a766883a75 fix formating 2020-01-16 23:48:03 +08:00
Aleksey Kladov
16cfc8d50c Cache source for generics 2020-01-16 16:44:25 +01:00
Aleksey Kladov
7aa627fe58 Move more stuff to SourceBinder 2020-01-16 16:37:51 +01:00
Edwin Cheng
ed8d5c86e3 Fix array element attribute position 2020-01-16 23:37:43 +08:00
Aleksey Kladov
a3d6ddbe69 More natural trait setup 2020-01-16 16:27:21 +01:00
Aleksey Kladov
8691ae8ac0 Removed FromSource 2020-01-16 16:16:31 +01:00
Aleksey Kladov
81a45ca1b3 Make FromSource private 2020-01-16 16:08:46 +01:00
bors[bot]
f4eeff2c82
Merge #2861
2861: Micro-optimize type hints to avoid allocations r=matklad a=matklad



Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2020-01-16 13:32:07 +00:00
Aleksey Kladov
272f6dfd9e Micro-optimize type hints to avoid allocations 2020-01-16 14:31:34 +01:00
bors[bot]
04b8bda515
Merge #2860
2860: Minimize visibility r=matklad a=matklad



Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2020-01-16 10:59:03 +00:00
Aleksey Kladov
bd96d0b258 Minimize visibility 2020-01-16 11:58:31 +01:00
Joshua Nelson
c78e34968f
shrink inline tes 2020-01-15 19:12:56 -05:00
Veetaha
51fec39b82 fix(xtask.gen_syntax.typo): add s to the verb that refers to the 3d person 2020-01-16 00:47:03 +02:00
Veetaha
a24dcd7bab fix(ra_parser.typo): amend 'format language' to 'formal language' 2020-01-15 23:29:55 +02:00
bors[bot]
c78d269b66
Merge #2837
2837: Accidentally quadratic r=matklad a=matklad

Our syntax highlighting is accdentally quadratic. Current state of the PR fixes it in a pretty crude way, looks like for the proper fix we need to redo how source-analyzer works. 

**NB:** don't be scared by diff stats, that's mostly a test-data file

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2020-01-15 19:38:10 +00:00
bors[bot]
aa2e13b37f
Merge #2716
2716: Allow assists with multiple selectable actions r=SomeoneToIgnore a=SomeoneToIgnore

This PR prepares an infra for https://github.com/rust-analyzer/rust-analyzer/issues/2180 task by adding a possibility to specify multiple actions in one assist as multiple edit parameters to the `applySourceChange` command.

When this is done, the command opens a selection dialog, allowing the user to pick the edit to be applied.

I have no working example to test in this PR, but here's a demo of an auto import feature (a separate PR coming later for that one) using this functionality:

![out](https://user-images.githubusercontent.com/2690773/71633614-f8ea4d80-2c1d-11ea-9b15-0e13611a7aa4.gif)

The PR is not that massive as it may seem: all the assist files' changes are very generic and similar.

Co-authored-by: Kirill Bulatov <mail4score@gmail.com>
2020-01-15 18:43:23 +00:00
Kirill Bulatov
79b77403b6 Reduce visibility 2020-01-15 20:21:05 +02:00
Kirill Bulatov
d51cf7794d itertools::Either -> either::Either 2020-01-15 20:20:20 +02:00
Kirill Bulatov
78a21253b4 Apply the api design suggestions 2020-01-15 20:17:17 +02:00
Kirill Bulatov
73dc8b6f06 Another attempt to add multiple edits 2020-01-15 20:16:27 +02:00
bors[bot]
01422cc31d
Merge #2856
2856: More orthogonal path editing r=matklad a=matklad



Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2020-01-15 17:54:41 +00:00
Aleksey Kladov
ef1326ee19 More orthogonal path editing 2020-01-15 18:48:28 +01:00
bors[bot]
2f1df3cd74
Merge #2855
2855: More fluent API r=matklad a=matklad



Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2020-01-15 17:32:34 +00:00