Commit Graph

2446 Commits

Author SHA1 Message Date
Robin Freyler
6aae0cf7fa
replace usages of algo::generate with iter::successors from std 2019-04-13 16:43:49 +02:00
Aleksey Kladov
2facb5e061 cleanups 2019-04-13 14:16:46 +03:00
Aleksey Kladov
b260641e0c slight encapsulation 2019-04-13 11:29:47 +03:00
Aleksey Kladov
f9e825d956 move ScopeEntryWithSyntax 2019-04-13 11:24:09 +03:00
Aleksey Kladov
d387bdccba drop obsolete fixme 2019-04-13 11:21:32 +03:00
Aleksey Kladov
4f8dc1b9f0 make expr scope stuff private 2019-04-13 11:06:53 +03:00
Aleksey Kladov
a2cc76ce63 make resolver private 2019-04-13 11:03:02 +03:00
Aleksey Kladov
62d01dd4df hide resolver 2019-04-13 11:00:15 +03:00
Aleksey Kladov
f4a94e74bc fold ScopeWithSyntax into SourceAnalyzer 2019-04-13 10:49:01 +03:00
Aleksey Kladov
30481808fb make stuff private 2019-04-13 09:53:02 +03:00
Aleksey Kladov
cec67b2b65 obsolete fixm 2019-04-13 09:50:02 +03:00
Aleksey Kladov
1e8569dce9 make private 2019-04-13 09:46:39 +03:00
Aleksey Kladov
d4043a8dba only def-with-body remains 2019-04-13 09:45:52 +03:00
Aleksey Kladov
d88269bc2d generalize 2019-04-13 09:38:37 +03:00
Aleksey Kladov
17a0e22883 simplify 2019-04-13 09:36:28 +03:00
Aleksey Kladov
65b0073653 simplify 2019-04-13 09:33:34 +03:00
Aleksey Kladov
9ead801a9c make private 2019-04-13 09:32:25 +03:00
Aleksey Kladov
3aae223d93 hide some scopes 2019-04-13 09:31:03 +03:00
Aleksey Kladov
58fe5598e7 simplify 2019-04-13 01:32:43 +03:00
Aleksey Kladov
b0d8f9ff5d make stuff private 2019-04-13 01:07:24 +03:00
Aleksey Kladov
81e91980dd simplify 2019-04-13 01:05:18 +03:00
Aleksey Kladov
7c13e22334 simplify tests 2019-04-13 00:56:57 +03:00
Aleksey Kladov
0fd93bc14a use really correct resolver for expressions 2019-04-13 00:44:47 +03:00
Edwin Cheng
f66300ccd1 Remove skip Delimiter::None and handle Dollars 2019-04-13 01:50:05 +08:00
Aleksey Kladov
20013de2ab fix typo 2019-04-11 17:15:20 +03:00
Aleksey Kladov
cf2ba2791d add todo 2019-04-11 17:14:41 +03:00
Aleksey Kladov
a347208bb2 use correct resolver for expressions 2019-04-11 16:51:30 +03:00
Aleksey Kladov
ebb0c377f0 remove resolver from CompletonContext 2019-04-11 16:49:35 +03:00
Aleksey Kladov
3c9f2d0e37 simplify 2019-04-11 16:39:56 +03:00
Aleksey Kladov
5471c1ef4b generalize SourceAnalyzer to handle all defs with bodies 2019-04-11 16:37:29 +03:00
Aleksey Kladov
07cc047b4f minimize the API 2019-04-11 16:29:33 +03:00
Aleksey Kladov
b6809b6695 rename 2019-04-11 16:29:33 +03:00
Aleksey Kladov
6c2ba945ed reduce visibility 2019-04-11 16:29:33 +03:00
Aleksey Kladov
505acc973b Make call info to use real name resolution 2019-04-11 16:29:33 +03:00
Aleksey Kladov
10d66d63d7 introduce SourceAnalyzer 2019-04-11 16:29:33 +03:00
Aleksey Kladov
6a8b3c1d4b fix typo 2019-04-11 11:13:31 +03:00
Edwin Cheng
74e846b9ec Add L_DOLLAR and R_DOLLAR 2019-04-11 11:02:41 +08:00
bors[bot]
6d9acb8753 Merge #1131
1131: Use inline snapshots in complete_dot r=matklad a=vipentti

Relates to #1127 

Co-authored-by: Ville Penttinen <villem.penttinen@gmail.com>
2019-04-10 11:05:31 +00:00
Ville Penttinen
57283b4e5f Use inline snapshots in complete_dot 2019-04-10 13:47:20 +03:00
Ville Penttinen
1b19c1c8f2 Use inline snapshots in complete_fn_param 2019-04-10 13:22:50 +03:00
Aleksey Kladov
10726fdb65 type-safer source-map for bindings 2019-04-10 10:48:15 +03:00
Aleksey Kladov
1cd184d653 use either for uses 2019-04-10 10:12:54 +03:00
bors[bot]
b863272899 Merge #1126
1126: Swithc to native salsa interning r=matklad a=matklad



Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2019-04-09 20:04:42 +00:00
Aleksey Kladov
88189c4282 drop old interning infra 2019-04-09 22:52:06 +03:00
Aleksey Kladov
6b993a9760 migrate to salsas interning 2019-04-09 22:51:22 +03:00
bors[bot]
cc284dad30 Merge #1122
1122: Add explicit type assist. r=matklad a=marcogroppo

This assist can be used to specify the explicit type in let statements. For example `let num = 1;` becomes `let num: i32 = 1;`. 

The assist is applicable only if the inferred type is fully known.


Co-authored-by: Marco Groppo <marco.groppo@gmail.com>
2019-04-09 19:16:28 +00:00
Marco Groppo
c5f8f3b1f4 Stylistic changes. Updated features.md with the new assists. 2019-04-09 21:12:54 +02:00
Ville Penttinen
45a2b92524 Fix doc comment 2019-04-09 16:08:24 +03:00
Ville Penttinen
07f0069f34 Move display related things from hover to display 2019-04-09 14:45:05 +03:00
Ville Penttinen
fead60aa27 Move FunctionSignature to display/function_signature 2019-04-09 14:45:05 +03:00
Ville Penttinen
bd6ddfcdde Make display modules private 2019-04-09 14:45:05 +03:00
Ville Penttinen
7821c56be7 Move structure to display/structure 2019-04-09 14:45:05 +03:00
Ville Penttinen
027d4d229d Move navigation_target to display/navigation_target 2019-04-09 14:45:05 +03:00
Ville Penttinen
946b5789d1 Move completion label functions to display 2019-04-09 14:45:05 +03:00
Ville Penttinen
dfaebd76ab Add FunctionSignature::from_hir 2019-04-09 14:45:05 +03:00
Ville Penttinen
2fe075f56e Normalize line-endings in display.rs
This changes from CRLF to LF
2019-04-09 14:45:05 +03:00
Ville Penttinen
f4aa15c16b Move FunctionSignature creation to display 2019-04-09 14:45:05 +03:00
Ville Penttinen
ed65e2619a Add no parameter test to call_info 2019-04-09 14:45:05 +03:00
Ville Penttinen
7ba22f1c19 Move FunctionSignature to display, remove write_joined
write_joined is replaced with `join_to_string::join` which provides the
necessary functionality.
2019-04-09 14:45:05 +03:00
Ville Penttinen
84fde47d00 Move test specific things 2019-04-09 14:45:04 +03:00
Ville Penttinen
751b454442 Update test snapshots 2019-04-09 14:45:04 +03:00
Ville Penttinen
0e49abb7fb Refactor CallInfo function signatures to new FunctionSignature type
This is used by CallInfo to create a pretty printed function signature that can
be used with completions and other places as well.
2019-04-09 14:45:04 +03:00
Aleksey Kladov
faf526e021 migrate to untyped rowan 2019-04-09 10:26:51 +03:00
Marco Groppo
a4ba3841b4 Add explicit type assist. 2019-04-08 19:56:37 +02: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