Florian Diebold
b2c01f446e
Implement ancestors_with_macros in a better way
2019-12-06 21:53:31 +01:00
Florian Diebold
a565072dde
Try to make go to definition work in format!
...
SourceAnalyzer didn't work properly within expression macro expansions because
it didn't find the enclosing function. Fix this by going up the expansion chain
to find ancestors. This makes the test work, but apparently in real usage it's
still not working.
2019-12-06 21:25:22 +01:00
Florian Diebold
18f6a995d0
Add expansion infrastructure for derive macros
2019-12-05 17:23:09 +01:00
ice1000
009437f5d9
Replace ra_hir_expand::either
with crate
2019-12-03 11:07:56 -05:00
Aleksey Kladov
e823c578c9
Use InFile for AstId
2019-11-28 16:02:38 +03:00
Aleksey Kladov
ccd1b0800a
Rename Source -> InFile
2019-11-28 12:50:26 +03:00
Edwin Cheng
447268ceac
Hide MacroCallLoc
2019-11-27 01:33:08 +08:00
Edwin Cheng
6940ae9eab
Rename BuiltinExpander to BuiltinFnLikeExpander
2019-11-23 21:54:39 +08:00
Edwin Cheng
f4e78a5f4e
Add TestDB
2019-11-23 01:11:33 +08:00
Edwin Cheng
4ff400833f
Add MacroFileKind::Statements
2019-11-22 02:38:14 +08:00
Aleksey Kladov
51baaf298d
Rename with_ast -> with_value
2019-11-20 13:09:21 +03:00
Aleksey Kladov
36e3fc9d54
Rename Source::ast -> Source::value
2019-11-20 09:42:30 +03:00
Aleksey Kladov
2b6f1ab0e2
Collapse TokenMap and RevTokenMap
2019-11-18 16:08:41 +03:00
Aleksey Kladov
b79d678923
Token-based reverse-mapping
2019-11-18 15:08:39 +03:00
Aleksey Kladov
fd52d721e1
More correct expansion mapping
...
We can't really map arbitrary ranges, we only can map tokens
2019-11-17 20:15:55 +03:00
Aleksey Kladov
c8f858d043
Make shift an implementation detail of mbe
2019-11-17 19:11:43 +03:00
Aleksey Kladov
6a70bff451
Don't store shift redundantly
2019-11-17 18:22:34 +03:00
Aleksey Kladov
2eaa8c94a8
Goto definition works inside macros
2019-11-16 17:00:54 +03: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
da2ca01eba
Handle macro-generated expressions slightly less wrong
2019-11-14 10:30:30 +03:00
Edwin Cheng
4f7df2aac1
Add MacroDefKind
2019-11-11 18:48:16 +08:00
Edwin Cheng
1637a8a590
Add quote macro
2019-11-11 14:14:39 +08:00
Edwin Cheng
c46768d13d
Add basic bultin macro infrastructure
2019-11-11 14:13:31 +08:00
Aleksey Kladov
f6c40c09e0
Minor cleanup
2019-11-09 12:49:35 +03:00
Edwin Cheng
0a5ec69404
Remove map_ranges in RevTokenMap
2019-11-09 12:00:46 +08:00
Edwin Cheng
d01e0abdb5
Refactor and simpfily
2019-11-09 04:26:28 +08:00
Edwin Cheng
e6709f64af
Rename and fix typos
2019-11-05 01:38:20 +08:00
Edwin Cheng
67226ebc82
Remove dbg!
2019-11-05 01:38:20 +08:00
Edwin Cheng
ae609d7953
Add parent_expansion to HirFileId
2019-11-05 01:38:20 +08:00
Edwin Cheng
159da285e9
Add macro_expansion_info in hir_expand
2019-11-05 01:38:20 +08:00
Aleksey Kladov
13735d91a7
Move diagnostics to hir_expand
2019-11-02 23:42:38 +03:00
Aleksey Kladov
b8533413cf
Move Source to hir_expand
2019-11-02 23:11:27 +03:00
Aleksey Kladov
ab559f170e
move hygiene to hir_expand
2019-10-30 19:10:53 +03:00
Aleksey Kladov
872ac566bf
push name down to hir_expand
2019-10-30 18:56:20 +03:00
Aleksey Kladov
b05d6e53fb
push either to hir_expand
2019-10-30 18:50:10 +03:00
Aleksey Kladov
16e620c052
move raw_items to hir_def
2019-10-30 17:43:11 +03:00
Aleksey Kladov
bca708ba4c
cleanup
2019-10-29 16:19:08 +03:00
Aleksey Kladov
99b6ecfab0
switch expand to dyn Trait
2019-10-29 16:12:54 +03:00
Aleksey Kladov
7de6eaa58a
remove not that useful indirection
2019-10-29 16:01:14 +03:00
Aleksey Kladov
2a5254c106
reduce visibility
2019-10-29 15:25:46 +03:00
Aleksey Kladov
d095d9273e
remove unused query
2019-10-29 15:22:20 +03:00
Aleksey Kladov
6bf7faf315
flatten hir_expand
2019-10-29 15:11:42 +03:00
Aleksey Kladov
5b803055b7
rename hir_def -> hir_expand
2019-10-29 14:59:55 +03:00