Florian Diebold
699ce06ac3
Complete extern prelude (again)
2019-02-04 22:09:56 +01:00
Florian Diebold
1056b480d6
Make extern crates in the root module add to the extern prelude
...
To accomplish this, separate the extern prelude from the per-module item maps.
2019-02-04 21:49:34 +01:00
Florian Diebold
d69023fc72
Lower extern crates to imports
...
This is probably not completely correct, but it kind of works.
2019-02-04 21:49:34 +01:00
Florian Diebold
397d84ee29
Add test for extern crate renames
2019-02-04 21:49:34 +01:00
kjeremy
5227102c12
Test more Self inference
2019-02-04 14:44:06 -05:00
kjeremy
8ec4b84013
Bump insta and proptest to latest
2019-02-04 14:11:51 -05:00
Aleksey Kladov
dbf9820e35
make HirDatabase object-safe
2019-02-03 22:15:31 +03:00
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
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
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
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
kjeremy
f0fdc9d5c0
Go To Implementation for Trait
2019-01-31 18:34:52 -05: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
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]
28fdb8d03c
Merge #701
...
701: Minor type inference tweaks r=flodiebold a=marcusklaas
Pass down expectation for reference expressions and type the guard in match expressions.
I wasn't able to add a test for the former addition because the type variable previously introduced would always resolve to the right type in the things I tried!
Co-authored-by: Marcus Klaas de Vries <mail@marcusklaas.nl>
2019-01-30 20:51:47 +00:00
Florian Diebold
1acff307fe
Move expr_scopes query to its module
2019-01-30 21:39:34 +01:00
Florian Diebold
65864d85f9
Rename FnScopes -> ExprScopes
...
The reason for this is that it describes scopes for any body expression, not
just that of a function. It did not actually refer to functions at all anymore.
2019-01-30 21:23:50 +01:00
Marcus Klaas de Vries
13cb4a1b37
Add test for passing on ref expectations
2019-01-30 21:14:26 +01:00
Aleksey Kladov
ef7eb8c257
Use Crate instead of CrateId
2019-01-30 22:37:20 +03:00
Aleksey Kladov
95aa7e46fc
move item_map_query
2019-01-30 22:36:22 +03:00
kjeremy
04eb15856b
Resolve crate
2019-01-30 13:18:21 -05:00
Jeremy Kolb
3c17643b30
Go to Implementation for structs and enums
2019-01-29 19:13:02 -05:00
Marcus Klaas de Vries
3daca3eb4d
Infer type of match guard
2019-01-28 23:09:14 +01:00
WizardOfMenlo
ec32b2e39c
Use match-all instead of individual branches
2019-01-28 17:17:04 +00:00
WizardOfMenlo
9416904d14
Added support for primitive types type inference when using std::ops::Not
2019-01-28 14:52:43 +00:00
Marcus Klaas de Vries
6249989e6c
Process second review
2019-01-27 17:59:21 +01:00
Marcus Klaas de Vries
f6eb44cd9e
Use type information from the turbofish
2019-01-27 17:59:21 +01:00
Marcus Klaas de Vries
0da1e8b2f8
Add a FnSig to Ty::FnDef
2019-01-27 17:59:21 +01:00
Marcus Klaas de Vries
089b1c57c1
Address some issues flagged in review
2019-01-27 17:59:21 +01:00
Marcus Klaas de Vries
04748a0f16
Add missing ty test snapshot
2019-01-27 17:59:21 +01:00
Marcus Klaas de Vries
aa06893a14
Add type params to FnSignature
2019-01-27 17:59:21 +01:00
Marcus Klaas de Vries
67e40e431a
Initial implementation of generics for method calls
2019-01-27 17:59:21 +01:00
Marcus Klaas de Vries
3bd47c0285
First attempt at generic type inference for fns
2019-01-27 17:59:21 +01:00
Erlend Tobiassen
b775fa285c
Revert parts of "Test non standard crate root"
...
Prefer cursor position over file_map
2019-01-27 16:32:31 +01:00
Erlend Tobiassen
b149882d19
Remove dbg!(...)
2019-01-27 15:44:59 +01:00
Erlend Tobiassen
08e12f974c
Fix bad rebase and rustfmt
2019-01-27 15:37:43 +01:00
Erlend Tobiassen
c5e6db16b1
fix #668
2019-01-27 15:19:38 +01:00
Erlend Tobiassen
683e5e64f4
Test non standard crate root
2019-01-27 15:15:56 +01:00
bors[bot]
ffcf618842
Merge #662
...
662: Preserve indentation in doc comments r=matklad a=kjeremy
Fixes #502
Co-authored-by: Jeremy Kolb <kjeremy@gmail.com>
2019-01-27 08:21:04 +00:00
Florian Diebold
94bbb2418a
Add marks
2019-01-26 23:59:11 +01:00
Florian Diebold
77f92674f9
Handle cycles in type vars
...
This might be the cause of #587 .
2019-01-26 23:48:01 +01:00
bors[bot]
e40d8d4032
Merge #683
...
683: fix AST for if expressions r=matklad a=matklad
Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2019-01-26 21:41:27 +00:00
Aleksey Kladov
619af1e22c
fix AST for if expressions
...
then is not always a block...
2019-01-27 00:37:11 +03:00
Aleksey Kladov
a128075af9
remove Option<SourceFileItemId> hack
2019-01-26 23:27:01 +03:00
Aleksey Kladov
9c1a18a626
store syntax ptr in FileItems
...
we cache the tree in file_item query anyway
2019-01-26 22:48:04 +03:00
Aleksey Kladov
ae97a45c35
remove dead code
2019-01-26 22:43:07 +03:00
Jeremy Kolb
a892067951
Make doc comments optional
2019-01-26 10:35:23 -05:00
Aleksey Kladov
9457b1f0e6
rename source_file -> parse
2019-01-26 11:51:36 +03:00
Aleksey Kladov
4711cbcace
rename FilesDatabase -> SourceDatabase
2019-01-26 11:20:30 +03:00
Aleksey Kladov
3223de5976
move ide queries to ide db
2019-01-26 11:17:05 +03:00
Aleksey Kladov
be1a005ebd
fold syntax database into files database
2019-01-26 11:09:39 +03:00
Aleksey Kladov
23172a116c
rename POS_FIELD -> POS_FIELD_DEF
...
to match NAMED_FIELD_DEF
2019-01-26 00:24:12 +03:00
bors[bot]
3c7acecade
Merge #656
...
656: :arrow_up deps r=matklad a=matklad
Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2019-01-25 20:43:09 +00:00
bors[bot]
d0ddc5a7c1
Merge #655
...
655: Fix type inference of binops on int/float variables r=matklad a=flodiebold
Fixes #651 .
Co-authored-by: Florian Diebold <flodiebold@gmail.com>
2019-01-25 20:36:56 +00:00
Florian Diebold
5a1385007c
Fix type inference of binops on int/float variables
...
Fixes #651 .
2019-01-25 21:32:49 +01:00
Aleksey Kladov
1fd18f020d
⬆️ salsa
2019-01-25 23:27:16 +03:00
Aleksey Kladov
54f30bb6d8
nicer behavior in case of bugs
...
We should always reach a fixed point, but if we fail, let's fail
loudly!
2019-01-25 23:13:07 +03:00
Jeremy A. Kolb
7a0bc2dd64
Add docs to struct fields
2019-01-25 14:29:56 -05:00
Aleksey Kladov
f0c6a040bd
remove dead code
2019-01-25 21:14:41 +03:00
bors[bot]
cc73d3ccbc
Merge #646
...
646: Add module documentation support r=matklad a=kjeremy
Co-authored-by: Jeremy A. Kolb <jkolb@ara.com>
2019-01-25 17:55:29 +00:00
Jeremy A. Kolb
6588579116
Add module documentation support
2019-01-25 12:51:36 -05:00
Aleksey Kladov
9f2574c97e
add ability to get strcut field source
2019-01-25 20:38:03 +03:00
Aleksey Kladov
0044514a4e
remember where fields resolve to during inference
2019-01-25 20:02:53 +03:00
bors[bot]
021e691997
Merge #639
...
639: Update salsa r=matklad a=matklad
Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2019-01-25 12:34:10 +00:00
Aleksey Kladov
08c12e424d
use set methods
2019-01-25 15:25:01 +03:00
Aleksey Kladov
8cf092d5de
:arrow_up salsa
2019-01-25 15:16:50 +03:00
Aleksey Kladov
64d4f42558
reduce visibility
2019-01-25 14:25:30 +03:00
Aleksey Kladov
87ac5f5b36
use positional ids for fields
2019-01-25 14:21:14 +03:00
Aleksey Kladov
47e5536678
rename struct field -> struct field data
2019-01-25 12:58:01 +03:00
Aleksey Kladov
87288d802c
pack enum variants into arena
2019-01-25 12:50:46 +03:00
Aleksey Kladov
2ee2fba752
switch to positional enum variants
2019-01-25 11:35:38 +03:00
Aleksey Kladov
0707f65806
drop obsolete fixme
2019-01-25 10:31:45 +03:00
Aleksey Kladov
3b45ddd984
deglobify
2019-01-25 10:29:55 +03:00
Aleksey Kladov
74beb5bfcb
simplify
2019-01-25 10:29:00 +03:00
Aleksey Kladov
ed27bd8d77
remove useless wrapper
2019-01-25 10:20:35 +03:00