Commit graph

1910 commits

Author SHA1 Message Date
Florian Diebold
bb029cd29b Rename traits::impl_item -> impl_block as well, as well as the tests 2019-01-04 19:15:15 +01:00
Florian Diebold
0ad13b9477 Add a test for self field completion
Needed to add a default crate graph in the analysis for that.
2019-01-04 19:14:52 +01:00
Florian Diebold
6ab0e292d2 Refactor a bit 2019-01-04 19:14:22 +01:00
Florian Diebold
538147bf94 Resolve the Self type 2019-01-04 19:13:50 +01:00
Florian Diebold
d4db61b9a1 Resolve the self parameter during type inference 2019-01-04 19:12:29 +01:00
Florian Diebold
111126ed3c Type the self parameter 2019-01-04 19:10:50 +01:00
Florian Diebold
ae9530addc Add HIR for impl blocks
Since we need to be able to go from def to containing impl block, as well as the
other direction, and to find all impls for a certain type, a design similar to
the one for modules, where we collect all impls for the whole crate and keep
them in an arena, seemed fitting. The ImplBlock type, which provides the public
interface, then consists only of an Arc to the arena containing all impls, and
the index into it.
2019-01-04 19:10:47 +01:00
bors[bot]
03e70711e6 Merge #426
426: Rename ImplItem to ImplBlock r=flodiebold a=flodiebold

rustc uses the name ImplItem for items in impls, not the impl {} block itself,
which could lead to confusion.

Extracted from #370.

Co-authored-by: Florian Diebold <flodiebold@gmail.com>
2019-01-04 17:30:42 +00:00
Florian Diebold
226e31dae9 Add test for self type inference 2019-01-04 18:28:43 +01:00
Florian Diebold
fe6c4115f6 Rename ImplItem to ImplBlock
rustc uses the name ImplItem for items in impls, not the impl {} block itself,
which could lead to confusion.
2019-01-04 18:28:36 +01:00
bors[bot]
a0d483011d Merge #425
425: remove id arena r=matklad a=matklad



Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2019-01-04 13:58:41 +00:00
Aleksey Kladov
3fe6f422f9 remove id arena 2019-01-04 16:58:10 +03:00
Aleksey Kladov
291d578938 extract area to a crate 2019-01-04 16:58:10 +03:00
bors[bot]
821fa7a50a Merge #424
424: remove non-doc comments from doc comments r=matklad a=csmoe

Closes #357

Co-authored-by: csmoe <csmoe@msn.com>
2019-01-04 13:52:47 +00:00
csmoe
a0ef196d04 add mod doc comments test in ast 2019-01-04 21:51:45 +08:00
csmoe
f604ff5b2f parse doc comment for items 2019-01-04 21:29:00 +08:00
csmoe
8a6d6ac132 add mod doc comment test 2019-01-04 21:28:09 +08:00
bors[bot]
6295bbe6ec Merge #391
391: docing parser methods r=csmoe a=csmoe



Co-authored-by: csmoe <csmoe@msn.com>
2019-01-04 04:36:40 +00:00
csmoe
58139c558a consume trivias for type/const def 2019-01-04 12:22:57 +08:00
csmoe
df591a1e48 doc parsing events 2019-01-04 12:21:47 +08:00
bors[bot]
2fcc6bdafa Merge #421
421: Index macros r=matklad a=matklad

So, this is pretty cool! We now index items which are the result of macro expansion! (of a single currently hard-coded macro). So, workspace symbols can now be used to navigate to `HirDatabase`, for example

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2019-01-03 18:31:41 +00:00
Aleksey Kladov
d61707b4e1 index stuff produced by macros 2019-01-03 21:29:17 +03:00
Aleksey Kladov
ebd7c04faa construct index from symbols directly 2019-01-03 21:29:05 +03:00
bors[bot]
6c0bca5984 Merge #420
420: unit-tests r=matklad a=matklad



Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2019-01-03 17:15:41 +00:00
Aleksey Kladov
cd32177a25 don't create many compilation units for tests 2019-01-03 20:15:12 +03:00
bors[bot]
8a24f25482 Merge #419
419: file-id-to-symbol r=matklad a=matklad



Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2019-01-03 16:56:08 +00:00
Aleksey Kladov
9bb2a74256 embed file_id into FileSymbol 2019-01-03 19:55:34 +03:00
bors[bot]
36af3100f9 Merge #418
418: field-vis r=matklad a=matklad



Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2019-01-03 16:38:14 +00:00
Aleksey Kladov
233b170e83 add pub(crate) works for named fields 2019-01-03 19:37:41 +03:00
bors[bot]
23d45177e2 Merge #417
417: travis-compile r=matklad a=matklad



Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2019-01-03 16:16:26 +00:00
Aleksey Kladov
4477b8e92f dont build PRs on windows 2019-01-03 19:15:05 +03:00
Aleksey Kladov
f2037d28f7 measure compile-time separately on travis 2019-01-03 19:10:45 +03:00
bors[bot]
33924c0939 Merge #416
416: assist-builder r=matklad a=matklad



Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2019-01-03 16:08:52 +00:00
Aleksey Kladov
6be39ba758 fix the test 2019-01-03 19:08:24 +03:00
Aleksey Kladov
a4635a199b more enterprisey assists API 2019-01-03 18:59:17 +03:00
bors[bot]
5443205fdd Merge #415
415: use LSP file system operations r=matklad a=vemoo

implements #131

I've replaced `source_file_edits` and `file_system_edits` with `workspace_edit` because [`WorkspacEdit`](https://docs.rs/languageserver-types/0.53.1/languageserver_types/struct.WorkspaceEdit.html) can represent both.

I only use `document_changes` because `changes` cannot represent file system operations.

But if the client doesn't have the `workspace.workspaceEdit.resourceOperations` capability `WorkspaceEdit` cannot replace the current `FileSystemEdit`. Can we assume that the client will support it?

I also adapted the extension code to make use of the new response type, but only for vscode, i don't know if changes have to be made for the emacs part.

Co-authored-by: Bernardo <berublan@gmail.com>
2019-01-03 13:54:43 +00:00
Bernardo
7d9e02e5a2 fix tests 2019-01-03 14:43:47 +01:00
Bernardo
3ab328b49a use lsp WorkspaceEdit instead of custom source_file_edits and file_system_edits 2019-01-03 14:20:15 +01:00
bors[bot]
aea2183799 Merge #413
413: add visibility owner, refactor assists r=matklad a=matklad



Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2019-01-03 12:22:17 +00:00
Aleksey Kladov
a5935687cb split assists over several files 2019-01-03 15:21:49 +03:00
Aleksey Kladov
5323e59996 rename code-actions -> assists 2019-01-03 15:21:31 +03:00
Aleksey Kladov
0a80d9685a visibility owner 2019-01-03 15:21:31 +03:00
Hirokazu Hata
6ee7788513 Return type name when doc_text_for returns nothing 2019-01-03 21:15:23 +09:00
bors[bot]
d7ca7b8aac Merge #412
412: vec-macro r=matklad a=matklad



Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2019-01-03 11:54:10 +00:00
Aleksey Kladov
3e764f97eb hardcode vec macro 2019-01-03 14:48:23 +03:00
bors[bot]
d29e98dd97 Merge #409
409: Add Analysis#teype_of test r=matklad a=h-michael



Co-authored-by: Hirokazu Hata <h.hata.ai.t@gmail.com>
2019-01-03 10:06:32 +00:00
Hirokazu Hata
4363e7b9b2 Deive type_of test from tests 2019-01-03 19:04:42 +09:00
bors[bot]
e92f2ffe27 Merge #410
410: Detangle symbols r=matklad a=matklad

Previously, we used `FileSymbol` both to represent bytes which are stored in the index and as an API of `ra_analysis`. Mixing internal storage format and an API is not a really bright idea, so we introduce `NavigationTarget` to handle API part.

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2019-01-03 09:59:24 +00:00
Aleksey Kladov
8d61853509 docs 2019-01-03 12:57:30 +03:00
Hirokazu Hata
f99e96698c Remove unnecessary mock functions 2019-01-03 18:27:02 +09:00