Commit graph

3998 commits

Author SHA1 Message Date
Edwin Cheng
a92ad59a02 More correct expand macro 2019-11-22 12:04:20 +08:00
Edwin Cheng
144dc6652c Fix insert_whitespaces 2019-11-22 02:38:14 +08:00
Edwin Cheng
67a58e4af1 Add test for match_ast 2019-11-22 02:38:14 +08:00
Edwin Cheng
59e7234546 Add to_macro_file_kind 2019-11-22 02:38:14 +08:00
Edwin Cheng
4ff400833f Add MacroFileKind::Statements 2019-11-22 02:38:14 +08:00
bors[bot]
3f1a0c3c5f
Merge #2341
2341: Fix mbe fail to parse TokenTree with endings whitespace r=matklad a=edwin0cheng



Co-authored-by: Edwin Cheng <edwin0cheng@gmail.com>
2019-11-21 17:56:12 +00:00
Edwin Cheng
bf537eefb5 Fixed mbe trival subtree 2019-11-22 01:02:07 +08:00
Aleksey Kladov
a1346bba5c Fix test mark placement 2019-11-21 17:09:38 +03:00
Aleksey Kladov
952405cb41 reformat 2019-11-21 16:31:48 +03:00
Aleksey Kladov
4daf931111 Remove old hir::generics module 2019-11-21 16:23:02 +03:00
Aleksey Kladov
4f8f3393bc Reduce visibility 2019-11-21 16:00:57 +03:00
Aleksey Kladov
36758f2767 Resimplify 2019-11-21 15:56:27 +03:00
Aleksey Kladov
c37d1c5b38 Restore a mark 2019-11-21 15:49:24 +03:00
Aleksey Kladov
6d64798a23 Move resolver to hir_def 2019-11-21 15:39:09 +03:00
Aleksey Kladov
00684d708b Decouple 2019-11-21 15:24:51 +03:00
Aleksey Kladov
eb53aa37a3 Split internal and user-visible ScopeDef 2019-11-21 15:13:46 +03:00
Aleksey Kladov
ca1af86e7b Use GenericParam in ScopeDef 2019-11-21 14:22:30 +03:00
Aleksey Kladov
1312c57d34 Move ScopeDef 2019-11-21 14:21:26 +03:00
Aleksey Kladov
061e6c77b5 Decouple 2019-11-21 14:13:49 +03:00
Aleksey Kladov
621cf06156 Decouple 2019-11-21 13:48:05 +03:00
Aleksey Kladov
24964ca58e Move expr resolver to resolve 2019-11-21 13:28:04 +03:00
Aleksey Kladov
0102fb4133 Decouple Resolver 2019-11-21 13:25:03 +03:00
bors[bot]
2cb2fb1a48
Merge #2332
2332: Add HasResolver trait r=matklad a=matklad

bors merge

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2019-11-20 19:23:31 +00:00
Aleksey Kladov
1cead41510 Simplify 2019-11-20 22:22:32 +03:00
Aleksey Kladov
6241cf9a59 Add HasResolver trait 2019-11-20 22:22:32 +03:00
bors[bot]
6983afdea9
Merge #2330
2330: Remove hir/adt.rs r=matklad a=matklad



Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2019-11-20 18:38:00 +00:00
Aleksey Kladov
7c275a7ed2 Remove hir/adt.rs 2019-11-20 21:34:12 +03:00
Felix Kohlgrüber
bcb2ea912b fix 2190; add test for "replace if let with match" 2019-11-20 19:01:06 +01:00
Aleksey Kladov
12ec946216 Simplify generic params 2019-11-20 20:50:34 +03:00
Aleksey Kladov
cb642fc578 Move generic_params query to HIR 2019-11-20 20:38:37 +03:00
Aleksey Kladov
111891dc2d Move constants to new ID
This allows us to get rid of trait item index
2019-11-20 18:41:23 +03:00
Aleksey Kladov
ee95a35664 Don't duplicate ContainerId type 2019-11-20 17:50:02 +03:00
Aleksey Kladov
64c21ed195 Switch type aliases to new sources 2019-11-20 17:43:03 +03:00
bors[bot]
b7a36b5443
Merge #2326
2326: Remove duplicate tests r=matklad a=matklad



Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2019-11-20 13:43:34 +00:00
Aleksey Kladov
3888487ca8 Remove duplicate tests 2019-11-20 16:40:25 +03:00
Edwin Cheng
0a9c80053f Fix expand macro 2019-11-20 21:33:01 +08:00
Aleksey Kladov
cebeedc66f Next gen IDs for functions
The current system with AstIds has two primaraly drawbacks:

* It is possible to manufacture IDs out of thin air.
  For example, it's possible to create IDs for items which are not
  considered in CrateDefMap due to cfg. Or it is possible to mixup
  structs and unions, because they share ID space.

* Getting the ID of a parent requires a secondary index.

Instead, the plan is to pursue the more traditional approach, where
each items stores the id of the parent declaration. This makes
`FromSource` more awkward, but also more correct: now, to get from an
AST to HIR, we first do this recursively for the parent item, and the
just search the children of the parent for the matching def
2019-11-20 16:22:58 +03:00
Aleksey Kladov
06fa3d8389 Move traits to hir_def 2019-11-20 14:22:38 +03:00
Aleksey Kladov
51baaf298d Rename with_ast -> with_value 2019-11-20 13:09:21 +03:00
Aleksey Kladov
e1a6e38767 Move Generics to hir_def 2019-11-20 12:34:48 +03:00
Aleksey Kladov
0e771915fa Allow non-path default type parameters 2019-11-20 11:46:44 +03:00
Aleksey Kladov
36e3fc9d54 Rename Source::ast -> Source::value 2019-11-20 09:42:30 +03:00
Aleksey Kladov
eec68e6f45
Merge pull request #2297 from kiljacken/master
Add fancy truncation of type hints.
2019-11-20 08:38:25 +03:00
Aleksey Kladov
83a8430e0a ⬆️ rowan 2019-11-19 21:13:36 +03:00
Edwin Cheng
e290171397 Add shot doc for expand_macro module 2019-11-20 01:12:56 +08:00
Emil Lauridsen
bf5ac4fe39 Add test for inlay hint truncation 2019-11-19 17:40:38 +01:00
Emil Lauridsen
dadad36bb9 Move type inlay hint truncation to language server
This commit implements a general truncation framework for HirFormatter
that keeps track of how much has been output so far. This information
can then be used to perform truncation inside the language server,
instead of relying on the client.

Initial support is implemented for truncating types hints using the
maxInlayHintLength server config option. The existing solution in the
VSCode extension has been removed in favor of letting the server
truncate type hints.
2019-11-19 17:23:50 +01:00
Edwin Cheng
80fe467ce8 Improve insert_whitespaces 2019-11-20 00:12:48 +08:00
Edwin Cheng
4012da07fd Change return type of expand_macro 2019-11-19 22:56:48 +08:00
Edwin Cheng
94c63d2802 Change to use Expansion::file_id and reordering 2019-11-19 22:56:28 +08:00