Commit graph

247 commits

Author SHA1 Message Date
Aleksey Kladov
12e3b4c70b reformat the world 2019-02-08 14:49:43 +03:00
kjeremy
6753051a45 Some clippy cleanups 2019-02-06 15:50:26 -05:00
kjeremy
852b083794 Fill deprecation for LSP 2019-02-05 17:05:46 -05:00
bors[bot]
4d4c46aff8 Merge #742
742: Extern crate r=matklad a=flodiebold

This implements `extern crate` declarations by lowering them to (absolute) imports, and adds support for absolute paths. It also extracts the extern prelude from the per-module item map, and handles the special case of extern crates in the crate root adding to the extern prelude.

This means we finally resolve `Arc`, so it fixes #523 😄 

Co-authored-by: Florian Diebold <flodiebold@gmail.com>
2019-02-05 07:53:08 +00:00
kjeremy
7f92fd858a Move comment 2019-02-04 16:34:02 -05:00
Florian Diebold
0c2fedc2cb Add alloc to std deps 2019-02-04 21:49:34 +01:00
kjeremy
20e9aa2364 Future proof by explicitly matching against None 2019-02-04 12:49:29 -05:00
kjeremy
0f7a714c63 Add comment 2019-02-04 10:26:43 -05:00
Jeremy Kolb
6ac4cca6c1 Implement lens for impls and support resolving lenses. 2019-02-04 08:45:33 -05:00
Laurențiu Nicola
cbc2ac5d09
Add core to STD_DEPS
See #731.
2019-02-03 17:35:42 +02:00
Florian Diebold
33ff7b56ff Use the new Resolver API in completion 2019-02-01 22:45:25 +01:00
Jeremy Kolb
76c0d0b94d format 2019-01-31 07:44:26 -05:00
Jeremy Kolb
57899d66fa Use "▶" for test code lens
I find that this makes code lenses stand out more.
2019-01-30 22:09:27 -05:00
bors[bot]
b704ce803b Merge #702
702: Go to Implementation r=matklad a=kjeremy

First half of #620

Co-authored-by: Jeremy Kolb <kjeremy@gmail.com>
Co-authored-by: kjeremy <kjeremy@gmail.com>
2019-01-30 19:19:31 +00:00
Jeremy Kolb
b88ba007cc Pass Documentation up to LSP and add "rust" to our codeblocks there 2019-01-29 21:39:09 -05:00
Jeremy Kolb
3c17643b30 Go to Implementation for structs and enums 2019-01-29 19:13:02 -05:00
Aleksey Kladov
2ee08098a6 opt-in jemalloc 2019-01-28 15:52:21 +03:00
Aleksey Kladov
d1a67c1174 align command naming 2019-01-28 15:01:22 +03:00
Aleksey Kladov
7801f6b50f automatically collect garbage 2019-01-27 22:57:18 +03:00
DJMcNab
9fbbb8f609 Don't use the reserved error code 2019-01-26 20:58:50 +00:00
DJMcNab
d9456c3989 Return an lsp error 2019-01-26 20:43:51 +00:00
DJMcNab
632b0f2902 Use the correct working directory for cargo metadata and rustfmt 2019-01-26 20:16:15 +00:00
Andrea Pretto
27c071f702 Fold blocks of mod items.
Fixes #572
2019-01-26 00:31:14 +01:00
Aleksey Kladov
f6adb85b68 add gc request 2019-01-25 19:11:58 +03:00
Hrvoje Ban
4eff8ddb8b Fill in DocumentSymbol::detail 2019-01-24 19:05:26 +01:00
Hirokazu Hata
70a35379ab Fix target_selection_range type 2019-01-24 02:47:30 +09:00
Hirokazu Hata
76d52be1da Bumpup lsp-types to v0.55.0 2019-01-24 02:47:03 +09:00
Aleksey Kladov
0ba7e2eaeb ad status command 2019-01-23 01:24:53 +03:00
Jeremy Kolb
5d110c0ee2 Teach CompletionItem about documentation 2019-01-21 21:41:39 -05:00
bors[bot]
f133702f72 Merge #574
574: refactor completions to use TextEdit instead of InsertText r=matklad a=gfreezy

1. migrate from `insertText` to `TextEdit` from `CompleteItem`
2. use `insta` to test completions

Co-authored-by: gfreezy <gfreezy@gmail.com>
2019-01-20 18:27:23 +00:00
Aleksey Kladov
73836cdbbc extend selection expands macros and can totally panic 2019-01-20 21:05:01 +03:00
Aleksey Kladov
171f6e6d00 somewhat better name 2019-01-20 21:01:11 +03:00
Aleksey Kladov
1ec1bd8139 make matching brace consistent 2019-01-20 20:59:46 +03:00
gfreezy
2a43638052 use a combination of source_change and text_edit for CompleteItem 2019-01-20 12:02:00 +08:00
gfreezy
94d96b60f3 refactor to use remove_range and replace_range instead of TextEdit 2019-01-20 00:38:34 +08:00
gfreezy
d08e81cdd8 refactor completions to use TextEdit instead of InsertText 2019-01-19 22:02:50 +08:00
gfreezy
99e8499957 more idiomatic code 2019-01-19 15:36:58 +03:00
gfreezy
6ab6d1eaa0 fix comments 2019-01-19 15:36:58 +03:00
gfreezy
bc0f79f74a rename mod 2019-01-19 15:36:58 +03:00
Aleksey Kladov
b028472481 ⬆️ update rust 2019-01-19 15:36:58 +03:00
Aleksey Kladov
db43b44f71 update cargo_metadata 2019-01-14 16:15:25 +03:00
Aleksey Kladov
7e5ab9b78c switch to lsp-types 2019-01-14 14:32:03 +03:00
Aleksey Kladov
5498a202b6 target_selection_range is not nullable in the implementation 2019-01-13 22:42:42 +03:00
bors[bot]
0199572a3d Merge #517 #518
517: gracefully handle cycles in crate graph r=matklad a=matklad



518: Add an explanatory message when we use the Query fallback r=matklad a=DJMcNab

Fixes https://github.com/rust-analyzer/rust-analyzer/issues/269.

There is no good way to explain it for go_to_def, so I've just fallen back on to_vec.

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
Co-authored-by: DJMcNab <36049421+djmcnab@users.noreply.github.com>
2019-01-13 10:41:47 +00:00
Aleksey Kladov
77f67ca7e2 gracefully handle cycles in crate graph
rust-lang/rust has absolutely weird setup with rustc-workspace-shim,
which leads to real cycles.
2019-01-13 13:39:48 +03:00
Jeremy Kolb
5d273f10cd Add bench runnable and code lens 2019-01-12 18:40:54 -05:00
bors[bot]
eb931c0d9e Merge #505
505: Inherent methods r=matklad a=flodiebold

This adds resolution, type checking and completion for inherent methods.

The main open question here is the caching, I think. I'm not sure whether we should be caching method resolutions in a more fine grained way (currently we just build a hash map of types -> impl blocks, and iterate through all potential impl blocks when looking for a method).

Co-authored-by: Florian Diebold <flodiebold@gmail.com>
2019-01-12 21:18:14 +00:00
bors[bot]
e56072bfa3 Merge #500
500: Code lens support for running tests r=matklad a=kjeremy

Supports running individual and mod tests.

I feel like this kind of abuses the `Runnables` infrastructure but it works. Maybe later on down the line we should introduce a struct that is really just a tuple of binary, arguments, and environment and pass that back to the client instead. `run_single.ts` is just a paired down version of `runnables.ts` and there is duplication because I think run_single will probably change independent of runnables.

Co-authored-by: Jeremy A. Kolb <jkolb@ara.com>
Co-authored-by: Jeremy Kolb <kjeremy@gmail.com>
2019-01-12 18:56:11 +00:00
Jeremy Kolb
72d48b08fb Move CargoTargetSpec and friends to cargo_target_spec module 2019-01-12 13:00:58 -05:00
Florian Diebold
d0bdaa6c00 Complete inherent methods 2019-01-12 15:01:27 +01:00