Commit graph

120 commits

Author SHA1 Message Date
Florian Diebold
ab0b63992b Implement basic completion for fields 2018-12-25 15:27:15 +01:00
Florian Diebold
0d724ea572 Improve parsing of incomplete field accesses in preparation for field completion
We need to be able to get the receiver even if there is no field name yet, and
currently "a." wouldn't get parsed as a field name at all. This seems to help.
2018-12-25 15:16:42 +01:00
Florian Diebold
55c941cd9f Type field accesses 2018-12-25 15:16:42 +01:00
Florian Diebold
4cb7b0f2af Add AST definitions for struct/variant fields etc.
Fixes #117
2018-12-25 15:16:42 +01:00
Florian Diebold
6fcd38cc81 Infer result of struct literals, and recurse into their child expressions 2018-12-25 15:16:42 +01:00
Florian Diebold
ef67581104 Resolve paths to defs (functions currently) during type inference 2018-12-23 17:13:11 +01:00
Florian Diebold
93ffbf80c6 Make let statements kind of work 2018-12-23 14:01:50 +01:00
Florian Diebold
3899898d75 Parse integer / float types 2018-12-23 13:48:04 +01:00
Florian Diebold
3ac605e687 Add beginnings of type infrastructure 2018-12-23 13:48:04 +01:00
bors[bot]
e4d0930d9c Merge #316
316: Fix handling of nested self in paths r=matklad a=DJMcNab

See https://github.com/rust-analyzer/rust-analyzer/issues/231#issuecomment-442449505.

Co-authored-by: DJMcNab <36049421+djmcnab@users.noreply.github.com>
2018-12-21 23:19:14 +00:00
DJMcNab
4dbf71d332 Remove uneeded todo in lexer 2018-12-21 22:41:09 +00:00
DJMcNab
d8d60215da Fix handling of nested self in paths 2018-12-21 22:29:59 +00:00
DJMcNab
bd5a358910 Fix where clauses using fully qualified path syntax 2018-12-21 17:20:38 +00:00
Aleksey Kladov
a5987bd715 show debug repr of literals 2018-12-21 18:49:52 +03:00
DJMcNab
55ebe449c9 Fix parsing of contextual_keyword union 2018-12-20 19:46:03 +00:00
DJMcNab
1d1950336f Use a better way of skipping SEMIs 2018-12-20 19:07:11 +00:00
DJMcNab
dc1c64f5b9 Support a blank expression before a semicolon 2018-12-20 19:07:11 +00:00
DJMcNab
134fe4f566 Fix the tests and fix the precommit hook 2018-12-20 16:45:54 +00:00
DJMcNab
466885aa5b Fix missing DOTDOTEQs 2018-12-20 16:22:13 +00:00
DJMcNab
f35151afed Don't require a command before EQ in a where clause 2018-12-20 15:50:42 +00:00
DJMcNab
27e814e182 Simplify NO_BLOCK testing 2018-12-20 12:28:59 +00:00
DJMcNab
5205c016e9 Fix ambiguity with if break
Brought up by #290
2018-12-20 11:35:02 +00:00
DJMcNab
a3b842fb8b Add tests and only traverse in the crates directory 2018-12-19 21:19:32 +00:00
DJMcNab
db67741430 Move is_block to lower in the call tree 2018-12-19 20:55:24 +00:00
DJMcNab
def0a95d35 Revert "Revert to f6f7c5"
This approach is correct, but it needs an addition to Restrictions too

This reverts commit ad00d0c8a5f64142e6636e8b048204c8f8982f4a.
2018-12-19 20:12:18 +00:00
DJMcNab
4dce66ad31 Fix handling of structs in match arms 2018-12-19 20:12:18 +00:00
DJMcNab
cd8e33fb7e Revert to f6f7c5 2018-12-19 20:12:18 +00:00
DJMcNab
7a8560ba38 Fix expression parsing by bailing out upon a macro block being found
TODO: Fix this when the block like macro is in expression position

E.g. `test(test!{})` currently parses
2018-12-19 20:12:18 +00:00
DJMcNab
97e70bf50f Possibly fix #225 2018-12-19 20:12:18 +00:00
DJMcNab
29bf389034 Actually fix at_ts doc comment (committed wrong file :P) 2018-12-19 20:12:18 +00:00
DJMcNab
012537bd6c Fix at_ts doc comment 2018-12-19 20:12:18 +00:00
DJMcNab
20bbe0127c Fix parsing of inclusive ranges (#214)
I'm not certain that this is correct, so extra eyes would be good
2018-12-19 20:12:18 +00:00
Roland Ruckerbauer
d0f1334226 Fixed cast expression parsing in ra_syntax.
The cast expression expected any type via types::type_() function,
but the language spec does only allow TypeNoBounds (types without direct extra bounds
via `+`).

**Example:**

```rust
fn test() {
	6i8 as i32 + 5;
}
```

This fails, because the types::type_() function which should parse the type after the
as keyword is greedy, and takes all plus sign after path types as extra.

My proposed fix is to replace the not implemented `type_no_plus()` just calls (`type_()`)
function, which is used at several places. The replacement is `type_with_bounds_cond(p: &mut Parser, allow_bounds: bool)`, which passes the condition to relevant sub-parsers.

This function is then called by `type_()` and the new public `type_no_bounds()`.
2018-12-17 17:26:24 +01:00
Bernardo
0527e3b283 rename Edit to TextEdit and AtomEdit to AtomTextEdit 2018-12-11 19:07:17 +01:00
Bernardo
7344d28768 extract AtomEdit and Edit into new ra_text_edit crate 2018-12-10 22:09:12 +01:00
Aleksey Kladov
4cbc902fcc grand module rename 2018-12-08 19:30:35 +03:00
DJMcNab
f88e0700e6 Add a better text for hover and stop duplicating work done in approximatelly_resolve_symbol 2018-12-08 19:28:10 +03:00
DJMcNab
89cf7d8743 Clarify and correct comment about multi_byte_tokens 2018-12-08 19:28:10 +03:00
Florian Diebold
1dfd06fc8a Use json comparison code from cargo for heavy tests 2018-12-06 21:32:15 +01:00
Aleksey Kladov
28ddecf6c9 modernize even more 2018-12-06 21:16:37 +03:00
Aleksey Kladov
1761a7d213 modernize some files 2018-12-06 20:49:36 +03:00
bors[bot]
25cf2349ab Merge #256
256: Improve/add use_item documentation r=matklad a=DJMcNab

Adds some documentation to use_item explaining all code paths (use imports are hard, especially with the ongoing discussion of anchored v. uniform paths - see https://github.com/rust-lang/rust/issues/55618 for what appears to be the latest developments)

Co-authored-by: DJMcNab <36049421+djmcnab@users.noreply.github.com>
2018-12-06 17:30:36 +00:00
DJMcNab
5da245ec33 Fix a copy and pasting typo 2018-12-05 21:46:43 +00:00
DJMcNab
0a82d768c4 Improve/add the use_item documentation 2018-12-05 21:43:40 +00:00
Aleksey Kladov
ebc4e75253 switch back to the latest beta 2018-11-24 21:52:49 +03:00
Aleksey Kladov
edeec6a414 Complete paths after :: 2018-11-21 18:34:20 +03:00
Aleksey Kladov
bcdcfa9df2 Some import resolution boilerplate 2018-11-20 19:24:58 +03:00
Adolfo Ochagavía
c96bfe7e2d Split string lexing and run rustfmt 2018-11-11 21:00:31 +01:00
Adolfo Ochagavía
30cd4d5acb Validate byte string literals 2018-11-11 20:41:43 +01:00
Adolfo Ochagavía
c258b4fdb0 Add validator for byte 2018-11-11 20:27:00 +01:00