Commit Graph

6356 Commits

Author SHA1 Message Date
Jeremy Kolb
fcccf8ec59 Support LSP 3.15
This merely upgrades our protocol support. It does not add any of the new features.
2019-12-11 09:11:55 -05:00
Tetsuharu OHZEKI
b186c612c4 Use ES2018 for vscode extension
Today's latest vscode v1.40 (Node.jsv12.4/V8 v7.6) supports ES2018
features natively.

We don't have to transform codes to ES6.
2019-12-11 22:40:26 +09:00
bors[bot]
5202b0ecba
Merge #2523
2523: Fixed #2250 r=matklad a=gab-umich

Bugfix Debriefing:

1. Tuple in type annotation expands correctly;
2. Expansion will prefer the following delimiter when possible. This involves modification of previous test cases to match current behaviour. 
3. New regression tests added to verify the consistency between tuple expansion in type annotation and tuple expansion in rvalue. Both should behave exactly the same. 

Co-authored-by: Gabriel Luo <luogm@umich.edu>
2019-12-11 12:39:33 +00:00
Gabriel Luo
20ccabc01d Fixed #2250
Tuple in type annotation expands correctly;
Expansion will prefer the following delimiter when possible. 
New regression tests added to verify the consistency between tuple expansion in type annotation and tuple expansion in rvalue.
2019-12-10 22:18:05 -05:00
bors[bot]
ee904594af
Merge #2519
2519: Build correct SourceAnalyzer for traits r=matklad a=matklad



Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2019-12-10 12:53:35 +00:00
Aleksey Kladov
d89996fd5b Build correct SourceAnalyzer for traits 2019-12-10 13:52:04 +01:00
bors[bot]
baae1b3d00
Merge #2516
2516: chore: bump deps and use mainline chalk r=matklad a=lnicola



Co-authored-by: Laurențiu Nicola <lnicola@dend.ro>
2019-12-09 20:40:05 +00:00
Laurențiu Nicola
16df4d8fcb chore: bump deps and use mainline chalk 2019-12-09 22:35:47 +02:00
bors[bot]
e292573f42
Merge #2514
2514: Code: enable prettier trailing commas r=matklad a=lnicola

See #2512.

Co-authored-by: Laurențiu Nicola <lnicola@dend.ro>
2019-12-09 19:31:27 +00:00
Laurențiu Nicola
273299693b Code: enable prettier trailing commas 2019-12-09 21:07:19 +02:00
bors[bot]
897b550049
Merge #2513
2513: Report correct original range in goto_definition r=matklad a=matklad



Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2019-12-09 18:47:00 +00:00
Aleksey Kladov
b683cbd93d Report correct original range in goto_definition 2019-12-09 19:46:35 +01:00
Aleksey Kladov
7ac4ea7fec Allow disabling sysroot
Might be helpful for debugging
2019-12-09 19:46:35 +01:00
bors[bot]
442ab3a34d
Merge #2511
2511: Implement `ra_lsp_server --version` r=matklad a=matklad



Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2019-12-09 15:12:23 +00:00
Aleksey Kladov
5a012fb9fd Implement ra_lsp_server --version 2019-12-09 16:11:46 +01:00
bors[bot]
7819aa8862
Merge #2510
2510: Add sourcemap for rollup and fix launch.json outfiles r=matklad a=edwin0cheng

Fix #2509

Co-authored-by: Edwin Cheng <edwin0cheng@gmail.com>
2019-12-09 14:27:42 +00:00
Edwin Cheng
81ce9833a5 Add rollup sourcemap and fix launch.json 2019-12-09 03:58:43 +08:00
bors[bot]
e3a9e806ba
Merge #2508
2508: Code: don't check for ra_lsp_server on Windows r=matklad a=lnicola

Workaround for https://github.com/rust-analyzer/rust-analyzer/pull/2503#issuecomment-562980020.

~~(not yet tested on Windows)~~

We can't run `ra_lsp_server --version` right now because the server doesn't seem to handle arguments (so it hangs).

Co-authored-by: Laurențiu Nicola <lnicola@dend.ro>
2019-12-08 19:32:24 +00:00
Laurențiu Nicola
ee2bc73d2a Code: don't check for ra_lsp_server on Windows 2019-12-08 21:14:18 +02:00
bors[bot]
a38a3bf229
Merge #2507
2507: Code: bump deps r=matklad a=lnicola



Co-authored-by: Laurențiu Nicola <lnicola@dend.ro>
2019-12-08 18:59:16 +00:00
Laurențiu Nicola
c7dc067104 Code: bump deps 2019-12-08 20:39:22 +02:00
bors[bot]
6b1c2ee168
Merge #2500 #2505 #2506
2500: Fix format_args expansion & go to definition r=matklad a=flodiebold

The expansion of format_args wasn't yet correct enough to type-check. Also make macros in statement position expand to expressions for now, since it's not handled correctly in HIR lowering yet. This finally fixes go to definition within print macros, I think 🙂 

2505: Remove more dead code r=matklad a=matklad



2506: Remove one more Ty r=matklad a=matklad



Co-authored-by: Florian Diebold <flodiebold@gmail.com>
Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2019-12-08 16:53:21 +00:00
Aleksey Kladov
61c3887b70 Remove one more Ty 2019-12-08 17:50:43 +01:00
Aleksey Kladov
a1639d0d1e Remove more dead code 2019-12-08 17:45:14 +01:00
Aleksey Kladov
6805bb01e2 Cleanup module structure 2019-12-08 17:45:14 +01:00
bors[bot]
d0ad30ad97
Merge #2501 #2502 #2503
2501: Fix coercion from &Foo to an inference variable in a reference r=matklad a=flodiebold

We didn't try to unify within the reference, but we should.

2502: Delay legacy macro expansion r=matklad a=edwin0cheng

This PR make the following changes:

* Delay legacy macro expansion such that we concentrated all item collecting macro expansion in one place.
* Add `MacroDirective` to replace 3-tuples 
* After this refactoring, no macro is expanded recursively, hence we can remove the `MacroStackMonitor` and we handle the expansion limit by the fix-point loop count. 

2503: Code: check whether the LSP binary is in PATH r=matklad a=lnicola

I'm not really sure about the TS changes. I just made a couple of functions async and it seems to work.

Co-authored-by: Florian Diebold <flodiebold@gmail.com>
Co-authored-by: Edwin Cheng <edwin0cheng@gmail.com>
Co-authored-by: Laurențiu Nicola <lnicola@dend.ro>
2019-12-08 16:44:29 +00:00
bors[bot]
d27b033883
Merge #2504
2504: Use rustup toolchain install instead of rustup install r=matklad a=edwin0cheng

`rustup install` and `rustup uninstall` are going to be deprecated in rustup 1.21.0

See https://github.com/rust-lang/rustup/issues/2148

and https://www.reddit.com/r/rust/comments/e7rer9/we_need_your_help_before_rustup_1210_can_be/



Co-authored-by: Edwin Cheng <edwin0cheng@gmail.com>
2019-12-08 16:36:11 +00:00
Edwin Cheng
74c7c7a8b1 Use rustup toolchain instead of rustup install 2019-12-08 23:13:56 +08:00
Laurențiu Nicola
78e8934976 Code: check whether the LSP binary is in PATH 2019-12-08 15:04:37 +02:00
Edwin Cheng
3a95d01d0c Delay legacy macro expansion 2019-12-08 20:33:42 +08:00
Florian Diebold
d0c9bb0abf Fix coercion from &Foo to an inference variable in a reference
We didn't try to unify within the reference, but we should.
2019-12-08 13:06:59 +01:00
Florian Diebold
5e096def15 Expand macros in blocks to expressions for now
Expanding to statements isn't handled properly yet and breaks things.
2019-12-08 13:03:13 +01:00
Florian Diebold
2223620313 Fix range in goto_through_format test 2019-12-08 13:02:52 +01:00
Florian Diebold
91f28e43a2 Fix expansion of format_args 2019-12-08 13:02:52 +01:00
bors[bot]
596e6db46c
Merge #2499
2499: Remove ty from code_model r=matklad a=matklad



Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2019-12-08 11:52:43 +00:00
Aleksey Kladov
e2cc552076 Remove dead code 2019-12-08 12:51:25 +01:00
Aleksey Kladov
b37c6a746b Remove ty from code_model 2019-12-08 12:44:14 +01:00
Aleksey Kladov
b77d7c24aa Remove bodies from code_model 2019-12-08 12:27:21 +01:00
Aleksey Kladov
b017bae837 remove infer method from CodeModel 2019-12-08 12:26:53 +01:00
bors[bot]
7a6b6ed0a5
Merge #2498
2498: Drop some unused methods r=matklad a=matklad



Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2019-12-08 11:24:44 +00:00
Aleksey Kladov
7aacf9a197 Drop some unused methods 2019-12-08 12:24:21 +01:00
Aleksey Kladov
200bda3daf Cleanup Field ty 2019-12-08 12:16:57 +01:00
Aleksey Kladov
08d3166c8b Cleanup Crate API 2019-12-08 12:02:53 +01:00
bors[bot]
b236f6aa49
Merge #2466
2466: Handle partial resolve cases r=matklad a=edwin0cheng

Another try to fix #2443 :

We resolve all imports every time in `DefCollector::collect` loop even it is resolved previously.  
This is because other unresolved imports and macros will bring in another `PerNs`, so we can only assume that it has been partially resolved.

Co-authored-by: Edwin Cheng <edwin0cheng@gmail.com>
2019-12-08 10:44:30 +00:00
bors[bot]
ffcdd25cc8
Merge #2497
2497: Remove MacroFileKind r=matklad a=edwin0cheng

This PR move `to_macro_file_kind` to `hir_expand::db` and use it to get the `FragmentKind` directly, such that we can remove `MacroFileKind`.

Co-authored-by: Edwin Cheng <edwin0cheng@gmail.com>
2019-12-08 10:35:30 +00:00
Edwin Cheng
509fedd9d2 Remove MacroFileKind 2019-12-08 16:16:52 +08:00
bors[bot]
9e551d5452
Merge #2495
2495: Discover type parameters in more cases r=matklad a=matklad



Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2019-12-07 20:55:29 +00:00
Aleksey Kladov
6e2e60cbc9 Discover type parameters in more cases 2019-12-07 21:55:02 +01:00
bors[bot]
971df306ad
Merge #2494
2494: Get the right analyzer for impls r=matklad a=matklad



Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2019-12-07 19:26:33 +00:00
Aleksey Kladov
88c5b1282a Rename GenericParam -> TypeParam
We don't have LifetimeParam yet, but they are planned!
2019-12-07 20:25:48 +01:00