Commit Graph

7985 Commits

Author SHA1 Message Date
bors[bot]
baf832d6d9
Merge #3262
3262: Fix handling of const patterns r=matklad a=flodiebold

E.g. in `match x { None => ... }`, `None` is a path pattern (resolving to the
option variant), not a binding. To determine this, we need to try to resolve the
name during lowering. This isn't too hard since we already need to resolve names
for macro expansion anyway (though maybe a bit hacky).

Fixes #1618.

Co-authored-by: Florian Diebold <florian.diebold@freiheit.com>
2020-02-22 00:27:09 +00:00
bors[bot]
d8b0943535
Merge #3244
3244: Rename module references r=matklad a=adamrk

Rename references to a module when the module is renamed. This fixes some missing renames in the existing implementation. For example, renaming the module `foo` to `foo2` in this case:
```rust
mod foo {
    pub fn bar() {}
}

fn main() {
    foo::bar()
}
```
previously would not change the call `foo::bar()` to `foo2::bar()`, but now it will. 

Co-authored-by: adamrk <ark.email@gmail.com>
Co-authored-by: Adam Bratschi-Kaye <ark.email@gmail.com>
2020-02-22 00:19:28 +00:00
adamrk
fe8ce4c41d remove unneeded collect 2020-02-21 23:51:30 +01:00
Adam Bratschi-Kaye
7be1044104 use Vec::extend instead of Vec::push in loop
Co-Authored-By: Laurențiu Nicola <lnicola@users.noreply.github.com>
2020-02-21 23:51:30 +01:00
adamrk
8b3f449b5f rename module references 2020-02-21 23:51:30 +01:00
bors[bot]
f3ab290bd4
Merge #3264
3264: Tidy up documentation. r=flodiebold a=ablakey

Thought I'd tidy up the docs while reading through them. Hope you don't mind!

For the most part, I just made the formatting consistent through-out and added a few words here and there. Also updated the language server install graphic.

Co-authored-by: Andrew Blakey <ablakey@locusrobotics.com>
2020-02-21 20:26:25 +00:00
Andrew Blakey
cda6d2b25c update image 2020-02-21 14:55:15 -05:00
Andrew Blakey
1be166f0fb update docs 2020-02-21 14:53:30 -05:00
Florian Diebold
f1f45f9191 Fix handling of const patterns
E.g. in `match x { None => ... }`, `None` is a path pattern (resolving to the
option variant), not a binding. To determine this, we need to try to resolve the
name during lowering. This isn't too hard since we already need to resolve names
for macro expansion anyway (though maybe a bit hacky).

Fixes #1618.
2020-02-21 17:01:19 +01:00
Florian Diebold
31af774254 Refactor how builtins are resolved
This fixes autocompletion suggesting e.g. self::usize.
2020-02-21 15:39:51 +01:00
bors[bot]
e3037c2631
Merge #3259
3259: Normalize associated types in types coming from Chalk r=matklad a=flodiebold

Fixes #3232.

Co-authored-by: Florian Diebold <florian.diebold@freiheit.com>
2020-02-21 13:22:06 +00:00
Florian Diebold
e50201345e Normalize associated types in types coming from Chalk
Fixes #3232.
2020-02-21 14:06:19 +01:00
bors[bot]
db1bbb11fb
Merge #3247
3247: Improve RA version display r=matklad a=edwin0cheng

There are 2 problems of current implementation for displaying current version of RA binary:

1. If that binary is coming from built by source, the `REV` may not be updated somehow. (See discussion in [Zuilp](https://rust-lang.zulipchat.com/#narrow/stream/185405-t-compiler.2Fwg-rls-2.2E0/topic/vscode.20version.20in.20console))

2. We must go through the VSCode debugger console to see the output of `console.log`.

This PR implemented a new VSCode command "Show RA Version" to display the version, which  fixed the first problem.  And added some `rerun-if` flags in `build.rs` to fix the second one.

Co-authored-by: Edwin Cheng <edwin0cheng@gmail.com>
2020-02-21 10:34:58 +00:00
Edwin Cheng
319a09847b Use stdout directly 2020-02-21 18:33:45 +08:00
Edwin Cheng
489be40d3a Use ensureServerBinary instead 2020-02-21 18:33:45 +08:00
Edwin Cheng
e7a0d8f8d0 Add trailing newline 2020-02-21 18:33:45 +08:00
Edwin Cheng
d70ddec746 Remove unused placeholder 2020-02-21 18:33:45 +08:00
Edwin Cheng
b21ead6ede Add document for Show RA Version 2020-02-21 18:33:45 +08:00
Edwin Cheng
4e48a73f9c Improve server version info 2020-02-21 18:33:45 +08:00
bors[bot]
88014fcec0
Merge #3258
3258: enforce camel case r=matklad a=matklad



bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2020-02-21 10:23:10 +00:00
Aleksey Kladov
28bf731751 enforce camel case 2020-02-21 11:22:45 +01:00
bors[bot]
04dacb9943
Merge #3252
3252: Improve integration with token color configuration r=matklad a=eaglgenes101

First, the extension now checks theme token color customizations as well as global token color customizations when determining what colors to highlight syntax with. Theme token color customizations take precedence over both global token color customizations and the theme token colors. 

Second, a few additional token color customization keys used by other themes are added. The original paths still take precedence, but now turning on rust analyzer syntax highlighting should now not unexpectedly homogenize token colors when custom themes are used. 

Co-authored-by: eaglgenes101 <eaglgenes101@gmail.com>
2020-02-20 17:50:39 +00:00
eaglgenes101
bf99a6eb08 Merge branch 'master' of https://github.com/rust-analyzer/rust-analyzer 2020-02-20 12:46:50 -05:00
bors[bot]
f761ed2abb
Merge #3251
3251: Better errorse r=matklad a=matklad



bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2020-02-20 17:41:41 +00:00
Aleksey Kladov
7f4b205b72 Better errorse 2020-02-20 18:41:12 +01:00
eaglgenes101
358b9d685f Improved compatibility with themes 2020-02-20 12:40:12 -05:00
bors[bot]
a8beff9cf6
Merge #3248
3248: Fix off by one in onEnter r=matklad a=lnicola



Co-authored-by: Laurențiu Nicola <lnicola@dend.ro>
2020-02-20 12:40:34 +00:00
Laurențiu Nicola
5cd311d64e Fix off by one in onEnter 2020-02-20 11:24:47 +02:00
Aleksey Kladov
4e288c64ff
Merge pull request #3242 from matklad/deny-c
Deny c
2020-02-19 23:01:56 +01:00
Aleksey Kladov
5e1d0e4ae4 Check that we use no C deps on CI
C deps are not a problem for a typical build, but cause issues in more
esoteric scenarios, like cross-compiling. Let's check that we don't
have them.

Setting `CC` to some dummy value should do the trick, as custom build
scripts typically respect this variable.
2020-02-19 22:24:29 +01:00
bors[bot]
e00b9ca3c9
Merge #3215
3215: Exclude methods from non-parameter types introduced by generic constraints r=flodiebold a=lnicola

Fixes #3184.

r? @flodiebold

Co-authored-by: Laurențiu Nicola <lnicola@dend.ro>
2020-02-19 19:46:37 +00:00
bors[bot]
889851b52e
Merge #3241
3241: Fill missing fields of enum variants r=matklad a=matklad



bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2020-02-19 17:17:52 +00:00
Aleksey Kladov
9549aad525 Fill missing fields of enum variants 2020-02-19 18:17:09 +01:00
Aleksey Kladov
7db7c86881
Merge pull request #3239 from matklad/opt-backtrace
Make backtrace optional
2020-02-19 17:13:27 +01:00
Aleksey Kladov
2ff23c172e Make backtrace optional 2020-02-19 16:28:25 +01:00
bors[bot]
f6c871571c
Merge #3238
3238: Bump lsp-types r=kjeremy a=kjeremy

bors r+

Co-authored-by: kjeremy <kjeremy@gmail.com>
2020-02-19 14:14:42 +00:00
kjeremy
044180847a Bump lsp-types 2020-02-19 09:14:05 -05:00
bors[bot]
27587f3501
Merge #3236
3236: Merge NameDefinition and NameKind r=matklad a=matklad



bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2020-02-19 13:57:03 +00:00
Aleksey Kladov
372439dec8 Merge NameDefinition and NameKind 2020-02-19 14:56:22 +01:00
bors[bot]
ff41558296
Merge #3235
3235: Derive visibility as well r=matklad a=matklad



bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2020-02-19 13:46:48 +00:00
Aleksey Kladov
0d5ae89948 Derive visibility as well 2020-02-19 14:45:49 +01:00
bors[bot]
b560de4117
Merge #3234
3234: Don't store deriveable Module info in NameDefinition r=matklad a=matklad



bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2020-02-19 13:33:30 +00:00
Aleksey Kladov
86b66067f6 Don't store deriveable Module info in NameDefinition 2020-02-19 14:32:22 +01:00
bors[bot]
61fdcc5ded
Merge #3233
3233: Extend selection handles commas in tuple pats r=matklad a=matklad



bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2020-02-19 13:00:04 +00:00
Aleksey Kladov
bcb5f1b65c Extend selection handles commas in tuple pats 2020-02-19 13:59:19 +01:00
bors[bot]
624a9978e2
Merge #3231
3231: Add `remove_mut` assist r=matklad a=matklad



bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2020-02-19 11:49:52 +00:00
Aleksey Kladov
312a779610 Add remove_mut assist 2020-02-19 12:44:54 +01:00
bors[bot]
eb804261dc
Merge #3228
3228: Use proper range for hover on macro arguments r=matklad a=edwin0cheng

This PR use `original_range` to remap the range of found syntax node in `hover` and thus it should return the proper text range now.

fixed #3000 
fixed #3135 


Co-authored-by: Edwin Cheng <edwin0cheng@gmail.com>
2020-02-19 10:46:00 +00:00
bors[bot]
d07f043ef1
Merge #3229
3229: Fix a crash with non-ascii whitespace in doc-comments r=matklad a=sinkuu

2nd commit is a random drive-by cleanup.

Co-authored-by: Shotaro Yamada <sinkuu@sinkuu.xyz>
2020-02-19 10:38:27 +00:00
Laurențiu Nicola
5b05209744 Exclude methods from non-parameter types introduced by generic constraints 2020-02-19 10:46:13 +02:00