Commit Graph

810 Commits

Author SHA1 Message Date
Aleksey Kladov
e5eadb3390 Introduce hir::Type
It should provide a convenient API over more low-level Ty
2019-11-26 14:02:57 +03:00
Aleksey Kladov
131c2da6bf ⬆️ salsa 2019-11-26 11:29:20 +03:00
Aleksey Kladov
5fd68b5929 Fix hir for ast::UnionDef 2019-11-25 17:50:49 +03:00
Aleksey Kladov
78791d6fac Use ids for Callable 2019-11-25 16:26:52 +03:00
Aleksey Kladov
5f39c5794e Use GenericDefIdMore 2019-11-25 15:54:03 +03:00
Aleksey Kladov
d06904e90c Switch to variant-granularity field type inference 2019-11-25 00:12:36 +03:00
Aleksey Kladov
63e3ea38d3 Don't redo field resolution in the IDE 2019-11-24 20:06:55 +03:00
Aleksey Kladov
4b74fb1d89 Nicer API for attrs 2019-11-24 16:03:02 +03:00
bors[bot]
cf47ea2877
Merge #2365
2365: Make expand-macro more flexible r=matklad a=edwin0cheng

Due to lack of implementation or other types of errors, some macros do not expand correctly in the current situation. The PR attempts to make `expand-macro` more flexible in error situations by ignoring internal failed macro expansion.

Co-authored-by: Edwin Cheng <edwin0cheng@gmail.com>
2019-11-24 08:39:29 +00:00
Aleksey Kladov
e5bcb69e4f Hide ImportId 2019-11-23 16:39:53 +03:00
Aleksey Kladov
fc1e543f7a Get rid of DefDatabase2 2019-11-23 14:49:45 +03:00
Aleksey Kladov
958862093e Move docs to hir_def 2019-11-23 14:43:38 +03:00
Edwin Cheng
9c521f00ff Improve fail case in expand_macro 2019-11-23 10:33:14 +08:00
Aleksey Kladov
d8caf56dfc Uniformalize naming 2019-11-22 21:52:06 +03:00
Aleksey Kladov
b315f05cf1 Move data to a single file 2019-11-22 17:32:10 +03:00
Aleksey Kladov
78f3b0627c Move FunctionData to hir_def 2019-11-22 17:18:04 +03:00
Aleksey Kladov
2c48fa087b Add support for environment to CrateGraph 2019-11-22 13:57:25 +03:00
bors[bot]
5dd44a0820
Merge #2347
2347: More correct expand macro r=matklad a=edwin0cheng



Co-authored-by: Edwin Cheng <edwin0cheng@gmail.com>
2019-11-22 10:00:44 +00:00
bors[bot]
f24aa7a45a
Merge #2351
2351: Rename Atts trait r=matklad a=matklad



Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2019-11-22 09:27:13 +00:00
Aleksey Kladov
a87e9145a6 Rename Atts trait 2019-11-22 11:36:14 +03:00
Aleksey Kladov
e42f962766 Encapsulate Attrs 2019-11-22 11:27:47 +03:00
Aleksey Kladov
58413b22d7 Don't continue line comments 2019-11-22 10:38:33 +03:00
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
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
6241cf9a59 Add HasResolver trait 2019-11-20 22:22:32 +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
111891dc2d Move constants to new ID
This allows us to get rid of trait item index
2019-11-20 18:41:23 +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
51baaf298d Rename with_ast -> with_value 2019-11-20 13:09:21 +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
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
Edwin Cheng
ae49a22b5c Rebase 2019-11-19 21:49:06 +08:00
Edwin Cheng
3ccd05fedc Add recursive expand in vscode 2019-11-19 21:49:06 +08:00
bors[bot]
c24ee09904
Merge #2309
2309: Goto type def through macros r=matklad a=kjeremy



Co-authored-by: kjeremy <kjeremy@gmail.com>
2019-11-18 20:04:36 +00:00
kjeremy
e939f740b3 Goto type def through macros 2019-11-18 14:57:42 -05:00
kjeremy
90f6f6080e Fix test 2019-11-18 14:20:14 -05:00
kjeremy
b2cc593381 Support hover through macro 2019-11-18 11:58:42 -05:00
kjeremy
a22cb1daa7 Use Source<&ast::Name> in classify_name 2019-11-18 10:47:19 -05:00
Aleksey Kladov
b79d678923 Token-based reverse-mapping 2019-11-18 15:08:39 +03:00
Aleksey Kladov
5e8c22dbf3 More sources 2019-11-18 14:36:11 +03:00