Commit graph

1669 commits

Author SHA1 Message Date
Aleksey Kladov
8c2c1bf9eb check edits in diagnostics 2018-12-27 13:35:08 +03:00
bors[bot]
1d6dcef5c5 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 <flodiebold@gmail.com>
2018-12-27 10:08:34 +00:00
bors[bot]
700165cf17 Merge #336
336: add cancelation module & cancelation backtraces r=matklad a=matklad

This is primaraly to debug semengly spurious canceled requests

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2018-12-27 10:04:36 +00:00
Aleksey Kladov
93996fecdc add cancelation module & cancelation backtraces 2018-12-27 13:03:32 +03:00
Aleksey Kladov
62c40b0e91 fix the test 2018-12-27 12:54:59 +03:00
Aleksey Kladov
4e2dffd798 expose make_pub_crate action 2018-12-27 12:35:40 +03:00
bors[bot]
11ae1a669c Merge #334
334: use a:🅱️:{self} should be fixed as use a::b instead of use a:🅱️:self r=matklad a=gfreezy



Co-authored-by: gfreezy <gfreezy@gmail.com>
2018-12-27 09:10:17 +00:00
gfreezy
cd60998b9b fix use std::{self} 2018-12-27 00:51:27 +08:00
bors[bot]
6bd92e66f1 Merge #333
333: Fix unnecessary braces r=matklad a=gfreezy

![image](https://user-images.githubusercontent.com/510012/50425015-c8086780-08a9-11e9-995f-d107d6880fa3.png)

don't know why the underscore line is not covering the whole braces.


fix #324 

Co-authored-by: gfreezy <gfreezy@gmail.com>
2018-12-26 16:10:39 +00:00
Florian Diebold
bc745a1396 Resolve field types lazily
I.e. not already when getting the HIR for the struct.
2018-12-25 21:40:33 +01:00
Bernardo
1cda43aafd test code and dependency cleanup 2018-12-25 21:26:36 +01:00
Florian Diebold
cdca397061 Add a hir::TypeRef as an intermediate between ast::TypeRef and ty::Ty 2018-12-25 21:14:13 +01:00
Bernardo
e9c186e48a change to TextEdit to avoid allocation and sort
rename newline to step where applicable
2018-12-25 20:49:18 +01:00
Florian Diebold
2870effd5c Implement reference / pointer types
- parse them
 - infer types of & and * expressions
2018-12-25 20:36:06 +01:00
Bernardo
863ed19946 remove benchmark and simplify tests 2018-12-25 20:14:27 +01:00
Bernardo
6b2da4e547 use new translate_offset_with_edit for TryConvWith
doc comments
2018-12-25 20:06:49 +01:00
Bernardo
aff0124b37 add line_index proptest 2018-12-25 20:03:14 +01:00
Bernardo
c886b72dab make criterion args work, small simplification 2018-12-25 20:03:14 +01:00
Bernardo
dc2afae991 fix arbitrary offset generation, col translation working 2018-12-25 20:03:14 +01:00
Bernardo
5c8525ce4a column translation implemented but not quite working yet 2018-12-25 20:03:14 +01:00
Bernardo
36f2b1f3b9 iterate over Steps which are either, newlines or multibyte chars 2018-12-25 20:03:14 +01:00
Bernardo
1c44ba0f04 simplify newline check with macro 2018-12-25 20:03:14 +01:00
Bernardo
d6312085a1 remove slower impl, add benchmarks 2018-12-25 20:03:14 +01:00
Bernardo
a005d2a614 final iteration, faster a bit simpler
the main thing is we iterate over inserted newlines at once for each edit
2018-12-25 19:59:02 +01:00
Bernardo
7299df8409 simplified version 2018-12-25 19:59:02 +01:00
Bernardo
8c9df62c1c move translate_offset_with_edit to ra_editor 2018-12-25 19:59:02 +01:00
Bernardo
881c29192d initial newline translation working
todo:
cleanup, simplify
handle columns
2018-12-25 19:55:05 +01:00
Bernardo
d951979159 test translate_offset_with_edit against simple impl for single edits 2018-12-25 19:49:55 +01:00
Bernardo
dee426e1b1 simplify and reduce number of values explored 2018-12-25 19:45:21 +01:00
Bernardo
3d98744c2a proptest strategies for TextUnit and AtomTextEdit 2018-12-25 19:45:21 +01:00
gfreezy
16996e9947 fix tests 2018-12-26 01:00:27 +08:00
Florian Diebold
b96d361239 Handle structs/enums with missing names a bit better 2018-12-25 17:55:50 +01:00
gfreezy
72eb9de747 add fix for removing unnecessary braces in use statements 2018-12-26 00:45:13 +08:00
Florian Diebold
3e4d41d1e4 Determine receiver for completion in a more robust way
Also rename a parameter.
2018-12-25 17:43:58 +01:00
Florian Diebold
3befd1a9e8 Cleanup 2018-12-25 15:44:10 +01:00
Florian Diebold
e5a8089b08 Add . to trigger characters 2018-12-25 15:27:15 +01:00
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
07a7285965 Collect field data for structs/enum variants 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
4ff1618520 Do name resolution by namespace (types/values) 2018-12-25 15:16:42 +01:00
Florian Diebold
b5b68f2094 Add basic HIR and types for structs/enums 2018-12-25 15:16:42 +01:00
bors[bot]
5fb426cb9e Merge #331
331: Cancelled is not Copy r=matklad a=matklad

I'd love to have a backtrace in `Cancelled` to be able to debug "completion is always cancelled" problem. So it probably is a good idea to make `Cancelled` non Copy type, even if it is a ZST in prod.

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2018-12-25 10:40:42 +00:00
Aleksey Kladov
8d49c098a5 cancelled is not Copy 2018-12-25 13:36:39 +03:00
bors[bot]
64046253a3 Merge #328
328: fix warning conversion r=matklad a=matklad



Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2018-12-24 23:18:10 +00:00
Aleksey Kladov
21293d0533 fix warning conversion 2018-12-25 02:07:30 +03:00
bors[bot]
b65ba8f1d6 Merge #326
326: resolved #324: remove unnecessary braces in use statement. r=matklad a=gfreezy

Add inspection for unnecessary braces in use statement

Co-authored-by: gfreezy <gfreezy@gmail.com>
2018-12-24 18:39:31 +00:00
gfreezy
0fb8894fbe fix tests 2018-12-24 23:01:16 +08:00