Commit graph

1228 commits

Author SHA1 Message Date
Aleksey Kladov
7e2f4b30db Disable doctests 2019-11-17 18:35:05 +03:00
Aleksey Kladov
2eaa8c94a8 Goto definition works inside macros 2019-11-16 17:00:54 +03:00
Florian Diebold
ee190388ab Upgrade Chalk again 2019-11-16 13:25:54 +01:00
Florian Diebold
351c29d859 Fix handling of the binders in dyn/impl Trait
We need to be more careful now when substituting bound variables (previously, we
didn't have anything that used bound variables except Chalk, so it was not a
problem).

This is obviously quite ad-hoc; Chalk has more infrastructure for handling this
in a principled way, which we maybe should adopt.
2019-11-16 13:25:54 +01:00
Florian Diebold
9c2a9a9a06 Use Chalk's dyn/impl trait support 2019-11-16 13:11:29 +01:00
Florian Diebold
e21b82e035 Upgrade Chalk
Associated type values (in impls) are now a separate entity in Chalk, so we have
to intern separate IDs for them.
2019-11-16 13:11:29 +01:00
bors[bot]
d9d99369b2
Merge #2271
2271: Force passing Source when creating a SourceAnalyzer r=matklad a=matklad



Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2019-11-15 23:12:59 +00:00
Aleksey Kladov
d898ecb8f2 Force passing Source when creating a SourceAnalyzer 2019-11-16 02:12:35 +03:00
bors[bot]
69f3b01dc5
Merge #2268
2268: Handle ast::MacroCall in classify_name and impl FromSource for MacroDef r=matklad a=kjeremy

Fixes #2260

Co-authored-by: kjeremy <kjeremy@gmail.com>
2019-11-15 22:36:10 +00:00
Aleksey Kladov
1c819fc8f6 Prepare SourceAnalyzer for macros 2019-11-16 01:31:40 +03:00
kjeremy
60fd260e7f Handle ast::MacroCall in classify_name and impl FromSource for MacroDef
Fixes #2260
2019-11-15 16:47:58 -05:00
Aleksey Kladov
0404e647e6 Prepare SourceAnalyzer for macros 2019-11-16 00:40:54 +03:00
Aleksey Kladov
bd8af6a413 Sourcify some more 2019-11-16 00:05:10 +03:00
Aleksey Kladov
4c90b7e2ec Sourcify some things
If we want to support macros properly, we need to get rid of those
FileIds everywhere...
2019-11-15 23:24:56 +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
2f6c0c314b Move scope tests to hir_def 2019-11-15 14:47:26 +03:00
Aleksey Kladov
9167da66ac Reduce visibility 2019-11-15 14:15:04 +03:00
Aleksey Kladov
3564fbb7f5 Auto-upgrade some insta snapshots 2019-11-15 12:56:24 +03:00
Aleksey Kladov
487fc448c3 Reduce visibility 2019-11-15 12:24:30 +03:00
Aleksey Kladov
b80fa14a85 Use Local more 2019-11-15 12:00:36 +03:00
Aleksey Kladov
a28907af8c Privatize modules 2019-11-15 10:42:54 +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
f924ae3b86 Move scopes to hir_def 2019-11-14 11:56:13 +03:00
Aleksey Kladov
da2ca01eba Handle macro-generated expressions slightly less wrong 2019-11-14 10:30:30 +03:00
Aleksey Kladov
8c8ef1432e Rename MacroResolver -> Expander 2019-11-14 09:38:25 +03:00
Aleksey Kladov
b3175b7077 Move current file to MacroResolver 2019-11-14 09:37:33 +03:00
Aleksey Kladov
b8f62095d6 Normalize data
No need to store derivable info
2019-11-14 09:09:42 +03:00
Aleksey Kladov
70dd70b1fc Reduce duplication between uncertain floats & ints 2019-11-13 09:56:33 +03:00
Aleksey Kladov
1a90ad5802 Move expression lowering to hir_def 2019-11-12 18:46:57 +03:00
Aleksey Kladov
fe00db72b9 Remove owner from Body 2019-11-12 16:46:27 +03:00
Aleksey Kladov
d09e5a3d9e Move definition of exprs to hir_def 2019-11-12 15:09:25 +03:00
Aleksey Kladov
f5e1b0f97c Minor refactoring 2019-11-12 12:07:47 +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
ff609cc497 Don't reexport generics from HIR 2019-11-11 17:22:06 +03:00
bors[bot]
a599147b42
Merge #2200
2200: Add variables to HIR r=matklad a=matklad

Introduce a `hir::Variable`, which should cover locals, parameters and `self`. Unlike `PatId`, variable knows it's owner so it is self-contained, and should be more convenient to use from `ra_ide_api`. 

The goal here is to hide more details about `Body` from hir, which should make it easier to move `Body` into `hir_def`. I don't think that `ra_ide_api` intrracts with bodies directly at the moment anyway, but the glue layer is based basically on `ast::BindPat`, which seems pretty brittle. 

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2019-11-11 11:48:02 +00:00
Aleksey Kladov
8b7f853cc1 Add hir::Local 2019-11-11 14:42:08 +03:00
bors[bot]
ef2a9aedb6
Merge #2205
2205: Implement bulitin line! macro r=matklad a=edwin0cheng

This PR implements bulitin macro `line!` and add basic infra-structure for other bulitin macros:

1. Extend `MacroDefId` to support builtin macros
2. Add a `quote!` macro for simple quasi quoting.

Note that for support others builtin macros, eager macro expansion have to be supported first, this PR not try to handle it. :)

Co-authored-by: Edwin Cheng <edwin0cheng@gmail.com>
2019-11-11 10:53:24 +00:00
Edwin Cheng
4f7df2aac1 Add MacroDefKind 2019-11-11 18:48:16 +08:00
Aleksey Kladov
ee876e7881 Make primitive tys public 2019-11-11 09:20:18 +03:00
Edwin Cheng
c4aa8b63bc Add line macro and tests 2019-11-11 14:15:09 +08:00
Edwin Cheng
c46768d13d Add basic bultin macro infrastructure 2019-11-11 14:13:31 +08: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
50364bd478 Appease the linter by dummy doc comments 2019-11-04 22:33:21 +03:00
Aleksey Kladov
fd7819c3c0 Simplify 2019-11-04 22:29:51 +03:00