Commit Graph

2665 Commits

Author SHA1 Message Date
Florian Diebold
d8ef8acb47 Use aliases in import resolution 2019-02-02 00:23:59 +01:00
Florian Diebold
5a7fce4e4c Pass aliases to ImportData 2019-02-02 00:23:53 +01:00
Florian Diebold
aa5f6a1ee8 Add test for use as 2019-02-02 00:23:53 +01:00
bors[bot]
4447019f4b Merge #693
693: Name resolution refactoring r=matklad a=flodiebold

This is still very WIP, but it's becoming quite big and I want to make sure this isn't going in a completely bad direction 😅. I'm not really happy with how the path resolution looks, and I'm not sure `PerNs<Resolution>` is the best return type -- there are 'this cannot happen in the (types/values) namespace' cases everywhere. I also want to unify the `resolver` and `nameres` namespaces once I'm done switching everything to `Resolver`. Also, `Resolver` only has a lifetime because it needs to have a reference to the `ItemMap` during import resolution 😕 

The differences in the completion snapshots are almost completely just ordering (except it completes `Self` as well now), so I changed it to sort the completions before snapshotting.

Co-authored-by: Florian Diebold <flodiebold@gmail.com>
2019-02-01 22:37:59 +00:00
Florian Diebold
c5852f422f Some cleanup and additional tests 2019-02-01 23:24:26 +01:00
Florian Diebold
d571d26955 Make the Resolution variants tuple variants 2019-02-01 22:54:30 +01:00
Florian Diebold
d3df80dfe4 Cleanup 2019-02-01 22:54:21 +01:00
Florian Diebold
afce8e4426 Use the new Resolver API for goto def 2019-02-01 22:45:43 +01:00
Florian Diebold
33ff7b56ff Use the new Resolver API in completion 2019-02-01 22:45:25 +01:00
Florian Diebold
6b076f1931 Use new Resolver API in type inference 2019-02-01 22:45:23 +01:00
Florian Diebold
758bc72873 Implement methods to build a resolver 2019-02-01 22:17:48 +01:00
Florian Diebold
5208c2aa93 Sketching the resolver API 2019-02-01 22:14:34 +01:00
bors[bot]
2b5c226e86 Merge #718
718: split HirDatabase r=matklad a=csmoe

Closes #706

Co-authored-by: csmoe <csmoe@msn.com>
2019-02-01 14:31:23 +00:00
csmoe
4dffdcf14a split HirDatabase api 2019-02-01 22:05:24 +08:00
csmoe
12433a7887 split hirdatabase 2019-02-01 21:36:51 +08:00
bors[bot]
21c5935931 Merge #722
722: remove hard-coded support for ctry macro r=matklad a=matklad

It was used mainly to prevent HirFileId infra from bitroting, but the
`vec![]` macro can serve that just as well!

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2019-02-01 07:54:32 +00:00
Aleksey Kladov
de85f1e947 remove hard-coded support for ctry macro
It was used mainly to prevent HirFileId infra from bitroting, but the
`vec![]` macro can serve that just as well!
2019-02-01 10:52:36 +03:00
bors[bot]
9d3f4624e1 Merge #721
721: Go To Implementation for Trait r=matklad a=kjeremy

If on a trait def you can now go to all the impls of that trait in the crate.

This is more of #620.

Co-authored-by: kjeremy <kjeremy@gmail.com>
2019-02-01 06:00:47 +00:00
kjeremy
f0fdc9d5c0 Go To Implementation for Trait 2019-01-31 18:34:52 -05:00
Aleksey Kladov
4c0ab7db85 explain the magic 2019-01-31 22:23:30 +02:00
Aleksey Kladov
b4b522fb39 cleanup the api 2019-01-31 22:23:30 +02:00
Aleksey Kladov
a16f6bb27d cleanup 2019-01-31 22:23:30 +02:00
Aleksey Kladov
2d1f0b105d move test 2019-01-31 22:23:30 +02:00
Aleksey Kladov
40feacdeb9 split macros across crates 2019-01-31 22:23:30 +02:00
Aleksey Kladov
ad80a0c551 preserve token spacing 2019-01-31 22:23:30 +02:00
Aleksey Kladov
5934738854 first test sort-of passes 2019-01-31 22:23:30 +02:00
Aleksey Kladov
be03aa5ee7 extract tt cursor 2019-01-31 22:23:30 +02:00
Aleksey Kladov
8d5a8f085c binders boilerplate 2019-01-31 22:23:30 +02:00
Aleksey Kladov
2def5b4e6f more expand boilerplate 2019-01-31 22:23:30 +02:00
Aleksey Kladov
d2a1e07150 more expand boilerplate 2019-01-31 22:23:30 +02:00
Aleksey Kladov
09a8d75351 expand boilerplate 2019-01-31 22:23:30 +02:00
Aleksey Kladov
2d88207853 reshuffle 2019-01-31 22:23:30 +02:00
Aleksey Kladov
ce3636798b move macros to a separate crate 2019-01-31 22:23:30 +02:00
Aleksey Kladov
9a043a163c parses simple macro 2019-01-31 22:23:30 +02:00
Aleksey Kladov
0d9210e9bc handle multibyte tokens 2019-01-31 22:23:30 +02:00
Aleksey Kladov
f3489e8111 add eat methods 2019-01-31 22:23:30 +02:00
Aleksey Kladov
e28a5e048a parsing scaffold 2019-01-31 22:23:30 +02:00
Aleksey Kladov
2980508ad2 debug impls 2019-01-31 22:23:30 +02:00
Aleksey Kladov
82cf0185c3 add repeats to ast 2019-01-31 22:23:30 +02:00
Aleksey Kladov
3bd4560d6e convert punts and literals 2019-01-31 22:23:30 +02:00
Aleksey Kladov
c09c6fc97c start tt convertions boilerplate 2019-01-31 22:23:30 +02:00
Aleksey Kladov
a4342a7fee add conversion boilerplate 2019-01-31 22:23:30 +02:00
Aleksey Kladov
ca327f35ad add macro by example ide 2019-01-31 22:23:30 +02:00
Aleksey Kladov
6846ac2a16 shorten name :-) 2019-01-31 22:23:30 +02:00
Aleksey Kladov
b8f56f89c6 start token tree module 2019-01-31 22:23:30 +02:00
bors[bot]
1bf47d43db Merge #715
715: Use "▶" for test code lens r=matklad a=kjeremy

I find that this makes code lenses stand out more otherwise they can be easy to miss.

Co-authored-by: Jeremy Kolb <kjeremy@gmail.com>
2019-01-31 13:04:03 +00:00
Jeremy Kolb
76c0d0b94d format 2019-01-31 07:44:26 -05:00
bors[bot]
97ade89993 Merge #692
692: [WIP] Correctly parse attributes  r=matklad a=DJMcNab

Reference - https://doc.rust-lang.org/reference/attributes.html
This fixes/investigates inner attributes for:

- [x] `impl` blocks
- [x] `extern` blocks
- [x] `fn`s (fixes #689)
- [x] `mod`s (already supported)
- [x] 'block expressions' (the long text just describes all 'blocks' used as statements)

This also investigates/fixes outer attributes for:

- [ ] 'most statements' (see also: #685, https://doc.rust-lang.org/reference/expressions.html#expression-attributes)
- [x] Enum variants, Struct and Union fields (Fixed in #507)
- [ ] 'Match expression arms' (@matklad can you provide a test case which explains what this means?)
- [ ] 'Generic lifetime or type parameters'
- [ ] 'Elements of array expressions, tuple expressions, call expressions, tuple-style struct and enum variant expressions'
- [ ] 'The tail expression of block expressions'

Co-authored-by: DJMcNab <36049421+djmcnab@users.noreply.github.com>
2019-01-31 07:06:31 +00:00
bors[bot]
777c79ce6b Merge #712
712:  Fix #667 and improvements to introduce_variable r=matklad a=eulerdisk

Fix #667 (but not re-indenting currently), plus many other improvements.
@matklad I'm not sure how to handle re-indenting here.

Co-authored-by: Andrea Pretto <eulerdisk@gmail.com>
2019-01-31 07:00:11 +00: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