Commit Graph

3095 Commits

Author SHA1 Message Date
pcpthm
a1d84f5fb0 Allow attribute on struct literal field 2019-03-17 19:08:35 +09:00
bors[bot]
7d3f48cdaf Merge #968
968: Macro aware name resoltion r=matklad a=matklad

The first commit lays the ground work for new name resolution, including

* extracting position-indendent items from parse trees
* walking the tree of modules
* old-style macro_rules resolve

cc @pnkfelix: this looks like an API name resolution should interact with. 

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2019-03-17 09:59:04 +00:00
Aleksey Kladov
3a77023365 docs 2019-03-17 12:53:22 +03:00
Aleksey Kladov
4d7fa6d30b remove fixme 2019-03-17 12:53:22 +03:00
Aleksey Kladov
6955e392f8 remove old macro support 2019-03-17 12:53:22 +03:00
Aleksey Kladov
ee3cf6172b rename ModuleId -> CrateModuleId 2019-03-17 12:53:22 +03:00
Aleksey Kladov
c51a6a7bdd fix error on wrong path 2019-03-17 12:53:22 +03:00
Aleksey Kladov
0d6b8baa89 log time 2019-03-17 12:53:22 +03:00
Aleksey Kladov
967a4b64af Reorganize name resolution 2019-03-17 12:53:22 +03:00
Aleksey Kladov
d4449945a0 hack around non-terminating macro expansion 2019-03-17 12:52:52 +03:00
Aleksey Kladov
b2a6c17362 remove lower module 2019-03-17 12:52:52 +03:00
Aleksey Kladov
c7259a899c remove ItemMap 2019-03-17 12:52:05 +03:00
Aleksey Kladov
71e5adf694 move tests over to crate-def-map 2019-03-17 12:49:07 +03:00
Aleksey Kladov
2195d1db6d Replace module_tree with CrateDefMap 2019-03-17 12:49:07 +03:00
Aleksey Kladov
182c05a96c add name resolution from the old impl
unlike the old impl, this also handles macro imports across crates
2019-03-17 12:46:13 +03:00
Aleksey Kladov
0d8d918656 add skeleton for macro-aware name resolutions 2019-03-17 12:46:13 +03:00
bors[bot]
65e763fa84 Merge #947
947: Add missing impl members r=matklad a=Xanewok

Closes #878.

This took longer than expected as I wrapped my head around the API and the project - hopefully I didn't miss any edge case here.

r? @matklad 

Co-authored-by: Igor Matuszewski <xanewok@gmail.com>
2019-03-17 08:51:06 +00:00
Igor Matuszewski
30a226c725 Move the primary assist fn to the top of the file 2019-03-16 23:24:17 +01:00
Igor Matuszewski
5b0b87f8de Provide assist when cursor is immediately outside impl item block 2019-03-16 23:19:14 +01:00
Igor Matuszewski
2f36f47dab Do a cleanup/legibility pass 2019-03-16 22:41:13 +01:00
Igor Matuszewski
1df81f3d65 Take into account parent indent when filling trait members 2019-03-16 22:41:13 +01:00
Igor Matuszewski
b3742873d9 Simplify trait resolution fragment 2019-03-16 22:41:13 +01:00
Igor Matuszewski
0e47c371fd Ignore unnamed trait fns and add more tests 2019-03-16 22:41:13 +01:00
Igor Matuszewski
406343492c Simplify calculation of missing functions
Asymptotically computing a set difference is faster but in the average
case we won't have more than ~10 functions. Also prefer not using hash
sets as these may yield nondeterministic results.
2019-03-16 22:41:13 +01:00
Igor Matuszewski
713975b1c1 Properly support the case when the cursor is inside an empty block or outside 2019-03-16 22:41:13 +01:00
Igor Matuszewski
38eece97ec Redo indent calculation when adding missing impl members 2019-03-16 22:41:13 +01:00
Igor Matuszewski
2f616eea9c Implement a simple working assist 2019-03-16 22:41:13 +01:00
Igor Matuszewski
1c07c5ccf9 Calculate missing functions from impl body 2019-03-16 22:41:13 +01:00
Igor Matuszewski
fc060573f9 Add 'add_missing_impl_members' assist stub 2019-03-16 22:41:13 +01:00
bors[bot]
9a59272f5f Merge #981
981: Remove FnSig from FnDef type r=matklad a=flodiebold

It doesn't need to be in there since it's just information from the def. Another
step towards aligning Ty with Chalk's representation.

Co-authored-by: Florian Diebold <flodiebold@gmail.com>
2019-03-16 17:24:55 +00:00
Florian Diebold
7faae12311 Remove FnSig from FnDef type
It doesn't need to be in there since it's just information from the def. Another
step towards aligning Ty with Chalk's representation.
2019-03-16 17:29:55 +01:00
Florian Diebold
a9ddaba905 Refactor FnSig a bit 2019-03-16 17:21:32 +01:00
Florian Diebold
628b530e92 Some more Ty displaying cleanup 2019-03-16 16:50:31 +01:00
bors[bot]
76572e67ea Merge #976
976: Replace Display by a pretty printing trait for Ty r=matklad a=flodiebold

This allows removing the names from Adt and FnDef (and more later), as a first
step towards aligning more with chalk's Ty :)

I may have gone a bit overboard with the definition of the PrettyPrint trait...

Co-authored-by: Florian Diebold <florian.diebold@freiheit.com>
2019-03-16 15:42:36 +00:00
Florian Diebold
c5ee60e05b Replace Display by a pretty printing trait for Ty
This allows removing the names from Adt and FnDef (and more later), as a first
step towards aligning more with chalk's Ty :)
2019-03-16 16:36:59 +01:00
bors[bot]
b6ddf976f1 Merge #978
978: Update some dependencies r=matklad a=kjeremy



Co-authored-by: kjeremy <kjeremy@gmail.com>
2019-03-15 21:15:43 +00:00
kjeremy
c2c79fae72 Update some dependencies 2019-03-15 11:36:25 -04:00
bors[bot]
cd9e93aa14 Merge #977
977: Fix ra-emacs-lsp for newest lsp-mode with native json support r=matklad a=flodiebold



Co-authored-by: Florian Diebold <florian.diebold@freiheit.com>
2019-03-15 05:03:50 +00:00
Florian Diebold
c656bf3946 Fix ra-emacs-lsp for newest lsp-mode with native json support 2019-03-14 22:08:37 +01:00
bors[bot]
eb4d6cf25f Merge #975
975: sort navigations to make tests stable r=matklad a=matklad



Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2019-03-14 10:29:29 +00:00
Aleksey Kladov
8774067a87 sort navigations to make tests stable 2019-03-14 13:28:45 +03:00
bors[bot]
a0ded3f7c0 Merge #974
974: Add MINUS token the PATTERN_FIRST token set r=matklad a=mchesser

Fixes: #972 

Co-authored-by: Michael Chesser <michaelchesser@outlook.com>
2019-03-14 09:17:21 +00:00
Michael Chesser
943d2fb781 Add test for minus in inner pattern 2019-03-14 19:24:12 +10:30
Michael Chesser
16418c35bc Allow MINUS at the start of a pattern. 2019-03-14 19:24:11 +10:30
bors[bot]
f7065c294c Merge #973
973: derive Hash for ra_hir::ModuleDef r=matklad a=pcpthm

I wanted to use `HashSet` but it seems like `Hash` derive is missing for no reason.

Co-authored-by: pcpthm <pcpthm@gmail.com>
2019-03-14 08:32:13 +00:00
pcpthm
adad641c52 derive Hash for ra_hir::ModuleDef 2019-03-14 17:25:51 +09:00
bors[bot]
9280788b1e Merge #971
971: Point to compiler-team repo in the readme r=matklad a=detrumi

The readme still links to the old repo, which redirects to the new one

Co-authored-by: Wilco Kusee <wilcokusee@gmail.com>
2019-03-14 07:04:56 +00:00
Wilco Kusee
4133681e7e Point to the compiler-team repo directly 2019-03-13 19:36:26 +01:00
bors[bot]
dc8c5ad32e Merge #970
970: Fix typo r=matklad a=skade



Co-authored-by: Florian Gilcher <florian.gilcher@asquera.de>
2019-03-13 14:50:38 +00:00
Florian Gilcher
6d4038a2c7
Fix typo 2019-03-13 15:23:22 +01:00