Commit Graph

1892 Commits

Author SHA1 Message Date
Aleksey Kladov
9da3705191 drop unused extern crate 2019-02-18 14:39:18 +03:00
Aleksey Kladov
c5a65466e2 hide TaskResult from the public API 2019-02-18 14:29:54 +03:00
Aleksey Kladov
062aa97235 move public API to top of the file 2019-02-18 14:29:39 +03:00
Aleksey Kladov
74288ae272 remove depedency on ra_arena 2019-02-18 14:20:54 +03:00
Aleksey Kladov
4c154c289e remove arena from Roots
we want to move ra_vfs to a new repo, so having fewer deps is useful.
Arena is a thin layer of sugar on top of Vec anyway.
2019-02-18 14:13:13 +03:00
Aleksey Kladov
d151b2a655 remove useless Arc 2019-02-18 14:05:08 +03:00
Aleksey Kladov
5823d3d042 drop unused deps 2019-02-18 12:46:08 +03:00
bors[bot]
16c7ebbb27 Merge #854
854: more compact edits in insta r=matklad a=matklad



Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2019-02-18 09:26:24 +00:00
Aleksey Kladov
a92db7c848 more compact edits in insta 2019-02-18 12:24:25 +03:00
Aleksey Kladov
92aa0f9c87 Don't use additional_text_edits API internally 2019-02-18 12:24:20 +03:00
bors[bot]
564ab84b78 Merge #852
852: Handle != r=flodiebold a=matklad

r? @flodiebold

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2019-02-18 09:13:51 +00:00
Aleksey Kladov
79f35cc699 More orthogonal method naming 2019-02-18 12:07:47 +03:00
Aleksey Kladov
864fd5ee25 More compact debug representation for completion 2019-02-18 10:31:00 +03:00
Aleksey Kladov
4e8a3f565b handle != operator 2019-02-18 10:09:44 +03:00
bors[bot]
8b95c0e0c2 Merge #850
850: Handle tuple structs / enum variants properly in type inference r=matklad a=flodiebold



Co-authored-by: Florian Diebold <flodiebold@gmail.com>
2019-02-18 06:22:07 +00:00
Ville Penttinen
58d14bcaf7 Enable parsing attributes for generic lifetimes and type parameters 2019-02-17 23:32:10 +02:00
Florian Diebold
b82db68400 Handle tuple structs / enum variants properly in type inference 2019-02-17 20:53:13 +01:00
bors[bot]
a725dd4f7a Merge #849
849: Don't render `()` in calls to assoc functions r=matklad a=matklad



Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2019-02-17 18:47:09 +00:00
bors[bot]
646b53ace3 Merge #846
846: WIP: Enable parsing of attributes inside a match block r=matklad a=vipentti

We allow invalid inner attributes to be parsed, e.g. inner attributes that are
not directly after the opening brace of the match block.

Instead we run validation on `MatchArmList` to allow better reporting of errors.

This fixes #845 and works towards #759 



Co-authored-by: Ville Penttinen <villem.penttinen@gmail.com>
2019-02-17 18:39:26 +00:00
Ville Penttinen
bb25958705 Remove match_armlist validator 2019-02-17 20:32:10 +02:00
Aleksey Kladov
e503ffe9ff Don't render () in calls to assoc functions 2019-02-17 21:30:46 +03:00
bors[bot]
3dcde0b2ab Merge #847
847: Refactor vfs r=matklad a=matklad

Some slight refctorings of VFS, in preparation for moving it to a separate repo

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2019-02-17 18:19:27 +00:00
Aleksey Kladov
aea986001f marginally better names 2019-02-17 21:10:40 +03:00
Aleksey Kladov
bb393e2d11 fix-tests 2019-02-17 21:05:33 +03:00
Aleksey Kladov
143e5b628e remove overlay removes overlay 2019-02-17 20:58:28 +03:00
Aleksey Kladov
e8bc29f122 simplify overlay handling 2019-02-17 20:54:11 +03:00
Ville Penttinen
96e3ac389f Parse only outer_attributes for match arms for now 2019-02-17 19:48:08 +02:00
Aleksey Kladov
b719a6cc07 simplify 2019-02-17 20:34:01 +03:00
Ville Penttinen
1c97c1ac11 Enable parsing of attributes inside a match block
We allow invalid inner attributes to be parsed, e.g. inner attributes that are
not directly after the opening brace of the match block.

Instead we run validation on `MatchArmList` to allow better reporting of errors.
2019-02-17 19:26:57 +02:00
Aleksey Kladov
7187fc5c2a rename method 2019-02-17 20:25:52 +03:00
Aleksey Kladov
e95fb7c9f9 remove duplicated method 2019-02-17 20:25:35 +03:00
Aleksey Kladov
162dea51bf hide root config 2019-02-17 20:22:46 +03:00
Aleksey Kladov
6b5d90972a move roots to a module 2019-02-17 19:46:55 +03:00
bors[bot]
982f72c022 Merge #844
844: Refactor find_all_refs to return ReferenceSearchResult r=vipentti a=vipentti

This refactors `find_all_refs` to return a new `ReferenceSearchResult` based on feedback in #839.

There are few questions/notes regarding the refactor:

1. Introducing `NavigationTarget::from_bind_pat` this simply forwards the call to `NavigationTarget::from_named`, could we just expose `from_named` directly as `pub(crate)` ?
2. Added an utility method `NavigationTarget::range` since there were few places where you would use `self.focus_range.unwrap_or(self.full_range)`
3. Implementing `IntoIterator` for `ReferenceSearchResult`. This turns `ReferenceSearchResult` into an iterator over `FileRanges` and allows previous code to mostly stay as it was based on the order that `find_all_refs` previously had (declaration first and then the references). I'm not sure if there is a way of doing the conversion to `IntoIter` without the allocation of a new vector
4. Is it possible to have a binding without a name? I'm not sure if the `NavigationTarget::from_bind_pat` can cause some edge-cases that previously were ok



This fixes #835.

Co-authored-by: Ville Penttinen <villem.penttinen@gmail.com>
2019-02-17 15:38:33 +00:00
Ville Penttinen
fd5307e60d Remove leading :: 2019-02-17 17:25:19 +02:00
Florian Diebold
3c7c7e5a04 Make GenericArgs::from_ast pub(crate) 2019-02-17 14:55:04 +01:00
Florian Diebold
795d718ba1 Unify with the autorefed/autoderefed receiver type during method resolution 2019-02-17 14:44:39 +01:00
Ville Penttinen
85a6bf3424 Refactor find_all_refs to return ReferenceSearchResult 2019-02-17 13:40:43 +02:00
Florian Diebold
a1bda3fc08 Handle generic args for method calls 2019-02-16 23:06:41 +01:00
Florian Diebold
65bd9bc3a8 Handle impl generics in method calls 2019-02-16 23:06:41 +01:00
Florian Diebold
2af067b391 Resolve impl generic params 2019-02-16 23:06:41 +01:00
Florian Diebold
da7056245d Add generic params to impl blocks 2019-02-16 23:06:41 +01:00
Florian Diebold
ccfc6b11c1 Add a test for impl generics 2019-02-16 23:06:41 +01:00
Florian Diebold
0242acae53 Turn ImplBlock into a copy type just containing IDs
This makes it more like the other code model types.

Also make Module::definition_source/declaration_source return HirFileIds, to
make them more like the other source functions.
2019-02-16 22:08:13 +01:00
Aleksey Kladov
2d131d63f9 document design guideline 2019-02-16 15:15:52 +03:00
bors[bot]
13f464edbd Merge #836
836: auto_import: fix bug when the common path was shorter than both the c… r=matklad a=eulerdisk

Fix bug when the common path was shorter than both the current use and target path.

Wrong 1 (unnecessary self)
```
use std::fmt::nested::Debug;
std::fmt::Display<|>
```
--->
```
use std::fmt::{ self, Display, nested::Debug};
Display<|>
```

Wrong 2 (unnecessary, Debug disappear!!)
```
use std::fmt::Debug;
std::fmt::nested::Display
```
-->
```
use std::fmt::Debug::{ self, nested::Display, };
Display<|>
```

Co-authored-by: Andrea Pretto <eulerdisk@gmail.com>
2019-02-16 11:29:03 +00:00
Felix S. Klock II
cc15d3613c Dont slow down everyone else's testing (especially the CI's Linux) just for OS X.
Namely, the allowance for up to 7 events, and thus requiring anyone
with fewer than 7 events to wait for the 3 second timeout, is only
relevant to fsevents (i.e. Mac OS X)
2019-02-15 13:26:19 +01:00
Felix S. Klock II
f7e711b77f Generalize tests/vfs.rs processing to address wildly-varying time-dependent behavior on Mac OS X. 2019-02-15 12:55:30 +01:00
bors[bot]
17370463e2 Merge #830
830: Fix test_vfs_works failing on Windows due to extra Write events r=pnkfelix a=vipentti

On Windows `notify` generates extra `Write` events for folders, which caused
`process_tasks` to not handle all tasks generated on Windows.

This fixes #827

Co-authored-by: Ville Penttinen <villem.penttinen@gmail.com>
2019-02-14 22:00:11 +00:00
Andrea Pretto
e8f3c1650a auto_import: fix bug when the common path was shorter than both the current use and target path.
Shorter test names.
2019-02-14 21:58:36 +01:00