Commit Graph

6737 Commits

Author SHA1 Message Date
Aleksey Kladov
d043689735 Touch up docs 2019-12-18 17:04:20 +01:00
bors[bot]
7ea5780867
Merge #2588
2588: Don't bother with focus range for navigation to locals r=matklad a=matklad



Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2019-12-18 15:47:58 +00:00
Aleksey Kladov
7c25224f05 Don't bother with focus range for navigation to locals 2019-12-18 16:45:42 +01:00
bors[bot]
048d0cda97
Merge #2587
2587: Refactor goto tests to always specify texts r=matklad a=matklad



Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2019-12-18 15:04:08 +00:00
Aleksey Kladov
46a299bcee Refactor goto tests to always specify texts 2019-12-18 16:00:35 +01:00
Aleksey Kladov
69c944a1e2 Add blank lines for readability 2019-12-18 16:00:35 +01:00
bors[bot]
c651cf7cd1
Merge #2586
2586: Make reformat hook actually reformat files r=matklad a=matklad



Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2019-12-18 14:47:04 +00:00
Aleksey Kladov
6e48a5bf91 Make reformat hook actually reformat files 2019-12-18 15:45:24 +01:00
Jeremy Kolb
83dc5e7949 cargo fmt 2019-12-18 09:11:47 -05:00
Jeremy Kolb
cdc6af6bda Pass test 2019-12-18 08:58:48 -05:00
bors[bot]
e0d9d75510
Merge #2585
2585: Cleanup Vim and NeoVim instructions. Fix #2579 r=oblitum a=oblitum

I took some freedom to remove additional tips that I simply considered unnecessary as I view it as responsibility of plugin's own docs.

Co-authored-by: Francisco Lopes <francisco@oblita.com>
2019-12-18 13:56:36 +00:00
kjeremy
7ec43ee07a WIP: See through Macros for SignatureHelp
Note: we meed to skip the trivia filter to make sure that
`covers!(call_info_bad_offset)` succeeds otherwise we exit call_info
too early.

Also the test doesn't pass: `FnCallNode::with_node` always detects
a MacroCall.
2019-12-18 08:49:06 -05:00
bors[bot]
242f0ae1d8
Merge #2545
2545: Add Token id to all tt::TokenTree r=matklad a=edwin0cheng

This PR try to add token id to all `tt::Leaf` and `tt::Delimiter`.

~~Some tests are failed now because of #2544~~ 

~~Still blocked by a test in goto-definition : see https://github.com/rust-analyzer/rust-analyzer/pull/2544#issuecomment-565572553~~

Co-authored-by: Edwin Cheng <edwin0cheng@gmail.com>
2019-12-18 11:47:50 +00:00
Edwin Cheng
41544a4088 Refactoring 2019-12-18 13:10:37 +08:00
Edwin Cheng
2ea1cfd780 Rename range to by_kind 2019-12-18 11:36:10 +08:00
Edwin Cheng
e16f3a5ee2 Add test for token map 2019-12-18 11:20:23 +08:00
Edwin Cheng
325532d119 Fix shift id for delim and other tokens 2019-12-18 11:20:23 +08:00
Edwin Cheng
320416d756 Add TokenTextRange 2019-12-18 11:20:22 +08:00
Edwin Cheng
59295854f8 Add token id to delims 2019-12-18 11:20:22 +08:00
Edwin Cheng
aceb9d7fb0 Add token ids for all tt::Leaf 2019-12-18 11:20:22 +08:00
bors[bot]
46ca40ccfc
Merge #2575
2575: [VS Code Extension] Remap error location if it extracted inside macros r=edwin0cheng a=edwin0cheng

It should fix for #2569






Co-authored-by: Edwin Cheng <edwin0cheng@gmail.com>
2019-12-18 03:03:51 +00:00
Edwin Cheng
bb9c60d908 Use substr instead of endswith 2019-12-18 10:50:54 +08:00
Edwin Cheng
63c59308e6 Add tests 2019-12-18 10:47:45 +08:00
Edwin Cheng
d2c1f8ee26 Add macro span handling 2019-12-18 10:47:45 +08:00
Francisco Lopes
f909d2b56c Cleanup Vim and NeoVim instructions. Fix #2579 2019-12-17 20:57:32 -03:00
bors[bot]
ee93fac776
Merge #2583
2583: Use prettier settings in ts-lint r=matklad a=edwin0cheng

This PR add `tslint-plugin-prettier` extension in ts-lint, which "runs prettier rules as tslint rules." and remove  `quotemark` from ts-lint and let prettier to handle it. 

And also fix #2515

Co-authored-by: Edwin Cheng <edwin0cheng@gmail.com>
2019-12-17 21:12:18 +00:00
Edwin Cheng
da29b7fb14 use pretter settings in ts-lint 2019-12-17 23:50:18 +08:00
bors[bot]
ff8f80579a
Merge #2582
2582: Drop dead code r=matklad a=matklad



Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2019-12-17 15:03:38 +00:00
Aleksey Kladov
0630f8110f Drop dead code 2019-12-17 16:03:15 +01:00
bors[bot]
b90f9e6d59
Merge #2581
2581: Refactor PathKind r=matklad a=matklad



Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2019-12-17 14:39:07 +00:00
Aleksey Kladov
aca022f1d4 Refactor PathKind 2019-12-17 15:38:28 +01:00
bors[bot]
f51a3fed9f
Merge #2580
2580: Fix highlighting token names r=matklad a=matklad



Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2019-12-17 13:46:12 +00:00
Aleksey Kladov
1c8467e20a Fix highlighting token names 2019-12-17 14:45:46 +01:00
bors[bot]
4a58522119
Merge #2562
2562: Fix NavigationTarget ranges r=matklad a=edwin0cheng

Fix the issue described in https://github.com/rust-analyzer/rust-analyzer/pull/2544#issuecomment-565572553

This PR change the order for finding `full_range` of `focus_range` in following orders:
1. map both ranges to macro_call
2. map focus range to a token inside macro call, and full range to the whole of macro call
3. map both ranges to the whole of macro call

And fix the corresponding tests and make these tests easily to follow.

Co-authored-by: Edwin Cheng <edwin0cheng@gmail.com>
2019-12-17 13:37:32 +00:00
bors[bot]
a26840d603
Merge #2568
2568: Add option to disable all-targets. r=matklad a=pftbest

Can be useful in embedded.

Co-authored-by: Vadzim Dambrouski <vadzim.dambrouski@promwad.com>
2019-12-17 13:28:37 +00:00
bors[bot]
ba6312a2df
Merge #2571
2571: Fixed a typo in settings r=matklad a=omerbenamram

@lnicola found a typo in the description for one of the settings introduced in #2559.

Co-authored-by: Omer Ben-Amram <omerbenamram@gmail.com>
2019-12-17 13:19:59 +00:00
bors[bot]
7191dd7d53
Merge #2578
2578: Default to client watching on VS Code r=matklad a=matklad



Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2019-12-17 11:42:19 +00:00
Aleksey Kladov
2432f278cb Default to client watching on VS Code 2019-12-17 12:41:44 +01:00
bors[bot]
827831de87
Merge #2577
2577: Improve recovery for incomplete lambdas r=matklad a=matklad



Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2019-12-17 11:12:50 +00:00
Aleksey Kladov
3e2f4e4293 Improve recovery for incomplete lambdas 2019-12-17 12:11:01 +01:00
bors[bot]
cb79e30d53
Merge #2572
2572: link website r=matklad a=matklad



Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2019-12-16 17:47:43 +00:00
Aleksey Kladov
dd2f2dc376 link website 2019-12-16 18:41:03 +01:00
Omer Ben-Amram
624abc1db3 Fixed a typo
thanks @lnicola
2019-12-16 17:32:46 +02:00
Vadzim Dambrouski
22ae4cb906 Fix formatting 2019-12-16 09:01:38 +05:30
bors[bot]
0ef8ace012
Merge #2567
2567: Handle impl Trait more correctly r=flodiebold a=flodiebold

When calling a function, argument-position impl Trait is transparent; same for return-position impl Trait when inside the function. 

So in these cases, we need to represent that type not by `Ty::Opaque`, but by a type variable that can be unified with whatever flows into there.

Co-authored-by: Florian Diebold <flodiebold@gmail.com>
2019-12-15 20:08:12 +00:00
Florian Diebold
91853590a9 Add test mark 2019-12-15 21:06:08 +01:00
Vadzim Dambrouski
a85cd6455a Add option to disable all-targets.
Can be useful in embedded.
2019-12-15 23:32:13 +05:30
Florian Diebold
6e1c2d0df8 Handle impl Trait more correctly
When calling a function, argument-position impl Trait is transparent; same for
return-position impl Trait when inside the function. So in these cases, we need
to represent that type not by `Ty::Opaque`, but by a type variable that can be
unified with whatever flows into there.
2019-12-15 18:56:38 +01:00
Florian Diebold
ac961b2614 Add test for unifying impl Trait 2019-12-15 17:45:32 +01:00
bors[bot]
4e24b25c66
Merge #2565
2565: Fixed syntax highlighting not refreshing on windows. r=matklad a=omerbenamram

I was encoutering the same probelm described in #1690.

It seems that events initiated by the frontend with `rust-analyzer/decorationsRequest` would go through.
So whenever a user switches tabs, highlighting will update.

However, when decorations are initiated by a notification with `rust-analyzer/publishDecorations`, it would fail on this check here 6cbd8a4a4b/editors/code/src/notifications/publish_decorations.ts (L15) (`targetEditor` will always be `undefined`).

This is because it's trying to match the uri `rust-analyzer` sends (which uses an uppercase drive letter) to the uri provided at `editor.document.uri.toString()`, which is both escaped (uses `%3a` for `:`), and uses a lowercase letter drive.

Aparrently this was an issue for some other extensions aswell - https://github.com/Microsoft/vscode/issues/68325.

But this is the defined behavior - c110d84460/src/vs/vscode.d.ts (L1304)

This fix is only relevant for windows.
I've opted for a server-side fix, since rust will always return uppercase letters for drives, there seems to be no other easy solution than manipulating the Url string before sending it to the frontend.


Closes #1690.

Co-authored-by: Omer Ben-Amram <omerbenamram@gmail.com>
2019-12-15 16:35:23 +00:00