Aleksey Kladov
b017bae837
remove infer
method from CodeModel
2019-12-08 12:26:53 +01:00
Aleksey Kladov
7aacf9a197
Drop some unused methods
2019-12-08 12:24:21 +01:00
Aleksey Kladov
200bda3daf
Cleanup Field ty
2019-12-08 12:16:57 +01:00
Aleksey Kladov
08d3166c8b
Cleanup Crate API
2019-12-08 12:02:53 +01:00
Aleksey Kladov
88c5b1282a
Rename GenericParam -> TypeParam
...
We don't have LifetimeParam yet, but they are planned!
2019-12-07 20:25:48 +01:00
Aleksey Kladov
7d2080a031
Classify name works for TypeParams
2019-12-07 19:52:09 +01:00
Aleksey Kladov
1692f07393
ToNav for GenericParam
2019-12-07 19:44:43 +01:00
Aleksey Kladov
8e9837df21
Remove idx and parent generics from generics
...
This makes `hir_def::GenericParams` flatter. The logic for
re-numbering the params is moved to hir instead.
2019-12-07 13:05:56 +01:00
ice1000
38853459e3
Add ModuleSource::Block
2019-12-04 18:30:42 -05:00
ice1000
009437f5d9
Replace ra_hir_expand::either
with crate
2019-12-03 11:07:56 -05:00
Aleksey Kladov
ccd1b0800a
Rename Source -> InFile
2019-11-28 12:50:26 +03:00
Aleksey Kladov
1d14fd1737
Use Name::missing consistently
2019-11-27 23:22:20 +03:00
Aleksey Kladov
04735abfae
Minimize API
2019-11-27 22:21:01 +03:00
Aleksey Kladov
d9a36a736b
Rename module_id -> local_id
2019-11-27 21:31:51 +03:00
Aleksey Kladov
a87579500a
Move Ty
2019-11-27 21:16:00 +03:00
Aleksey Kladov
9fa46ff5c6
Use Id for variats
2019-11-27 16:25:01 +03:00
Aleksey Kladov
17680f6060
More decoupling
2019-11-27 16:02:33 +03:00
Aleksey Kladov
d569869f7a
Decouple more
2019-11-27 15:56:20 +03:00
Aleksey Kladov
bed6869865
Cleanup
2019-11-26 22:56:07 +03:00
Aleksey Kladov
cace49e9a7
Decouple
2019-11-26 22:31:04 +03:00
Aleksey Kladov
936c6950e7
Remove last traces of adt from Ty
2019-11-26 21:32:39 +03:00
Aleksey Kladov
882fe0a47e
More precise NameKind::Self
2019-11-26 21:32:39 +03:00
Aleksey Kladov
4e415a269e
Remove ns-polymorphic type_for_def
2019-11-26 21:04:24 +03:00
Aleksey Kladov
72d8e7e69a
Use TraitId in TraitRef
2019-11-26 18:01:34 +03:00
Aleksey Kladov
24b1e79af5
Remove another helper
2019-11-26 17:45:06 +03:00
Aleksey Kladov
d118997b93
Remove assoc_type_by_name helper
2019-11-26 17:44:43 +03:00
Aleksey Kladov
9bc8f1f4f8
Store names in TraitData
2019-11-26 17:44:43 +03:00
Aleksey Kladov
4a0792362e
Detangle ty from traits a bit
2019-11-26 17:44:43 +03:00
Aleksey Kladov
45d05ed783
id-ify impls_in_crate_query
2019-11-26 15:36:25 +03:00
Aleksey Kladov
a443b5033c
Id-ify Ty::Adt
2019-11-26 14:29:12 +03:00
Aleksey Kladov
e5eadb3390
Introduce hir::Type
...
It should provide a convenient API over more low-level Ty
2019-11-26 14:02:57 +03:00
Aleksey Kladov
3e32ac4f86
More ids in Ty
2019-11-25 18:31:48 +03:00
Aleksey Kladov
5fd68b5929
Fix hir for ast::UnionDef
2019-11-25 17:50:49 +03:00
Aleksey Kladov
5f39c5794e
Use GenericDefIdMore
2019-11-25 15:54:03 +03:00
Aleksey Kladov
d06904e90c
Switch to variant-granularity field type inference
2019-11-25 00:12:36 +03:00
Aleksey Kladov
586acef528
Simplify ADT fields
2019-11-24 22:44:24 +03:00
Aleksey Kladov
191b1d238f
Remove impl_block module
2019-11-24 21:17:37 +03:00
Aleksey Kladov
e48430cbae
Simplify
2019-11-24 20:53:42 +03:00
Aleksey Kladov
63e3ea38d3
Don't redo field resolution in the IDE
2019-11-24 20:06:55 +03:00
Aleksey Kladov
f5e0a31eaf
Cleanup nameres
2019-11-24 18:05:12 +03:00
Aleksey Kladov
99af523b68
Cleanup
2019-11-24 17:36:06 +03:00
Aleksey Kladov
e0b06cb672
Switch to StaticLoc for statics
2019-11-24 15:18:12 +03:00
Aleksey Kladov
f11237561c
Cleanup imports
2019-11-24 14:02:08 +03:00
Aleksey Kladov
ffc2325d19
Move ModuleSource back to hir
2019-11-23 17:12:49 +03:00
Aleksey Kladov
6bdd5fa461
Privatise nameres
2019-11-23 17:12:49 +03:00
Aleksey Kladov
158b1cb524
Rename CrateModuleId
2019-11-23 17:12:49 +03:00
Aleksey Kladov
dd5c2dc5bf
Move ImportId
2019-11-23 16:49:05 +03:00
Aleksey Kladov
e5bcb69e4f
Hide ImportId
2019-11-23 16:39:53 +03:00
Aleksey Kladov
958862093e
Move docs to hir_def
2019-11-23 14:43:38 +03:00
Aleksey Kladov
552ba868af
Move attrs query to hir_def
2019-11-23 11:14:40 +03:00
Aleksey Kladov
7469d2b863
Remove TraitData from API
2019-11-22 18:53:39 +03:00
Aleksey Kladov
fe119fef27
Hide data from public API
2019-11-22 18:51:53 +03:00
Aleksey Kladov
d4f4ae0dd8
Move const&static date to hir_def
2019-11-22 18:46:39 +03:00
Aleksey Kladov
64df759418
Make ImplData's fields public
2019-11-22 17:42:56 +03:00
Aleksey Kladov
78f3b0627c
Move FunctionData to hir_def
2019-11-22 17:18:04 +03:00
Aleksey Kladov
4fc900deb1
Move TypeAlias to hir_def
2019-11-22 13:13:51 +03:00
Aleksey Kladov
4daf931111
Remove old hir::generics module
2019-11-21 16:23:02 +03:00
Aleksey Kladov
6d64798a23
Move resolver to hir_def
2019-11-21 15:39:09 +03:00
Aleksey Kladov
ca1af86e7b
Use GenericParam in ScopeDef
2019-11-21 14:22:30 +03:00
Aleksey Kladov
1312c57d34
Move ScopeDef
2019-11-21 14:21:26 +03:00
Aleksey Kladov
061e6c77b5
Decouple
2019-11-21 14:13:49 +03:00
Aleksey Kladov
0102fb4133
Decouple Resolver
2019-11-21 13:25:03 +03:00
Aleksey Kladov
1cead41510
Simplify
2019-11-20 22:22:32 +03:00
Aleksey Kladov
6241cf9a59
Add HasResolver trait
2019-11-20 22:22:32 +03:00
Aleksey Kladov
7c275a7ed2
Remove hir/adt.rs
2019-11-20 21:34:12 +03:00
Aleksey Kladov
12ec946216
Simplify generic params
2019-11-20 20:50:34 +03:00
Aleksey Kladov
111891dc2d
Move constants to new ID
...
This allows us to get rid of trait item index
2019-11-20 18:41:23 +03:00
Aleksey Kladov
ee95a35664
Don't duplicate ContainerId type
2019-11-20 17:50:02 +03:00
Aleksey Kladov
64c21ed195
Switch type aliases to new sources
2019-11-20 17:43:03 +03:00
Aleksey Kladov
cebeedc66f
Next gen IDs for functions
...
The current system with AstIds has two primaraly drawbacks:
* It is possible to manufacture IDs out of thin air.
For example, it's possible to create IDs for items which are not
considered in CrateDefMap due to cfg. Or it is possible to mixup
structs and unions, because they share ID space.
* Getting the ID of a parent requires a secondary index.
Instead, the plan is to pursue the more traditional approach, where
each items stores the id of the parent declaration. This makes
`FromSource` more awkward, but also more correct: now, to get from an
AST to HIR, we first do this recursively for the parent item, and the
just search the children of the parent for the matching def
2019-11-20 16:22:58 +03:00
Aleksey Kladov
06fa3d8389
Move traits to hir_def
2019-11-20 14:22:38 +03:00
Aleksey Kladov
36e3fc9d54
Rename Source::ast -> Source::value
2019-11-20 09:42:30 +03:00
Aleksey Kladov
b21829f7ed
Remove old impls infrastructure
2019-11-15 21:35:03 +03:00
Aleksey Kladov
c3f84960aa
Flatten expr module
2019-11-15 14:53:09 +03:00
Aleksey Kladov
9c7a2aef30
Refactor Module::from_source to properly descend from root file
2019-11-15 10:26:31 +03:00
Aleksey Kladov
1583ab1558
Move body queries to hir_def
2019-11-14 17:37:22 +03:00
Aleksey Kladov
fc055281a5
Minor cleanup
2019-11-12 11:49:16 +03:00
Aleksey Kladov
c5a18c44e5
Introduce hir::GenericParam
...
Unlike existing hir::GenericParams, this is a global ID.
2019-11-11 17:36:27 +03:00
Aleksey Kladov
8b7f853cc1
Add hir::Local
2019-11-11 14:42:08 +03:00
Aleksey Kladov
6294fd5ec9
Unfork struct and union ids
2019-11-09 15:34:00 +03:00
bors[bot]
14e19c0df1
Merge #2179
...
2179: Use HirDatabase to compute `is_deprecated` r=matklad a=martskins
This PR fixes #2167 by introducing `attributes_query` and adding `fn attrs(&self, def: crate::AttrDef) -> Option<Arc<[Attr]>>;` to the `DefDatabase` trait.
I'm a little concerned about the two spots in `attributes_query` where code is repeated, but I couldn't figure out a way to avoid that, so.. I welcome suggestions 😄
Co-authored-by: Martin Asquino <martin.asquino@gmail.com>
2019-11-06 21:11:42 +00:00
Martin Asquino
cb3767f28a
HirDatabase stored attributes
2019-11-04 18:16:35 -03:00
Aleksey Kladov
739babc391
Move Namespace enum closer to usage
2019-11-04 23:02:35 +03:00
Aleksey Kladov
f0eb9cc6e6
Remove last traces of nameres from hir
2019-11-03 23:49:44 +03:00
Aleksey Kladov
ba2efca2bb
Move CrateDefMap to hir_def
2019-11-03 18:04:06 +03:00
Aleksey Kladov
13735d91a7
Move diagnostics to hir_expand
2019-11-02 23:42:38 +03:00
Florian Diebold
1173c3dab5
Refactor to unify with method resolution
2019-11-01 19:57:08 +01:00
Aleksey Kladov
09f9733ca6
move struct & enum data to hir_def
2019-10-31 16:40:36 +03:00
Aleksey Kladov
1602db7d7d
add ModuleDefId to hir_def
2019-10-31 11:23:30 +03:00
Aleksey Kladov
b20d37cb49
move builtin types to hir_def
2019-10-31 10:51:54 +03:00
Aleksey Kladov
872ac566bf
push name down to hir_expand
2019-10-30 18:56:20 +03:00
Aleksey Kladov
e5300ad3ba
remove forward pointer for type_ref
2019-10-30 17:43:14 +03:00
Aleksey Kladov
f8ddef875a
remove forward pointer for name
2019-10-30 17:43:14 +03:00
Aleksey Kladov
16e620c052
move raw_items to hir_def
2019-10-30 17:43:11 +03:00
Aleksey Kladov
c9cd6aa370
Move ids to hir_def crate
2019-10-30 13:11:38 +03:00
Aleksey Kladov
a136cc0653
introduce ra_hir_def
2019-10-30 12:27:54 +03:00
Aleksey Kladov
1555a1aa0d
remove one more dependency on source roots
2019-10-14 15:15:47 +03:00
Ekaterina Babshukova
aa2f58550a
add module
methods
2019-10-09 14:59:47 +03:00
ice1000
b043358be9
Address comments: fix docs, add completion test for Self
.
2019-10-08 07:32:41 -04:00
ice1000
6bad638928
Support inferring Self
type in enum definitions
...
Signed-off-by: ice1000 <ice1000kotlin@foxmail.com>
2019-10-07 19:40:14 -04:00