Commit graph

66 commits

Author SHA1 Message Date
Jeremy A. Kolb
7a0bc2dd64 Add docs to struct fields 2019-01-25 14:29:56 -05:00
bors[bot]
675943712c Merge #630
630: Fill in DocumentSymbol::detail r=matklad a=hban

Closes: #516

I just pulled type text from the syntax node and "formatted" is bit. VS Code can't really handle multi-line symbol detail (it's will crop it when rendering), so that formatting will just collapse all white-space to singe space. It isn't pretty, but maybe there's a better way.

Issue also mentions "need to be done for `NavigationTarget` to `SymbolInformation`", but `SymbolInformation` doesn't have detail field on it?

Co-authored-by: Hrvoje Ban <hban@users.noreply.github.com>
2019-01-25 07:13:16 +00:00
bors[bot]
1d4b421aad Merge #633
633: use ToOwned trait instead of inherent method r=matklad a=matklad



Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2019-01-24 23:10:09 +00:00
Aleksey Kladov
2e354f480b use ToOwned trait instead of inherent method 2019-01-25 02:09:31 +03:00
Aleksey Kladov
0f2f3a21e7 Migrate trait & type to new ids 2019-01-25 01:31:32 +03:00
Hrvoje Ban
4eff8ddb8b Fill in DocumentSymbol::detail 2019-01-24 19:05:26 +01:00
Jeremy A. Kolb
6a6ce2bc95 Make EnumVariant a DocCommentsOwner 2019-01-23 16:23:21 -05:00
Florian Diebold
5862542ded Add AST/HIR for type args in path segments 2019-01-19 16:02:06 +01:00
Marcus Klaas de Vries
fa43ef30f4 Change parsing of struct field patterns 2019-01-19 15:37:26 +03:00
Marcus Klaas de Vries
f9a6050034 Move parsing of field pattern lists to the parser (where it belongs) 2019-01-19 15:37:26 +03:00
Marcus Klaas de Vries
d48d5b8b6c Add initial (flawed) implementation of binding annotations 2019-01-19 15:37:26 +03:00
Marcus Klaas de Vries
ab5deb7811 Create struct patterns up to the hir level 2019-01-19 15:37:25 +03:00
Marcus Klaas de Vries
afaa26636e Add additional pattern variants 2019-01-19 15:37:25 +03:00
Hirokazu Hata
4729a1b054 Update ARRAY_EXPR grammar 2019-01-16 23:22:14 +09:00
Marcus Klaas de Vries
d67eabb512 Fix type inference for raw (byte) strings 2019-01-14 20:56:14 +01:00
Marcus Klaas de Vries
a9a6a50c75 Fixup tests 2019-01-14 19:30:21 +01:00
Marcus Klaas de Vries
606d66a714 Start moving literal interpretation to the AST (WIP) 2019-01-14 13:56:43 +01:00
Hirokazu Hata
6efda8f6ce Update TUPLE_EXPR grammar 2019-01-13 21:04:03 +09:00
Aleksey Kladov
8e554ea5fa support ref-patterns 2019-01-13 13:36:06 +03:00
Aleksey Kladov
2d3940d0ab rename TreePtr -> TreeArc
This is much clearer about the semantics
2019-01-11 19:59:06 +03:00
Aleksey Kladov
fa6e0b0d38 itroduce trait for ast tokens 2019-01-08 12:23:10 +03:00
Aleksey Kladov
5618c8ade1 regenerate 2019-01-08 11:20:15 +03:00
Florian Diebold
8e3e5ab2c8 Make FnScopes use hir::Expr
This was a bit complicated. I've added a wrapper type for now that does the
LocalSyntaxPtr <-> ExprId translation; we might want to get rid of that or give
it a nicer interface.
2019-01-06 00:29:36 +01:00
Florian Diebold
136aba1cf3 Add HIR Expr machinery 2019-01-05 22:41:12 +01:00
Florian Diebold
111126ed3c Type the self parameter 2019-01-04 19:10:50 +01:00
Florian Diebold
ae9530addc Add HIR for impl blocks
Since we need to be able to go from def to containing impl block, as well as the
other direction, and to find all impls for a certain type, a design similar to
the one for modules, where we collect all impls for the whole crate and keep
them in an arena, seemed fitting. The ImplBlock type, which provides the public
interface, then consists only of an Arc to the arena containing all impls, and
the index into it.
2019-01-04 19:10:47 +01:00
Florian Diebold
fe6c4115f6 Rename ImplItem to ImplBlock
rustc uses the name ImplItem for items in impls, not the impl {} block itself,
which could lead to confusion.
2019-01-04 18:28:36 +01:00
Aleksey Kladov
0a80d9685a visibility owner 2019-01-03 15:21:31 +03:00
Aleksey Kladov
406505e096 super simplistic macro expansion 2018-12-28 16:59:58 +03:00
Aleksey Kladov
072028e679 add macro-call node 2018-12-28 13:27:30 +03: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
Florian Diebold
2870effd5c Implement reference / pointer types
- parse them
 - infer types of & and * expressions
2018-12-25 20:36:06 +01:00
Florian Diebold
ab0b63992b Implement basic completion for fields 2018-12-25 15:27:15 +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
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
Adolfo Ochagavía
3b4c02c19e Validate string literals 2018-11-09 14:52:17 +01:00
Aleksey Kladov
2ed1514df3 rename ROOT -> SOURCE_FILE 2018-11-07 18:42:36 +03:00
Jeremy A. Kolb
6df71da81f Add some more DocCommentsOwner 2018-11-07 18:24:55 +03:00
Aleksey Kladov
8eaf7952ae ra_syntax::File is just RootNode 2018-11-06 23:26:26 +03:00
Aleksey Kladov
7f88fe8790 Add a pinch of comments 2018-11-06 22:06:58 +03:00
Aleksey Kladov
a5301e94d5 Generalize Owned nodes 2018-11-06 21:52:00 +03:00
Adolfo Ochagavía
9b5bbab104 Add character literal parsing and validation 2018-11-04 15:17:24 +01:00
Aleksey Kladov
d685a9b564 Use From to get an owned AST 2018-11-01 13:41:20 +03:00