Commit graph

158 commits

Author SHA1 Message Date
Kevin DeLorey
5216b09ed6 Update completion kind to Magic in the unit tests. 2020-02-07 21:02:01 -06:00
Kevin DeLorey
fc46ed81ee Add detection for a user already starting a fn impl and still providing completion. 2020-02-04 22:04:57 -06:00
Kevin DeLorey
698ff91c13 Already implemented fn will no longer be suggested for trait implementations. 2020-01-28 20:33:12 -06:00
Kevin DeLorey
bc1fc6239d Renamed the trait completion mod. 2020-01-22 22:38:03 -06:00
Kevin DeLorey
e3cda83f90 Added basic support for completing fn for trait impl. 2020-01-22 22:34:00 -06:00
Kirill Bulatov
4029e44102 Omit default parameters for reference types 2020-01-22 16:55:09 +02: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
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
Aleksey Kladov
7aa627fe58 Move more stuff to SourceBinder 2020-01-16 16:37:51 +01:00
Aleksey Kladov
a3d6ddbe69 More natural trait setup 2020-01-16 16:27:21 +01:00
Aleksey Kladov
81a45ca1b3 Make FromSource private 2020-01-16 16:08:46 +01:00
Aleksey Kladov
272f6dfd9e Micro-optimize type hints to avoid allocations 2020-01-16 14:31:34 +01: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
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
Aleksey Kladov
aaef88db0e Typos 2020-01-15 16:53:01 +01:00
Aleksey Kladov
5b255b4e6b ⬆️ once_cell 2020-01-15 16:52:28 +01:00
Aleksey Kladov
787d1aba63 Add comment 2020-01-15 16:52:28 +01:00
Aleksey Kladov
4194e5c88c Optimize inlay hints 2020-01-15 16:52:28 +01:00
Aleksey Kladov
11d6b9dadd Only new-style classification 2020-01-15 16:52:28 +01:00
Aleksey Kladov
35bfeaf4af Add a test 2020-01-15 16:52:28 +01:00
Aleksey Kladov
c640c2ea11 Make syntax highlighting linear 2020-01-15 16:52:28 +01:00
Aleksey Kladov
ccfe53376a Introduce SourceBinder 2020-01-15 16:52:28 +01:00
bors[bot]
876f92d547
Merge #2843
2843: Add inlay parameter name hints for call expr r=matklad a=imtsuki

This patch adds Intellij-like parameter name hints for literal values in function calls.

<img width="624" alt="Screenshot" src="https://user-images.githubusercontent.com/8423594/72366533-68d7f800-3735-11ea-9279-cf193ca8ca2f.png">

Signed-off-by: imtsuki <me@qjx.app>

Co-authored-by: imtsuki <me@qjx.app>
2020-01-15 10:24:51 +00:00
imtsuki
d854ad8f27 FnSignature: use unwrap_or_default for parameter_name_list
Signed-off-by: imtsuki <me@qjx.app>
2020-01-15 09:30:19 +08:00
imtsuki
d78a3cb638 Update test snapshot
Signed-off-by: imtsuki <me@qjx.app>
2020-01-15 01:32:03 +08:00
imtsuki
c390e92fdd Add inlay parameter name hints for function calls
Signed-off-by: imtsuki <me@qjx.app>
2020-01-15 01:18:52 +08:00
Aleksey Kladov
a38540771f Move Type API to type 2020-01-14 14:42:52 +01:00
Aleksey Kladov
52e7f67128 Move impls_future to Type, where it belongs 2020-01-14 11:29:43 +01:00
Aleksey Kladov
0358f5fdeb Use lang-items to resolve future trait 2020-01-14 11:29:43 +01:00
kjeremy
c5c5f4260b Readability 2020-01-13 11:38:53 -05:00
kjeremy
a82c679c97 Some clippy lints 2020-01-13 11:27:06 -05:00
memoryruins
5575588387 Add macro_rules item snippet 2020-01-12 18:47:15 -05:00
Roland Ruckerbauer
20b8d283ae Remove hir usage from macro_rules! detection in structure_node() 2020-01-12 17:34:57 +01:00
Roland Ruckerbauer
15c5426b54 Use hir .path() and .name() to differentiate
macro call and macro definition
2020-01-12 17:34:57 +01:00
Roland Ruckerbauer
c6655c67d2 Added test for file_structure unidentified macro definition 2020-01-12 17:34:57 +01:00
Roland Ruckerbauer
db151763d4 Fix file_structure() to recognize macro_rules!
where first token != "macro_rules"
2020-01-12 17:34:57 +01:00
Edwin Cheng
0593da9a36 Fix format 2020-01-12 20:25:58 +08:00
Edwin Cheng
384e1ced88 Use prev_token and next_token 2020-01-12 20:25:58 +08:00
Edwin Cheng
b7ab079211 Use indices first and last instead of min-max 2020-01-12 20:25:58 +08:00
Edwin Cheng
caed836e41 Use first and last token only 2020-01-12 20:25:58 +08:00
Edwin Cheng
b30e6a7b56 Handle extend selection in recursive macro 2020-01-12 20:25:58 +08:00
Edwin Cheng
07f4171b18 Minor fix 2020-01-12 20:25:58 +08:00
Edwin Cheng
4c4416543a Fix formatting 2020-01-12 20:25:58 +08:00
Edwin Cheng
83b2d78bbb Supporting extend selection inside macro calls 2020-01-12 20:25:58 +08:00
Edwin Cheng
db5f73d261 Add test 2020-01-12 19:24:34 +08:00
Edwin Cheng
d7be1a4372 Use attr location for builtin macro goto-imp 2020-01-12 18:08:53 +08:00
Florian Diebold
15fc643e05 Fix ordering problem between qualifying paths and substituting params 2020-01-11 23:33:04 +01:00