Commit graph

5392 commits

Author SHA1 Message Date
Aleksey Kladov
5413875644 move expansion-related code to a separate crate 2019-10-29 14:55:39 +03:00
bors[bot]
4f22d2f3b0
Merge #2112
2112: start ra_hir_def crate r=matklad a=matklad



Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2019-10-29 08:20:02 +00:00
Aleksey Kladov
77f90caf2d start ra_hir_def crate 2019-10-29 11:15:51 +03:00
bors[bot]
120000609a
Merge #2111
2111: Fix autoimport not choosing the deepest use tree in some situations r=matklad a=flodiebold



Co-authored-by: Florian Diebold <flodiebold@gmail.com>
2019-10-28 19:32:52 +00:00
Florian Diebold
6d1b4ffa2e Fix autoimport not choosing the deepest use tree in some situations 2019-10-28 19:08:56 +01:00
bors[bot]
52c34c614b
Merge #2110
2110: weaken requirements of AstDef r=matklad a=matklad



Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2019-10-28 17:30:22 +00:00
Aleksey Kladov
54d3e47318 weaken requirements of AstDef 2019-10-28 20:29:57 +03:00
bors[bot]
1ca41f2118
Merge #2108
2108: fix parsing of for loops inside expressions r=matklad a=matklad



Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2019-10-28 12:41:59 +00:00
Aleksey Kladov
5a6db3ca29 fix parsing of for loops inside expressions
closes #2051
2019-10-28 15:41:34 +03:00
bors[bot]
02828520a7
Merge #2097
2097: Be more precise with function signatures r=matklad a=kjeremy

Finds the closest call expr.

Fixes #2093

Co-authored-by: Jeremy Kolb <kjeremy@gmail.com>
2019-10-28 11:53:16 +00:00
bors[bot]
d9cbffe8a0
Merge #2105
2105: Update crates r=kjeremy a=kjeremy



Co-authored-by: Jeremy Kolb <kjeremy@gmail.com>
2019-10-28 02:47:36 +00:00
Jeremy Kolb
03adea962a Update crates 2019-10-27 22:44:33 -04:00
bors[bot]
bbd0fbd98d
Merge #2101
2101: Preserve whitespace at the end of doc comments r=matklad a=kjeremy

Whitespace can have special meaning in markdown. For instance ending a line with three spaces will render a new line.

Note that this behavior diverges from RLS.

Fixes #1997

Co-authored-by: Jeremy Kolb <kjeremy@gmail.com>
2019-10-27 21:00:16 +00:00
Jeremy Kolb
1438f38eb6 Preserve whitespace at the end of doc comments
Whitespace can have special meaning in markdown. For instance
ending a line with three spaces will render a new line.
Note that this behavior diverges from RLS.

Fixes #1997
2019-10-27 16:56:25 -04:00
bors[bot]
46b63c462d
Merge #2099
2099: Fix panic on raw string assist r=matklad a=aee11

Strings that do not contain two quotation marks would cause a slice indexing panic because `find_usual_string_range` would return a range that only contained a single quotation mark.
Panic example:
```
fn main() {
    let s = "<|>
}
```

I noticed a lot of panics from the `make_raw_string` assist while working on another issue today.

Co-authored-by: Alexander Elís Ebenesersson <alex2789@gmail.com>
2019-10-27 19:20:01 +00:00
Alexander Elís Ebenesersson
17bd3e59f8 Fix panic on raw string assist
Strings that do not contain two quotation marks
would cause a slice indexing panic because code
was assuming `find_usual_string_range` would return
a string with two quotes, but it would incorrectly
also return text ranges containing only a single quote.
2019-10-28 03:00:28 +09:00
Jeremy Kolb
a0d55edc38 Be more precise with function signatures
Fixes #2093
2019-10-27 12:26:44 -04:00
bors[bot]
534c8a0d78
Merge #2096
2096: further simplify assists r=matklad a=matklad



Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2019-10-27 15:24:14 +00:00
Aleksey Kladov
ad3fe316c6 further simplify assists 2019-10-27 18:22:14 +03:00
bors[bot]
f6588b8676
Merge #2095
2095: move all assists to use generated docs r=matklad a=matklad



Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2019-10-27 14:50:27 +00:00
Aleksey Kladov
b6fcacd96d move all assists to use generated docs 2019-10-27 17:49:39 +03:00
bors[bot]
cf309b6a5f
Merge #2094
2094: simplify AssistCtx API r=matklad a=matklad



Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2019-10-27 14:38:28 +00:00
Aleksey Kladov
cda6355de2 simplify AssistCtx API
We never actually use ability to create multiple actions out of a
single context
2019-10-27 17:35:37 +03:00
Aleksey Kladov
9e638c9f3e simplify 2019-10-27 17:27:05 +03:00
bors[bot]
ad950830d0
Merge #2090
2090: move public stuff to top r=matklad a=matklad



Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2019-10-27 14:13:09 +00:00
bors[bot]
6a454c7133
Merge #2091
2091: use new api for flip_trait_bound assist r=matklad a=matklad



Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2019-10-27 14:03:05 +00:00
Aleksey Kladov
85c64ec7be use new api for flip_trait_bound assist 2019-10-27 17:02:43 +03:00
Wesley Norris
fc2fc8528b Add tests for the trait bound flip assist.
Co-authored-by: vlthr <vlthr@users.noreply.github.com>
2019-10-27 16:52:33 +03:00
Wesley Norris
3a64a85a52 Fixes #2054.
This adds the `flip_trait_bound` assist which allows for the swapping of two trait bounds in a trait list that are next to each other.
2019-10-27 16:52:33 +03:00
Aleksey Kladov
be0f48f7cf move public stuff to top 2019-10-27 16:48:20 +03:00
Aleksey Kladov
73532e900e rename auto_import -> add_import
We are long way from auto imports at the moment
2019-10-27 16:46:49 +03:00
bors[bot]
e46c73dc4e
Merge #2088
2088: Extend selection in trait bound extends to plus r=matklad a=aee11

When multiple traits bounds are present, expanded selection
from a single trait bound will include the nearest plus sign
(and whitespace after) before including the whole trait bound.

Fixes: #2055 

Co-authored-by: Alexander Elís Ebenesersson <alex2789@gmail.com>
2019-10-27 13:34:26 +00:00
Alexander Elís Ebenesersson
3e7e3fdf16 extend selection in trait bound extends to plus
When multiple traits bounds are present, expanded selection
from a single trait bound will include the nearest plus sign
(and whitespace after) before including the whole trait bound.
2019-10-27 21:29:06 +09:00
bors[bot]
7dfbe28211
Merge #2087
2087: remove relative_path_buf workaround r=matklad a=matklad



Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2019-10-27 09:40:57 +00:00
Aleksey Kladov
8464c45086 remove relative_path_buf workaround
The upstream problem was fixed with the change to 1.0
2019-10-27 12:36:40 +03:00
bors[bot]
5a3d2332f8
Merge #2086
2086: document almost all assists r=matklad a=matklad



Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2019-10-27 09:23:55 +00:00
Aleksey Kladov
da5528824a document almost all assists 2019-10-27 12:23:22 +03:00
bors[bot]
a455635b48
Merge #2085
2085: lightly document assist_ctx module r=matklad a=matklad



Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2019-10-27 09:04:43 +00:00
Aleksey Kladov
860bbd56ef lightly document assist_ctx module 2019-10-27 12:04:06 +03:00
bors[bot]
c185f74fc9
Merge #2084
2084: use more consistent naming r=matklad a=matklad



Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2019-10-27 08:53:56 +00:00
Aleksey Kladov
8118dc1bb9 use more consistent naming
I think this is the first time I use global rename for rust-analyzer
itself :-)
2019-10-27 11:53:09 +03:00
Aleksey Kladov
61349a3d18 extract assist helper for getting a specific token 2019-10-27 11:53:01 +03:00
Aleksey Kladov
3840324429 raw string assists work in macros 2019-10-27 11:49:13 +03:00
bors[bot]
b85f6d522a
Merge #2083
2083: document some more assists r=matklad a=matklad



Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2019-10-27 08:27:19 +00:00
Aleksey Kladov
a490ba06fa document some more assists 2019-10-27 11:26:46 +03:00
bors[bot]
85984b09e1
Merge #2081
2081: use unicode bar for drawing the cursor r=matklad a=matklad



Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2019-10-26 18:23:59 +00:00
Aleksey Kladov
cf4720ffd5 use unicode bar for drawing the cursor 2019-10-26 21:22:40 +03:00
bors[bot]
1060041393
Merge #2078
2078: support range selection in assist docs r=matklad a=matklad



Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2019-10-26 17:58:12 +00:00
Aleksey Kladov
4a83aae098 support range selection in assist docs 2019-10-26 20:57:23 +03:00
bors[bot]
733fd64260
Merge #2079
2079: avoid TextEditorBuilder for simple edits r=matklad a=matklad



Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2019-10-26 17:11:58 +00:00