Commit graph

9438 commits

Author SHA1 Message Date
bors[bot]
7ab28cacbb
Merge #4076
4076: Improve remove derive attrs r=matklad a=edwin0cheng

This PR implemented a proper `remove_derive_attrs` function which **merely** remove  any `#[derive(*)]` attributes.

Co-authored-by: Edwin Cheng <edwin0cheng@gmail.com>
2020-04-21 18:50:53 +00:00
Edwin Cheng
4a303366c8 Improve remove dervie attrs 2020-04-22 01:44:21 +08:00
Benjamin Coenen
da6b136ea5 Improve autocompletion by looking on the type and name
Signed-off-by: Benjamin Coenen <5719034+bnjjj@users.noreply.github.com>
2020-04-21 17:19:18 +02:00
bors[bot]
4a250021b1
Merge #4038
4038: Group generated ast boilerplate apart from the interesting part r=matklad a=Veetaha

Boilerplate `AstNode` and `From` impls are moved to the end further from the interesting part in `generated.rs`

Co-authored-by: veetaha <veetaha2@gmail.com>
2020-04-21 12:58:27 +00:00
Benjamin Coenen
b6a7be19d9 Improve autocompletion by looking on the type and name
Signed-off-by: Benjamin Coenen <5719034+bnjjj@users.noreply.github.com>
2020-04-21 14:36:56 +02:00
Benjamin Coenen
7f143b154e Merge branch 'master' of github.com:rust-analyzer/rust-analyzer 2020-04-21 14:32:02 +02:00
Benjamin Coenen
1c3a1385a5 Improve autocompletion by looking on the type and name
Signed-off-by: Benjamin Coenen <5719034+bnjjj@users.noreply.github.com>
2020-04-21 14:31:57 +02:00
bors[bot]
a88887df07
Merge #4071
4071: Cleanup args a bit r=matklad a=matklad



bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2020-04-21 10:10:22 +00:00
Aleksey Kladov
d9bed8aa45 Cleanup args a bit 2020-04-21 12:06:25 +02:00
bors[bot]
192ad01ebd
Merge #4070
4070: docs(readme): improve user docs r=matklad a=fannheyward

cleanup unavailable configurations/commands

Co-authored-by: Heyward Fann <fannheyward@gmail.com>
2020-04-21 10:02:41 +00:00
Heyward Fann
0f49fd818b docs(readme): improve user docs
cleanup unavailable configurations/commands
2020-04-21 17:54:13 +08:00
bors[bot]
4c6c4f3fd5
Merge #4069
4069: More detailed Sublime Text install instructions r=lnicola a=nnmm

* People might typically jump directly to their editor and wonder where the part about installing rust-analyzer is – at least I did. I added a link to the relevant section for ST.
* Make ST instructions more detailed and user friendly (especially beginners), include troubleshooting tips.
* Minor grammar improvements throughout.

Co-authored-by: Nikolai Morin <nnmmgit@gmail.com>
2020-04-21 09:18:55 +00:00
Nikolai Morin
427f634de3
Move the PATH issue up to the non-editor specific section 2020-04-21 11:17:12 +02:00
Nikolai Morin
c0e9a1a476
Delete comma 2020-04-21 10:16:30 +02:00
Nikolai Morin
d22349de0a
Update docs/user/readme.adoc
Co-Authored-By: Laurențiu Nicola <lnicola@users.noreply.github.com>
2020-04-21 10:15:49 +02:00
Nikolai Morin
22fd891d45
Update docs/user/readme.adoc
Co-Authored-By: Laurențiu Nicola <lnicola@users.noreply.github.com>
2020-04-21 10:13:33 +02:00
Nikolai Morin
f964bbd735
More detailed Sublime Text install instructions
* People might typically jump directly to their editor and wonder where the part about installing rust-analyzer is – at least I did. I added a link to the relevant section for ST.
* Make ST instructions more detailed and user friendly (especially beginners), include troubleshooting tips.
* Minor grammar improvements throughout.
2020-04-21 09:20:14 +02:00
bors[bot]
ec645f2d75
Merge #4066
4066: Fix restart missing arguments in proc-macro-srv r=edwin0cheng a=edwin0cheng

cc @Veetaha 

Co-authored-by: Edwin Cheng <edwin0cheng@gmail.com>
2020-04-20 21:26:25 +00:00
Edwin Cheng
ce382e6a79 Refactor a bit 2020-04-21 05:22:17 +08:00
Edwin Cheng
bd350108b0 Fix restart missing arguments in proc-macro-srv 2020-04-21 04:57:55 +08:00
bors[bot]
0ad6b6d407
Merge #4061
4061: ra_proc_macro: cleanups here and there r=edwin0cheng a=Veetaha

r? @edwin0cheng 

Co-authored-by: veetaha <veetaha2@gmail.com>
Co-authored-by: Veetaha <veetaha2@gmail.com>
2020-04-20 20:25:33 +00:00
veetaha
fc460b1e42 Migrate to Result<T, io::Error> -> io::Result<T> 2020-04-20 22:42:36 +03:00
veetaha
d8ca817456 Fix doc comment 2020-04-20 22:24:10 +03:00
Veetaha
834960d841
Fix typo
Co-Authored-By: Laurențiu Nicola <lnicola@users.noreply.github.com>
2020-04-20 22:07:47 +03:00
Veetaha
0f5b1fef5e Display path not debug it
Co-Authored-By: Laurențiu Nicola <lnicola@users.noreply.github.com>
2020-04-20 22:06:41 +03:00
Veetaha
982af2286a
Display path not debug it
Co-Authored-By: Laurențiu Nicola <lnicola@users.noreply.github.com>
2020-04-20 21:50:06 +03:00
veetaha
d3019164dc ra_proc_macro: cleanups here and there 2020-04-20 21:37:02 +03:00
bors[bot]
cd6d788c15
Merge #4060
4060: Update Chalk, and cache Chalk env elaboration through a query r=matklad a=flodiebold

This should fix some of the worst performance problems.

Co-authored-by: Florian Diebold <flodiebold@gmail.com>
2020-04-20 17:33:17 +00:00
Florian Diebold
0be68a4825 Update Chalk, and cache Chalk env elaboration through a query
This should fix some of the worst performance problems.
2020-04-20 19:16:01 +02:00
bors[bot]
2e0b7b0159
Merge #4057
4057: Fix panic in split_imports assist r=matklad a=matklad

The fix is admittedly quit literally just papering over.

Long-term, I see two more principled approaches:

* we switch to a fully tree-based impl, without parse . to_string
  step; with this approach, there shouldn't be any panics. The results
  might be nonsensical, but so was the original input.

* we preserve the invariant that re-parsing constructed node is an
  identity, and make all the `make_xxx` method return an `Option`.

closes #4044



bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2020-04-20 14:38:16 +00:00
Aleksey Kladov
8a04372fec Fix panic in split_imports assist
The fix is admittedly quit literally just papering over.

Long-term, I see two more principled approaches:

* we switch to a fully tree-based impl, without parse . to_string
  step; with this approach, there shouldn't be any panics. The results
  might be nonsensical, but so was the original input.

* we preserve the invariant that re-parsing constructed node is an
  identity, and make all the `make_xxx` method return an `Option`.

closes #4044
2020-04-20 16:34:01 +02:00
Leander Tentrup
ac798e1f7c Implement syntax highlighting for format strings
Detailed changes:
1) Implement a lexer for string literals that divides the string in format specifier `{}` including the format specifier modifier.
2) Adapt syntax highlighting to add ranges for the detected sequences.
3) Add a test case for the format string syntax highlighting.
2020-04-20 11:19:15 +02:00
bors[bot]
90f837829d
Merge #4047
4047: Some clippy fixes r=matklad a=kjeremy

Mostly removes redundant `clone` and `into`

Co-authored-by: Jeremy Kolb <kjeremy@gmail.com>
2020-04-19 19:19:41 +00:00
Jeremy Kolb
d7f3d858ad Some clippy fixes 2020-04-19 15:15:49 -04:00
bors[bot]
24af351018
Merge #4045
4045: Update regex r=kjeremy a=kjeremy

Changelog says it reduces unnecessary recompilation of transitive dependencies in some cases.

https://github.com/rust-lang/regex/pull/665

Co-authored-by: Jeremy Kolb <kjeremy@gmail.com>
2020-04-19 17:19:07 +00:00
Jeremy Kolb
5c760a96b6 Update regex 2020-04-19 13:17:14 -04:00
veetaha
972d3b2ba3 Group generated ast boilerplate apart from the interesting part 2020-04-18 23:51:13 +03:00
bors[bot]
36840bd6c7
Merge #4036
4036: Fix a bunch of unresovled references r=matklad a=matklad



bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2020-04-18 20:18:57 +00:00
Aleksey Kladov
b79fd82559 Correctly infer types in guard expressions
The root cause was that we forgot to add bindings from the arm to the
guard expression

closes #3980
2020-04-18 22:16:04 +02:00
Aleksey Kladov
fa2ea8f494 Fix goto definition for record patterns 2020-04-18 22:11:49 +02:00
bors[bot]
7a59cd49ff
Merge #4035
4035: Convert bool to ident instead of literal in mbe r=matklad a=edwin0cheng

Fixed #1249

Currently we treat boolean literal as `tt::Literal` , which makes parsing $lit:lit matcher easily.
However, proc-macro2 treat boolean literal as `ident` :

4173a21dc4/src/lib.rs (L939)

OT: I am quite happy we finally need to fix this bug :)

Co-authored-by: Edwin Cheng <edwin0cheng@gmail.com>
2020-04-18 19:36:37 +00:00
bors[bot]
b95b77f92f
Merge #4034
4034: Add semantic tag for unresolved references r=matklad a=matklad

This is a quick way to implement unresolved reference diagnostics.
For example, adding to VS Code config

    "editor.tokenColorCustomizationsExperimental": {
        "unresolvedReference": "#FF0000"
    },

will highlight all unresolved refs in red.

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2020-04-18 19:29:17 +00:00
Aleksey Kladov
ca61356b01 Add semantic tag for unresolved references
This is a quick way to implement unresolved reference diagnostics.
For example, adding to VS Code config

    "editor.tokenColorCustomizationsExperimental": {
        "unresolvedReference": "#FF0000"
    },

will highlight all unresolved refs in red.
2020-04-18 21:28:51 +02:00
Edwin Cheng
a1b5cf81eb Convert bool to ident instead of literal in mbe 2020-04-19 03:24:17 +08:00
bors[bot]
b949500126
Merge #4032
4032: Add mbe lifetime split test r=matklad a=edwin0cheng



Co-authored-by: Edwin Cheng <edwin0cheng@gmail.com>
2020-04-18 18:57:14 +00:00
bors[bot]
9b16ae5149
Merge #4033
4033: Refactor codegen r=matklad a=Veetaha



Co-authored-by: veetaha <veetaha2@gmail.com>
2020-04-18 18:49:38 +00:00
veetaha
21b98d585e Refucktor codegen 2020-04-18 21:46:24 +03:00
Edwin Cheng
ce674be217 Add mbe lifetime split test 2020-04-19 02:45:17 +08:00
bors[bot]
6f60e646fc
Merge #3894
3894: Match check enum record r=flodiebold a=JoshMcguigan

This PR implements match statement exhaustiveness checking for record type enums.

It also make a minor addition to the test infrastructure to allow testing against a single diagnostic, so you can be sure your test is triggering (or not) whichever diagnostic you expect.

Co-authored-by: Josh Mcguigan <joshmcg88@gmail.com>
2020-04-18 18:42:07 +00:00
bors[bot]
98819d8919
Merge #4029
4029: Fix various proc-macro bugs r=matklad a=edwin0cheng

This PRs does the following things:

1. Fixed #4001 by splitting `LIFETIME` lexer token to two mbe tokens. It is because rustc token stream expects `LIFETIME` as a combination of punct and ident, but RA `tt:TokenTree` treats it as a single `Ident` previously.
2. Fixed #4003, by skipping `proc-macro` for completion. It is because currently we don't have `AstNode` for `proc-macro`. We would need to redesign how to implement `HasSource` for `proc-macro`.
3.  Fixed a bug how empty `TokenStream` merging in `proc-macro-srv` such that no L_DOLLAR and R_DOLLAR will be emitted accidentally. 


Co-authored-by: Edwin Cheng <edwin0cheng@gmail.com>
2020-04-18 17:56:54 +00:00