Aleksey Kladov
748e6881fc
move tests
2021-10-10 12:52:28 +03:00
Aleksey Kladov
6fd2f1d25b
internal: move tests
2021-10-10 12:45:17 +03:00
Aleksey Kladov
5a854a7253
internal: move tests
2021-10-10 12:39:58 +03:00
Aleksey Kladov
3c9dda6ca9
internal: consistently use ok!();
for succesfull macro expansion
2021-10-10 11:45:05 +03:00
Aleksey Kladov
c88cda04db
move some tests
2021-10-10 11:44:46 +03:00
Aleksey Kladov
a3470a8114
move tests
2021-10-10 11:39:08 +03:00
Aleksey Kladov
7e53a3ce23
move test
2021-10-10 11:29:26 +03:00
Aleksey Kladov
408475a593
move test
2021-10-10 11:26:18 +03:00
Aleksey Kladov
b0a104cbd1
test formatting
2021-10-10 11:22:12 +03:00
Aleksey Kladov
2510eaa9b2
test formatting
2021-10-10 11:16:25 +03:00
Aleksey Kladov
9c819eaa9a
move tests
2021-10-10 11:15:42 +03:00
Aleksey Kladov
1c15f47e00
internal: move tests
2021-10-10 11:11:50 +03:00
Aleksey Kladov
e9902b92ab
internal: move some mbe tests
2021-10-10 11:08:02 +03:00
Aleksey Kladov
f17f5d68f9
move tests
2021-10-10 11:08:02 +03:00
Aleksey Kladov
3a47dba761
fix tests
2021-10-10 11:08:02 +03:00
bors[bot]
64ca0f63bf
Merge #10504
...
10504: Remove needless clone r=lnicola a=k-nasa
## Why
Delete clones for efficiency
## What
- I erased unnecessary clones
Co-authored-by: k-nasa <htilcs1115@gmail.com>
2021-10-10 07:17:52 +00:00
k-nasa
b50cb5c261
Remove neesless clone
2021-10-10 10:50:51 +09:00
Aleksey Kladov
de136a5340
move test
2021-10-09 19:11:04 +03:00
Aleksey Kladov
e838da18a9
internal: move tests
2021-10-09 18:54:15 +03:00
Aleksey Kladov
0dc87badd7
internal: move test
2021-10-09 18:51:26 +03:00
Aleksey Kladov
0a32c20142
internal: move test
2021-10-09 18:49:14 +03:00
Aleksey Kladov
419c234333
internal: move test
2021-10-09 18:46:16 +03:00
Aleksey Kladov
b1cfa51ef5
internal: move tests
2021-10-09 18:43:15 +03:00
Aleksey Kladov
3e8ef943c6
internal: move some tests
2021-10-09 18:18:56 +03:00
Aleksey Kladov
a060b9a4b2
internal: move some macro tests
2021-10-09 18:15:05 +03:00
Aleksey Kladov
c2e425dd00
internal: make sure macro test expand to valid syntax
2021-10-09 18:06:24 +03:00
Aleksey Kladov
c41b7bbe69
internal: allow macro tests to inspect parse tree
2021-10-09 17:58:17 +03:00
Aleksey Kladov
aac23f7832
move tests
2021-10-09 17:43:07 +03:00
Aleksey Kladov
6407e2e789
indent macro output when pprinting
2021-10-09 17:36:41 +03:00
Aleksey Kladov
a0d9e78ec3
align tests to code style
2021-10-09 17:31:24 +03:00
Aleksey Kladov
036c0ff8c7
move some tests
2021-10-09 17:27:38 +03:00
Aleksey Kladov
cb1b6a273f
internal: don't un-indent macro tests manually
2021-10-09 17:17:37 +03:00
Aleksey Kladov
afacdd612d
internal: update expect
2021-10-09 17:17:16 +03:00
Aleksey Kladov
959da8caa1
internal: move test
2021-10-09 16:31:26 +03:00
Aleksey Kladov
59c86ff300
rename
2021-10-09 16:28:11 +03:00
Aleksey Kladov
75b0ce17cf
move test
2021-10-09 16:27:19 +03:00
Aleksey Kladov
0dd1b35479
move test
2021-10-09 16:25:37 +03:00
Aleksey Kladov
574df660e4
move test
2021-10-09 16:22:42 +03:00
Aleksey Kladov
b21244e080
internal: move test
2021-10-09 16:19:19 +03:00
Aleksey Kladov
84d182c7a2
internal: docs
2021-10-09 15:29:31 +03:00
Aleksey Kladov
ef1251f696
feat: report errors in macro definition
...
Reporting macro *definition* error at the macro *call site* is a rather
questionable approach, but at least we don't erase the errors
altogether!
2021-10-09 15:23:55 +03:00
Aleksey Kladov
b3d1de93af
get organizized
2021-10-09 14:53:15 +03:00
Aleksey Kladov
8e9003447c
future proof structure
2021-10-09 14:48:38 +03:00
Aleksey Kladov
5ecda802f1
move test
2021-10-09 14:45:52 +03:00
Aleksey Kladov
f4ee0d736c
move tests
2021-10-09 14:39:24 +03:00
Aleksey Kladov
1abe3f8275
internal: move tests
2021-10-09 14:22:49 +03:00
Aleksey Kladov
49f5fecf06
internal: move test
2021-10-09 14:18:53 +03:00
Aleksey Kladov
78ca43ef3d
internal: move test
2021-10-09 13:51:02 +03:00
Aleksey Kladov
093f99b809
internal: start new macro test suite
...
I don't like our macro tests -- they are brittle and don't inspire
confidence. I think the reason for that is that we try to unit-test
them, but that is at odds with reality, where macro expansion
fundamentally depends on name resolution.
2021-10-09 13:42:32 +03:00
Jonas Schievink
f8acae7895
Support let...else
2021-10-07 17:06:24 +02:00
bors[bot]
f30b62b751
Merge #10479
...
10479: fix: fix "index out of bounds" panic in name resolution r=jonas-schievink a=jonas-schievink
Closes https://github.com/rust-analyzer/rust-analyzer/issues/10084
Closes https://github.com/rust-analyzer/rust-analyzer/issues/9163
This is really just a salsa update to a version that removes the problematic code (see https://github.com/rust-analyzer/rust-analyzer/issues/10084#issuecomment-934445711 )
bors r+
Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
2021-10-06 20:54:27 +00:00
Jonas Schievink
cda9668289
Update salsa
2021-10-06 22:42:54 +02:00
bors[bot]
94fa49c0a3
Merge #10420
...
10420: Parse outer attributes on StructPatternEtCetera r=jonas-schievink a=XFFXFF
Try to fix https://github.com/rust-analyzer/rust-analyzer/issues/8610
Related pr in ungrammer: https://github.com/rust-analyzer/ungrammar/pull/41
Co-authored-by: zhoufan <1247714429@qq.com>
2021-10-06 15:05:40 +00:00
Aramis Razzaghipour
9583dd5725
Replace if let
with match
where appropriate
2021-10-05 09:00:21 +11:00
zhoufan
0ee6b70b34
Parse outer attributes on StructPatternEtCetera
2021-10-02 09:57:44 +08:00
Jonas Schievink
033f87c2f0
Add some profiling calls to name resolution
2021-10-01 15:30:00 +02:00
Giacomo Stevanato
624ee23147
Use the right HirFileId for LowerCtx when expanding macros in fn parameter types
2021-09-29 21:06:37 +02:00
Jonas Schievink
0b76b29512
support non-extern-prelude dependencies
2021-09-28 21:23:46 +02:00
Giacomo Stevanato
49ba313679
Update failing test
2021-09-27 16:59:25 +02:00
Giacomo Stevanato
0d49da5e18
Move GenericParams
's handling of impl Trait
into GenericParams::generic_params_query
2021-09-27 16:59:25 +02:00
Giacomo Stevanato
72bb49467d
Remove SourceMap
2021-09-27 15:23:50 +02:00
Giacomo Stevanato
fe2b1615de
Remove GenericParams::new
2021-09-27 15:20:40 +02:00
Giacomo Stevanato
6e4bf22724
Make impls of HasChildSource
and ChildBySource
for GenericDefId
not use GenericParams::new
2021-09-27 15:20:40 +02:00
Lukas Wirth
b6ed91a6de
Rename *Owner
traits to Has*
2021-09-27 12:54:24 +02:00
Lukas Wirth
a28c5d7311
Rename Dyn*
nodes to Any*
nodes
2021-09-27 12:45:36 +02:00
Aleksey Kladov
2bf81922f7
internal: more reasonable grammar for blocks
...
Consider these expples
{ 92 }
async { 92 }
'a: { 92 }
#[a] { 92 }
Previously the tree for them were
BLOCK_EXPR
{ ... }
EFFECT_EXPR
async
BLOCK_EXPR
{ ... }
EFFECT_EXPR
'a:
BLOCK_EXPR
{ ... }
BLOCK_EXPR
#[a]
{ ... }
As you see, it gets progressively worse :) The last two items are
especially odd. The last one even violates the balanced curleys
invariant we have (#10357 ) The new approach is to say that the stuff in
`{}` is stmt_list, and the block is stmt_list + optional modifiers
BLOCK_EXPR
STMT_LIST
{ ... }
BLOCK_EXPR
async
STMT_LIST
{ ... }
BLOCK_EXPR
'a:
STMT_LIST
{ ... }
BLOCK_EXPR
#[a]
STMT_LIST
{ ... }
2021-09-26 19:16:09 +03:00
Aleksey Kladov
56964c9bd3
feat: allow attributes on all expressions
...
Attrs are syntactically valid on any expression, even if they are not
allowed semantically everywhere yet.
2021-09-25 22:19:27 +03:00
Jonas Schievink
7860d6ade6
Fix item-level lazy macro errors
2021-09-24 21:17:25 +02:00
Lukas Wirth
d99adc5738
Make hover work for intra doc links in macro invocations
2021-09-23 17:32:39 +02:00
Lukas Wirth
42eb4efb5b
Cleanup
2021-09-23 16:28:03 +02:00
Lukas Wirth
6d6e0b8f21
Generate ast nodes for each ast trait
2021-09-21 15:52:11 +02:00
Jonas Schievink
9a320bcf38
Support the new rustc_builtin_macro
syntax
2021-09-09 21:32:41 +02:00
Aleksey Kladov
104cd0ce88
internal: make name consistent with usage
2021-09-06 18:34:03 +03:00
Jonas Schievink
8e736da456
Recover from statement macro expansion errors
2021-09-06 00:16:12 +02:00
Aleksey Kladov
dbb702cfc1
internal: remove accidental code re-use
...
FragmentKind played two roles:
* entry point to the parser
* syntactic category of a macro call
These are different use-cases, and warrant different types. For example,
macro can't expand to visibility, but we have such fragment today.
This PR introduces `ExpandsTo` enum to separate this two use-cases.
I suspect we might further split `FragmentKind` into `$x:specifier` enum
specific to MBE, and a general parser entry point, but that's for
another PR!
2021-09-05 22:36:36 +03:00
Jonas Schievink
d6a12b491f
Don't dump DefMap
s to build the panic context
2021-09-05 20:42:22 +02:00
Jonas Schievink
7d67c71c34
Add panic info for impl_trait
/trait_data
2021-09-05 19:19:34 +02:00
bors[bot]
487078feb5
Merge #10155
...
10155: Minor: replace old name `CrateDefMap` in comments r=jonas-schievink a=toyboot4e
This PR replaces the old name `CrateDefMap` in comments with the new name `DefMap`. The renaming was done in [57a82fb0
](https://github.com/rust-analyzer/rust-analyzer/commit/57a82fb0 ) (Jan 2021).
I didn't touch the working code ([CrateDefMapQueryQuery][QQ]). Thank you.
[QQ]: https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ide_db/src/apply_change.rs#L126
Co-authored-by: toyboot4e <toyboot4e@gmail.com>
2021-09-05 16:57:46 +00:00
Jonas Schievink
65bb5d7511
Add crate name to nameres panic context
2021-09-05 18:48:34 +02:00
toyboot4e
89e46b40c3
Minor: replace old name CrateDefMap
2021-09-05 19:22:34 +09:00
Lukas Wirth
36a5ce9790
minor: fix some clippy lints
2021-09-03 16:00:50 +02:00
Jonas Schievink
b1a4784c95
Augment panic context when resolving path
2021-08-31 13:42:46 +02:00
Dezhi Wu
ba0947dded
switch log
crate to tracing
2021-08-30 15:11:42 +08:00
bors[bot]
99e67f8998
Merge #10044
...
10044: minor: Ignore text and bench attributes again r=Veykril a=Veykril
Reverts part of #9943
Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2021-08-27 20:19:56 +00:00
Lukas Wirth
798c53925a
Ignore text and bench attributes again
2021-08-27 22:19:04 +02:00
bors[bot]
97409e5fc8
Merge #9970
...
9970: feat: Implement attribute input token mapping, fix attribute item token mapping r=Veykril a=Veykril
![image](https://user-images.githubusercontent.com/3757771/130328577-4c1ad72c-51b1-47c3-8d3d-3242ec44a355.png )
The token mapping for items with attributes got overwritten partially by the attributes non-item input, since attributes have two different inputs, the item and the direct input both.
This PR gives attributes a second TokenMap for its direct input. We now shift all normal input IDs by the item input maximum(we maybe wanna swap this see below) similar to what we do for macro-rules/def. For mapping down we then have to figure out whether we are inside the direct attribute input or its item input to pick the appropriate mapping which can be done with some token range comparisons.
Fixes https://github.com/rust-analyzer/rust-analyzer/issues/9867
Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2021-08-27 19:30:36 +00:00
Lukas Wirth
0f3617f76f
fix: Fix multiple derives in one attribute not expanding all in expand_macro
2021-08-26 03:32:45 +02:00
Lukas Wirth
3f9f63c1bd
Improve expand_macro
2021-08-26 02:36:33 +02:00
Lukas Wirth
d99b81f839
Expand derive macros under cursor in Expand Macro Recursively
2021-08-24 16:33:52 +02:00
bors[bot]
996300f4a0
Merge #9989
...
9989: Fix two more “a”/“an” typos (this time the other way) r=lnicola a=steffahn
Follow-up to #9987
you guys are still merging these fast 😅
_this time I thought – for sure – that I’d get this commit into #9987 before it’s merged…_
Co-authored-by: Frank Steffahn <frank.steffahn@stu.uni-kiel.de>
2021-08-22 16:10:48 +00:00
Frank Steffahn
5f5d45468d
Fix two more “a”/“an” typos (this time the other way)
2021-08-22 17:36:58 +02:00
Florian Diebold
424dda8113
Refactor & improve handling of overloaded binary operators
...
Fixes #9971 . Also records them as method resolutions, which we could use
later.
2021-08-22 17:35:50 +02:00
Lukas Wirth
5fb8c0ddfd
Remove MappedSubtree
2021-08-21 18:19:18 +02:00
Lukas Wirth
177c70128c
Map attribute input tokens correctly
2021-08-21 18:13:41 +02:00
Lukas Wirth
351cec0cb4
Do not replace items annotated with builtin attrs with the attr input
2021-08-20 13:50:06 +02:00
Lukas Wirth
6523a09562
style
2021-08-16 18:29:16 +02:00
Lukas Wirth
c90ecc5c26
Only add entries to SourceToDef dynmaps when they come from the same file
2021-08-16 17:07:25 +02:00
Aleksey Kladov
90357a9090
internal: merge hir::BinaryOp and ast::BinOp
2021-08-14 18:10:01 +03:00
Aleksey Kladov
fe4f059450
internal: prepare to merge hir::BinaryOp and ast::BinOp
2021-08-14 17:07:51 +03:00
Aleksey Kladov
6df00f8495
internal: make naming consistent
2021-08-14 17:01:28 +03:00