Commit Graph

2335 Commits

Author SHA1 Message Date
Edwin Cheng
6646d49f23 Fix bug and add expr , pat , ty matcher 2019-04-14 11:42:20 +08:00
Edwin Cheng
f66300ccd1 Remove skip Delimiter::None and handle Dollars 2019-04-13 01:50:05 +08:00
Edwin Cheng
74e846b9ec Add L_DOLLAR and R_DOLLAR 2019-04-11 11:02:41 +08:00
bors[bot]
ac6ab07587 Merge #1105
1105: [WIP] Implement ra_mbe meta variables support  r=matklad a=edwin0cheng

This PR implements the following meta variable support in `ra_mba` crate (issue  #720):

- [x] `path`
- [ ] `expr`
- [ ] `ty`
- [ ]  `pat`
- [ ] `stmt`
- [ ]  `block`
- [ ]  `meta`
- [ ] `item`

*Implementation Details*

In the macro expanding lhs phase, if we see a meta variable type, we try to create a `tt:TokenTree` from the remaining input. And then we use a special set of `ra_parser` to parse it to `SyntaxNode`. 


Co-authored-by: Edwin Cheng <edwin0cheng@gmail.com>
2019-04-08 14:18:57 +00:00
Laurențiu Nicola
61c09edb4a Avoid two-phase borrow conflict 2019-04-08 16:47:28 +03:00
Edwin Cheng
8ed7104578 Refactoring and add some docs 2019-04-08 20:32:21 +08:00
Edwin Cheng
c785c7312d Fixed infintite loop bug 2019-04-08 19:21:07 +08:00
Edwin Cheng
184e9ea230 Fixed empty node bug 2019-04-08 18:21:48 +08:00
Edwin Cheng
2697ecaa64 Use SubtreeWalker instread of flatten TtToken 2019-04-08 15:58:02 +08:00
Edwin Cheng
a7254201df Combine all tokensource to one and refactoring 2019-04-08 00:12:07 +08:00
Edwin Cheng
7f1e93a3c9 Refactoring subtree_source 2019-04-07 21:42:53 +08:00
Lenard Pratt
b27fa33a9f updated snapshots 2019-04-07 13:23:18 +01:00
Lenard Pratt
e175921932 Added ArrayExprKind,
changed the  display for fixed array types,
Added Array Enum to ra_hir/expr
2019-04-07 13:23:14 +01:00
Lenard Pratt
2d73c909fe Added inference of array length 2019-04-07 13:23:12 +01:00
bors[bot]
36f5d99756 Merge #1119
1119: Add warning when open file outside workspace r=matklad a=edwin0cheng

When file is not found in `ra_vfs` but exist, use `LspError` for warning instead of `error_fmt` to bail out error, 

Temporarily fix #967 .

edit: typo

Co-authored-by: Edwin Cheng <edwin0cheng@gmail.com>
2019-04-07 10:48:49 +00:00
Edwin Cheng
ce3d78335d Remove checking file exists 2019-04-07 18:26:02 +08:00
Edwin Cheng
e92740c28b fix formatting 2019-04-07 12:46:45 +08:00
Edwin Cheng
333feb3869 Add warning when open file outside workspace 2019-04-07 01:20:33 +08:00
Edwin Cheng
aac9dfa464 Add TtCursorTokenSource and TtCursorTokenSink 2019-04-06 20:14:28 +08:00
Edwin Cheng
1d7735fbc6 Add path test and empty eat_path handling 2019-04-06 12:12:32 +08:00
robojumper
2caa690ef6 Rudimentarily autocomplete tuple struct field access 2019-04-06 01:10:48 +02:00
robojumper
ca40ca93a5 Parse and infer tuple indices 2019-04-06 01:07:35 +02:00
Edwin Cheng
7abc06bd57 Add proper test for literals and fixed typo bug 2019-04-05 20:58:24 +08:00
Edwin Cheng
1ea0238e53 Add classify_literal and undo expose next_token 2019-04-05 18:45:19 +08:00
Edwin Cheng
1ab78d6056 Fix literal support in token tree to ast item list 2019-04-05 18:23:01 +08:00
Edwin Cheng
6ff16c7ad9 Clean up 2019-04-05 03:54:18 +08:00
Edwin Cheng
c23408751c Add multi-byte token support in tkn tree to ast 2019-04-05 03:39:54 +08:00
pcpthm
0010d62cad Make robust about target directory 2019-04-04 18:57:10 +09:00
bors[bot]
c083515eec Merge #1106
1106: ⬆️ salsa r=matklad a=matklad



Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2019-04-04 07:03:18 +00:00
Aleksey Kladov
afd64756dd ⬆️ salsa 2019-04-04 10:02:53 +03:00
bors[bot]
84d8665e13 Merge #1101
1101: Parse unsafe async / const unsafe fns properly r=matklad a=robojumper

Also adds tests that `unsafe async fn` as well as `const unsafe fn` parse properly and that these keywords in the reversed order cause parse errors.

[Playground link to verify that this is the correct order.](https://play.rust-lang.org/?version=nightly&mode=debug&edition=2018&gist=7850b8d92579de31c38f835f76afa4ce)

Closes #1086.


Co-authored-by: robojumper <robojumper@gmail.com>
2019-04-03 15:33:58 +00:00
bors[bot]
f1ac9c8f55 Merge #1098
1098: added some docs to public functions r=matklad a=pasa

some docs for #961

Co-authored-by: Sergey Parilin <sergey.parilin@fxdd.com>
2019-04-03 15:13:51 +00:00
robojumper
636270f4a4 Parse unsafe async / const unsafe fns properly 2019-04-03 17:11:56 +02:00
Sergey Parilin
cc2212f3cb added some docs to public functions 2019-04-03 16:05:55 +03:00
bors[bot]
c6c88070c4 Merge #1068
1068: profiling crate first draft r=matklad a=pasa

I've made this first draft for #961 
Could you look at it? Is this something what you are looking for?
It has lack of tests. I can't figure out how to test stderr output in rust right now. Do you have some clues?
Additionally I'm thinking about to implement procedural  macros to annotate methods with this profiler. Will it be helpful?



Co-authored-by: Sergey Parilin <sergey.parilin@fxdd.com>
2019-04-03 09:09:11 +00:00
bors[bot]
fdbebccd71 Merge #1076
1076: Const body inference r=flodiebold a=Lapz

This is the second part of #887. I've added type inference on const bodies and introduced the DefWithBody containing Function, Const and Static. I want to add tests but im unsure on how I would go about testing that completions work.


Co-authored-by: Lenard Pratt <l3np27@gmail.com>
2019-04-02 19:01:54 +00:00
Lenard Pratt
b9d2c2c21f made ExprCollector pub(crate) and moved
collect_fn_body_syntax
2019-04-02 19:22:06 +01:00
Lenard Pratt
88e22e9d70 Added const bodies and static body to the ast
and added inference the inference test

reduce code duplication
2019-04-02 19:21:36 +01:00
bors[bot]
5cdf525caa Merge #1093
1093: simplify r=matklad a=matklad



Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2019-04-02 16:15:46 +00:00
Aleksey Kladov
cf1caf5181 simplify 2019-04-02 19:15:13 +03:00
Aleksey Kladov
0de89f786f always produce source for import 2019-04-02 17:58:04 +03:00
Sergey Parilin
b74449e995 Merge remote-tracking branch 'upstream/master' into issue961_profiling 2019-04-02 17:55:14 +03:00
Sergey Parilin
9b73f80959 PR issuse resolved 2019-04-02 17:52:04 +03:00
bors[bot]
0a758a2c48 Merge #1090
1090: always show token text r=matklad a=matklad



Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2019-04-02 13:36:52 +00:00
Aleksey Kladov
7d6bd5d137 always show token text 2019-04-02 14:49:46 +03:00
Aleksey Kladov
e7a4b96d03 fix inner block doc comments 2019-04-02 14:42:47 +03:00
Aleksey Kladov
49f13d3a9b fix a panic with glob-import missing a source map 2019-04-02 13:26:09 +03:00
Aleksey Kladov
ab19ff16e5 add minimal comments 2019-04-02 13:02:23 +03:00
Aleksey Kladov
0e1e40676a rename flavor to kind 2019-04-02 12:53:44 +03:00
Aleksey Kladov
cb5001c0a5 move extensions to submodules 2019-04-02 12:47:39 +03:00