aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_syntax/tests/data
diff options
context:
space:
mode:
authorbors[bot] <bors[bot]@users.noreply.github.com>2018-12-27 10:08:34 +0000
committerbors[bot] <bors[bot]@users.noreply.github.com>2018-12-27 10:08:34 +0000
commit1d6dcef5c584d0dffdf5386eec993e41daad0210 (patch)
tree1e67675b7031115b1811863d0f186ad1f98b1fce /crates/ra_syntax/tests/data
parent700165cf17290561dea511565278b9869ed61625 (diff)
parentbc745a139674f289386f3081458793f756cab5b9 (diff)
Merge #332
332: Struct types r=matklad a=flodiebold Infer types for struct fields, and add basic field completions. There's also some code for enums, but I focused on getting structs working. There's still ways to go before this becomes useful: There's no autoderef (or even reference types) and no inference for `self`, for example. Co-authored-by: Florian Diebold <[email protected]>
Diffstat (limited to 'crates/ra_syntax/tests/data')
-rw-r--r--crates/ra_syntax/tests/data/parser/err/0029_field_completion.rs3
-rw-r--r--crates/ra_syntax/tests/data/parser/err/0029_field_completion.txt35
2 files changed, 38 insertions, 0 deletions
diff --git a/crates/ra_syntax/tests/data/parser/err/0029_field_completion.rs b/crates/ra_syntax/tests/data/parser/err/0029_field_completion.rs
new file mode 100644
index 000000000..a7cdc17bb
--- /dev/null
+++ b/crates/ra_syntax/tests/data/parser/err/0029_field_completion.rs
@@ -0,0 +1,3 @@
1fn foo(a: A) {
2 a.
3}
diff --git a/crates/ra_syntax/tests/data/parser/err/0029_field_completion.txt b/crates/ra_syntax/tests/data/parser/err/0029_field_completion.txt
new file mode 100644
index 000000000..fd2a3f37b
--- /dev/null
+++ b/crates/ra_syntax/tests/data/parser/err/0029_field_completion.txt
@@ -0,0 +1,35 @@
1SOURCE_FILE@[0; 24)
2 FN_DEF@[0; 23)
3 FN_KW@[0; 2)
4 WHITESPACE@[2; 3)
5 NAME@[3; 6)
6 IDENT@[3; 6) "foo"
7 PARAM_LIST@[6; 12)
8 L_PAREN@[6; 7)
9 PARAM@[7; 11)
10 BIND_PAT@[7; 8)
11 NAME@[7; 8)
12 IDENT@[7; 8) "a"
13 COLON@[8; 9)
14 WHITESPACE@[9; 10)
15 PATH_TYPE@[10; 11)
16 PATH@[10; 11)
17 PATH_SEGMENT@[10; 11)
18 NAME_REF@[10; 11)
19 IDENT@[10; 11) "A"
20 R_PAREN@[11; 12)
21 WHITESPACE@[12; 13)
22 BLOCK@[13; 23)
23 L_CURLY@[13; 14)
24 WHITESPACE@[14; 19)
25 FIELD_EXPR@[19; 21)
26 PATH_EXPR@[19; 20)
27 PATH@[19; 20)
28 PATH_SEGMENT@[19; 20)
29 NAME_REF@[19; 20)
30 IDENT@[19; 20) "a"
31 DOT@[20; 21)
32 err: `expected field name or number`
33 WHITESPACE@[21; 22)
34 R_CURLY@[22; 23)
35 WHITESPACE@[23; 24)