Commit Graph

12497 Commits

Author SHA1 Message Date
CAD97
2eaf79cfbb Document missing match arm false positive
This should already be guarded against
(d2212a49f6/crates/hir_ty/src/diagnostics/expr.rs (L225-L230))
but it isn't preventing this false positive for some reason.
2020-08-17 13:19:15 -04:00
bors[bot]
7d95a8447c
Merge #5776 #5780
5776: Fix eslint errors on .eslintrc.js and rollup.config.js r=matklad a=fuafa

Eslint complains if these two files does not include in the `tsconfig.json`.
```
Parsing error: "parserOptions.project" has been set for @typescript-eslint/parser.
The file does not match your project config: .eslintrc.js.
The file must be included in at least one of the projects provided.eslint
```
![image](https://user-images.githubusercontent.com/20750310/90338269-176d4f80-e01b-11ea-8710-3ea817b235d2.png)



5780: Fixup whitespace when adding missing impl items r=matklad a=jDomantas

Generate properly formatted whitespace when adding impl items - with an empty line between items and removing extra whitespace that often appears at the end.

This is my first time working on rust analyzer so I'm not very familiar with its internal APIs. If there's a better way to do such syntax tree editing I'd be glad to hear it.

Co-authored-by: xiaofa <xiaofalzx@gmail.com>
Co-authored-by: jDomantas <djadenkus@gmail.com>
2020-08-17 14:30:24 +00:00
bors[bot]
6826dd044a
Merge #5782
5782: Fix StatusNotification r=matklad a=vsrs

This PR fixes the following:

As per specification `params` property in [NotificationMessage ](https://microsoft.github.io/language-server-protocol/specifications/specification-current/#notificationMessage) should be `array | object` while RA uses `"loading" | "ready" | "invalid" | "needsReload"`.

Co-authored-by: vsrs <vit@conrlab.com>
2020-08-17 14:23:03 +00:00
bors[bot]
64bbdb5bc7
Merge #5785
5785: Don't make fields private unless you have to
 r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2020-08-17 14:13:07 +00:00
Aleksey Kladov
6a4c9fc9fd Don't make fields private unless you have to 2020-08-17 16:11:29 +02:00
bors[bot]
df22547276
Merge #5784
5784: Mention that generated .adocs are generaterd
 r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2020-08-17 13:50:13 +00:00
Aleksey Kladov
b82d967182 Mention that generated .adocs are generaterd 2020-08-17 15:49:46 +02:00
vsrs
1eed036a6e Fix StatusNotification 2020-08-17 14:56:27 +03:00
jDomantas
a565a42f46 format 2020-08-17 11:36:46 +03:00
jDomantas
38e3088a56 update generated tests 2020-08-17 10:47:13 +03:00
bors[bot]
0b2b9a5508
Merge #5766
5766: Hacky support for fn-like proc macros r=matklad a=jonas-schievink

It turns out that this is all that's needed to get something like this working:

```rust
#[proc_macro]
pub fn function_like_macro(_args: TokenStream) -> TokenStream {
    TokenStream::from_str("fn fn_success() {}").unwrap()
}
```

```rust
function_like_macro!();

fn f() {
    fn_success();
}
```

The drawback is that it also makes this work, because there is no distinction between different proc macro kinds in the rest of r-a:

```rust
#[derive(function_like_macro)]
struct S {}

fn f() {
    fn_success();
}
```

Another issue is that it seems to panic, and then panic, when using this on the rustc code base, due to some issue in the inscrutable proc macro bridge code.

Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
2020-08-16 20:03:06 +00:00
bors[bot]
6deb9087bb
Merge #5778
5778: Chalk 0.23 r=kjeremy a=kjeremy



Co-authored-by: Jeremy Kolb <kjeremy@gmail.com>
2020-08-16 16:18:55 +00:00
Jeremy Kolb
409090e74c Chalk 0.23 2020-08-16 12:15:44 -04:00
bors[bot]
76bd27be89
Merge #5777
5777: Bump rustc_lexer r=kjeremy a=kjeremy



Co-authored-by: Jeremy Kolb <kjeremy@gmail.com>
2020-08-16 16:01:52 +00:00
Jeremy Kolb
7819e794db Bump rustc_lexer 2020-08-16 11:57:10 -04:00
bors[bot]
728feea086
Merge #5775
5775: Bump chrono r=kjeremy a=kjeremy



Co-authored-by: Jeremy Kolb <kjeremy@gmail.com>
2020-08-16 15:40:09 +00:00
Jeremy Kolb
9aca8d6647 Update chrono 2020-08-16 11:34:13 -04:00
xiaofa
951fc3f65a Fix eslint errors on .eslintrc.js and rollup.config.js 2020-08-16 23:28:26 +08:00
Yusuke Tanaka
e8e1eb4263
Remove test for handle_document_symbol 2020-08-17 00:19:29 +09:00
Paul Daniel Faria
3456e2eec7 Add new method to Semantics, method_receiver_kind, which returns the kind of self
The options are Shared, Mutable, Consuming, and Copied. Use this to add proper
highlighting to methods based on usage.
2020-08-16 10:26:16 -04:00
Paul Daniel Faria
a044ff0138 Mark mutating functions with mutable modifier, and owning functions with consuming. 2020-08-16 10:22:51 -04:00
Paul Daniel Faria
7009d5ee2b Add new HighlightModifier variant, Consuming 2020-08-16 10:22:51 -04:00
bors[bot]
3b206ff756
Merge #5770
5770: Fix typo in comment r=kjeremy a=rockerBOO



Co-authored-by: Dave Lage <rockerboo@gmail.com>
2020-08-15 20:47:08 +00:00
Dave Lage
d31634940d
Fix typo in comment 2020-08-15 16:37:44 -04:00
bors[bot]
b5023e25e3
Merge #5769
5769: Don't expose hir::Path out of hir
 r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2020-08-15 16:53:15 +00:00
Aleksey Kladov
0ca1ba29e8 Don't expose hir::Path out of hir
Conjecture: it's impossible to use hir::Path *correctly* from an IDE.

I am not entirely sure about this, and we might need to add it back at
some point, but I have to arguments that convince me that we probably
won't:

* `hir::Path` has to know about hygiene, which an IDE can't set up
  properly.

* `hir::Path` lacks identity, but you actually have to know identity
  to resolve it correctly
2020-08-15 18:50:41 +02:00
bors[bot]
19c41a9152
Merge #5768
5768: Remove deprecated Path::from_ast
 r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2020-08-15 16:23:13 +00:00
Aleksey Kladov
2052d33b9b Remove deprecated Path::from_ast
Long term, we probably should make hir::Path private to hir.
2020-08-15 18:22:16 +02:00
Jonas Schievink
bee56e68a3 Hacky support for fn-like proc macros 2020-08-15 15:34:56 +02:00
bors[bot]
f0ad68b962
Merge #5762
5762: Add a proc_macro_test crate r=jonas-schievink a=jonas-schievink

This exports all 3 kinds of proc macros and is useful for testing.

bors r+

Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
2020-08-14 22:29:04 +00:00
Jonas Schievink
cb816b1ea8 Add a proc_macro_test crate
This exports all 3 kinds of proc macros and is useful for testing
2020-08-15 00:27:32 +02:00
Dmitry
73315c9168 synchronizing changes 2020-08-15 02:37:43 +07:00
Dmitry
178c3e135a Merge remote-tracking branch 'origin/master' 2020-08-15 01:32:05 +07:00
Dmitry
06ff8e6c76 refactor requirements put forward mkladov 2020-08-15 01:25:08 +07:00
bors[bot]
c2594daf29
Merge #5347
5347: Chalk writer integration r=flodiebold a=detrumi

~~This adds a `rust-analyzer dump-chalk` command, similar to analysis-stats, which writes out the whole chalk progam (see [chalk#365](https://github.com/rust-lang/chalk/issues/365) for more info about the .chalk writer)~~

Write out chalk programs in debug output if chalk debugging is active (using `CHALK_DEBUG`).

Example output:
```
[DEBUG ra_hir_ty::traits] solve(UCanonical { canonical: Canonical { value: InEnvironment { environment: Env([]), goal: Implemented(SeparatorTraitRef(?)) }, binders: [] }, universes: 1 }) => None
[INFO  ra_hir_ty::traits] trait_solve_query(Implements(fn min<?0.0>(?0.0, ?0.0) -> ?0.0: Deref))
[DEBUG ra_hir_ty::traits] solve goal: UCanonical { canonical: Canonical { value: InEnvironment { environment: Env([]), goal: Implemented(SeparatorTraitRef(?)) }, binders: [U0 with kind type] }, universes: 1 }
[DEBUG ra_hir_ty::traits::chalk] impls_for_trait Deref
[DEBUG ra_hir_ty::traits::chalk] impls_for_trait returned 0 impls
[DEBUG ra_hir_ty::traits::chalk] trait_datum Ord
[DEBUG ra_hir_ty::traits::chalk] trait Ord = Name(Text("Ord"))
[DEBUG ra_hir_ty::traits] chalk program:
    #[upstream]
    #[non_enumerable]
    #[object_safe]
    trait Ord {}
    #[upstream]
    #[non_enumerable]
    #[object_safe]
    #[lang(sized)]
    trait Sized {}
    fn fn_0<_1_0>(arg_0: _1_0, arg_1: _1_0) -> _1_0
    where
      _1_0: Ord;
    #[upstream]
    #[non_enumerable]
    #[object_safe]
    trait Deref {
      type Assoc_1829: Sized;
    }
    
[DEBUG ra_hir_ty::traits] solve(UCanonical { canonical: Canonical { value: InEnvironment { environment: Env([]), goal: Implemented(SeparatorTraitRef(?)) }, binders: [U0 with kind type] }, universes: 1 }) => None
[INFO  ra_hir_ty::traits] trait_solve_query(Implements(?0.0: Ord))
```

Co-authored-by: Wilco Kusee <wilcokusee@gmail.com>
2020-08-14 17:02:55 +00:00
Dmitry
e7899625e6 restrict visibility only by crate 2020-08-14 23:22:23 +07:00
Dmitry
7f11cc42de Merge branch 'master' of https://github.com/Fihtangolz/rust-analyzer into master 2020-08-14 23:16:15 +07:00
Dmitry Opokin
782238d2a9
Update xtask/src/codegen/gen_unstable_future_descriptor.rs
Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2020-08-14 23:11:50 +07:00
Dmitry
c8a6ecc075 Revert "replase sparse-checkout by github api"
This reverts commit 034db28c54.
2020-08-14 23:09:47 +07:00
bors[bot]
f7abd16a8c
Merge #5760
5760: Document xtask has few deps invariant
 r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2020-08-14 15:30:53 +00:00
Aleksey Kladov
1d11c9c91a Document xtask has few deps invariant 2020-08-14 17:30:27 +02:00
Dmitry
034db28c54 replase sparse-checkout by github api 2020-08-14 21:58:04 +07:00
bors[bot]
3b5947e1cd
Merge #5759
5759: Rename hypothetical -> speculative
 r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2020-08-14 13:23:58 +00:00
Aleksey Kladov
125744c057 Rename hypothetical -> speculative 2020-08-14 15:23:27 +02:00
jDomantas
9f548a0295 fixup whitespace when adding missing impl items 2020-08-14 16:10:52 +03:00
Wilco Kusee
de282ddd86 Only print chalk programs with CHALK_PRINT 2020-08-14 14:52:07 +02:00
David Lattimore
a4a504e132 SSR: Explicitly autoderef and ref placeholders as needed
Structured search replace now inserts *, & and &mut in the replacement to match any auto[de]ref in the matched code.
2020-08-14 21:26:25 +10:00
bors[bot]
1ec23e7d33
Merge #5757
5757: Document the most important CI invariant
 r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2020-08-14 10:27:38 +00:00
Aleksey Kladov
200161c734 Document the most important CI invariant 2020-08-14 12:27:15 +02:00
David Lattimore
c84f98385a Refactor SSR so that placeholders store a Var
This allows lookup of placeholder bindings given a placeholder without
needing to create a Var instance.
2020-08-14 20:12:26 +10:00