]> git.lizzy.rs Git - rust.git/log
rust.git
3 years agoLatest LSP 3.16 protocol
kjeremy [Mon, 16 Nov 2020 20:10:13 +0000 (15:10 -0500)]
Latest LSP 3.16 protocol

Pulls in https://github.com/gluon-lang/lsp-types/pull/186

3 years agoMerge #6565
bors[bot] [Mon, 16 Nov 2020 16:28:43 +0000 (16:28 +0000)]
Merge #6565

6565: Prepare to recompute completions on every keystroke r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
3 years agoPrepare to recompute completions on every keystroke
Aleksey Kladov [Mon, 16 Nov 2020 16:27:36 +0000 (17:27 +0100)]
Prepare to recompute completions on every keystroke

If we set `is_incomplete: true`, VS Code will re-query completions
after every keypress.

3 years agoMerge #6563
bors[bot] [Mon, 16 Nov 2020 11:49:48 +0000 (11:49 +0000)]
Merge #6563

6563: Don't complete keywords in struct initializers r=matklad a=Veykril

Fixes #6562

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
3 years agoDon't complete keywords in struct literals
Lukas Wirth [Mon, 16 Nov 2020 11:18:01 +0000 (12:18 +0100)]
Don't complete keywords in struct literals

3 years agoMerge #6558
bors[bot] [Mon, 16 Nov 2020 11:07:29 +0000 (11:07 +0000)]
Merge #6558

6558: format string highlighting: handle hex + debug type specifier r=matklad a=ruabmbua

Should fix https://github.com/rust-analyzer/rust-analyzer/issues/6427

Co-authored-by: Roland Ruckerbauer <roland.rucky@gmail.com>
3 years agoMerge #6552
bors[bot] [Sun, 15 Nov 2020 18:51:23 +0000 (18:51 +0000)]
Merge #6552

6552: Properly handle shorthands in destructure patterns when renaming r=SomeoneToIgnore a=Veykril

Fixes #6548 and #6551.

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
3 years agoformat string highlighting: handle hex + debug type specifier
Roland Ruckerbauer [Sun, 15 Nov 2020 16:43:14 +0000 (17:43 +0100)]
format string highlighting: handle hex + debug type specifier

3 years agoCleanup edit_text_range_for_record_field_expr_or_pat
Lukas Wirth [Sun, 15 Nov 2020 15:11:06 +0000 (16:11 +0100)]
Cleanup edit_text_range_for_record_field_expr_or_pat

3 years agoUse shorthand field syntax in destructures
Lukas Wirth [Sat, 14 Nov 2020 18:57:47 +0000 (19:57 +0100)]
Use shorthand field syntax in destructures

3 years agoProperly handle shorthands in destructure patterns when renaming
Lukas Wirth [Sat, 14 Nov 2020 18:11:09 +0000 (19:11 +0100)]
Properly handle shorthands in destructure patterns when renaming

3 years agoUse shorthand record syntax when renaming struct initializer field
Lukas Wirth [Sat, 14 Nov 2020 16:49:36 +0000 (17:49 +0100)]
Use shorthand record syntax when renaming struct initializer field

3 years agoMerge #6544
bors[bot] [Fri, 13 Nov 2020 23:30:13 +0000 (23:30 +0000)]
Merge #6544

6544: add suggestion ..Default::default() for remaining struct fields in a constructor r=bnjjj a=bnjjj

I'm not sure I should import `assists` crate inside `completions`, maybe we should move out `FamousDefs` from `assists` ? Let me know :)

close #6492

Signed-off-by: Benjamin Coenen <5719034+bnjjj@users.noreply.github.com>
Co-authored-by: Benjamin Coenen <5719034+bnjjj@users.noreply.github.com>
3 years agoadd suggestion ..Default::default() for remaining struct fields in a constructor...
Benjamin Coenen [Fri, 13 Nov 2020 22:20:26 +0000 (23:20 +0100)]
add suggestion ..Default::default() for remaining struct fields in a constructor #6492

Signed-off-by: Benjamin Coenen <5719034+bnjjj@users.noreply.github.com>
3 years agoMerge #6545
bors[bot] [Fri, 13 Nov 2020 16:54:31 +0000 (16:54 +0000)]
Merge #6545

6545: Simplify project model r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
3 years agoRemove dead code
Aleksey Kladov [Fri, 13 Nov 2020 16:53:48 +0000 (17:53 +0100)]
Remove dead code

3 years agoCleanup workspace loading a tiny bit
Aleksey Kladov [Fri, 13 Nov 2020 16:38:26 +0000 (17:38 +0100)]
Cleanup workspace loading a tiny bit

3 years agoadd suggestion ..Default::default() for remaining struct fields in a constructor...
Benjamin Coenen [Fri, 13 Nov 2020 16:17:16 +0000 (17:17 +0100)]
add suggestion ..Default::default() for remaining struct fields in a constructor #6492

Signed-off-by: Benjamin Coenen <5719034+bnjjj@users.noreply.github.com>
3 years agoMove tricky workspace logic to a separate module
Aleksey Kladov [Fri, 13 Nov 2020 15:44:48 +0000 (16:44 +0100)]
Move tricky workspace logic to a separate module

3 years agoMerge #6543
bors[bot] [Fri, 13 Nov 2020 15:33:24 +0000 (15:33 +0000)]
Merge #6543

6543: cleanup r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
3 years agocleanup
Aleksey Kladov [Fri, 13 Nov 2020 15:32:57 +0000 (16:32 +0100)]
cleanup

3 years agoMerge #6519
bors[bot] [Fri, 13 Nov 2020 15:25:26 +0000 (15:25 +0000)]
Merge #6519

6519: Add "Open Cargo.toml" action r=matklad a=p3achyjr

## What is it?

This adds an "open cargo.toml" action from the vscode shell, resolves #6462

## Test

Ran ```cargo xtask install --server``` and ```cargo xtask install --client```, then ```Developer: Reload Window```.

![image](https://user-images.githubusercontent.com/8763808/98614382-2a578f00-22ad-11eb-9811-4a72a54ff6fb.png)

When clicked:

![image](https://user-images.githubusercontent.com/8763808/98618176-77d7fa00-22b5-11eb-8788-35256542f3a6.png)

Co-authored-by: Anatol Liu <axlui@anatols-mbp.lan>
3 years agoMerge #6542
bors[bot] [Fri, 13 Nov 2020 15:18:55 +0000 (15:18 +0000)]
Merge #6542

6542: Revert "Upgrade version of npms lockfile" r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
3 years agoRevert "Upgrade version of npms lockfile"
Aleksey Kladov [Fri, 13 Nov 2020 15:17:52 +0000 (16:17 +0100)]
Revert "Upgrade version of npms lockfile"

This reverts commit 3d559afc11b230d52b13c5540706b85a7eeb3490.

VS Code uses nodejs 12 still, so its better to stick to the format it
understands.

3 years agoadd open Cargo.toml action
Anatol Liu [Fri, 13 Nov 2020 01:48:07 +0000 (17:48 -0800)]
add open Cargo.toml action

3 years agoMerge #6538
bors[bot] [Thu, 12 Nov 2020 19:39:51 +0000 (19:39 +0000)]
Merge #6538

6538: Upgrade version of npms lockfile r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
3 years agoUpgrade version of npms lockfile
Aleksey Kladov [Thu, 12 Nov 2020 19:39:16 +0000 (20:39 +0100)]
Upgrade version of npms lockfile

3 years agoMerge #6524
bors[bot] [Thu, 12 Nov 2020 17:55:32 +0000 (17:55 +0000)]
Merge #6524

6524: Add support for loading rustc private crates r=matklad a=xldenis

This PR presents a solution to the problem of making`rustc_private` crates visible to `rust-analyzer`.
Currently developers add dependencies to those crates behind a `cfg(NOT_A_TARGET)` target to prevent `cargo` from building them.
This solution is unsatisfactory since it requires modifying `Cargo.toml` and causes problems for collaboration or CI.

The proposed solution suggested by @matklad is to allow users to give RA a path where the `rustc` sources could be found and then load that like a normal workspace.

This PR implements this solution by adding a `rustcSource` configuration item and adding the cargo metadata to the crate graph if it is provided.

------

I have no idea how this should be tested, or if this code is generally tested at all. I've locally run the extension with these changes and it correctly loads the relevant crates on a `rustc_private` project of mine.

Co-authored-by: Xavier Denis <xldenis@gmail.com>
3 years agoAddress review comments
Xavier Denis [Thu, 12 Nov 2020 17:46:47 +0000 (18:46 +0100)]
Address review comments

3 years agoMerge #6514
bors[bot] [Thu, 12 Nov 2020 17:48:25 +0000 (17:48 +0000)]
Merge #6514

6514: Fix extract_struct_from_enum_variant not updating record references r=Veykril a=Veykril

Related to #6510

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
3 years agoAdd extra test to extract_struct_from_enum_variant
Lukas Wirth [Thu, 12 Nov 2020 16:47:58 +0000 (17:47 +0100)]
Add extra test to extract_struct_from_enum_variant

3 years agoMerge #6513
bors[bot] [Thu, 12 Nov 2020 17:12:21 +0000 (17:12 +0000)]
Merge #6513

6513: Support qualified function calls in remove_unused_param r=Veykril a=Veykril

Also adds a test to check that it removes unused params across files.

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
3 years agoSupport qualified function calls in remove_unused_param
Lukas Wirth [Mon, 9 Nov 2020 18:18:26 +0000 (19:18 +0100)]
Support qualified function calls in remove_unused_param

3 years agoUse Module::find_use_path_prefixed in extract_struct_from_enum_variant assist
Lukas Wirth [Thu, 12 Nov 2020 16:32:45 +0000 (17:32 +0100)]
Use Module::find_use_path_prefixed in extract_struct_from_enum_variant assist

3 years agoFix extract_struct_from_enum_variant not updating record references
Lukas Wirth [Thu, 12 Nov 2020 16:13:33 +0000 (17:13 +0100)]
Fix extract_struct_from_enum_variant not updating record references

3 years agoMerge #6529
bors[bot] [Thu, 12 Nov 2020 12:01:15 +0000 (12:01 +0000)]
Merge #6529

6529: Do not insert imports before inner comments r=Veykril a=SomeoneToIgnore

Co-authored-by: Kirill Bulatov <mail4score@gmail.com>
3 years agoRemove the fixme
Kirill Bulatov [Thu, 12 Nov 2020 11:52:24 +0000 (13:52 +0200)]
Remove the fixme

3 years agoAdd a FIXME for non-unified inner attributes
Kirill Bulatov [Wed, 11 Nov 2020 12:04:31 +0000 (14:04 +0200)]
Add a FIXME for non-unified inner attributes

3 years agoDo not insert imports before inner comments
Kirill Bulatov [Wed, 11 Nov 2020 09:37:41 +0000 (11:37 +0200)]
Do not insert imports before inner comments

3 years agoMerge #6534
bors[bot] [Thu, 12 Nov 2020 11:09:44 +0000 (11:09 +0000)]
Merge #6534

6534: Fix attachment of inner doc comments r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
3 years agoFix attachment of inner doc comments
Aleksey Kladov [Thu, 12 Nov 2020 11:09:12 +0000 (12:09 +0100)]
Fix attachment of inner doc comments

3 years agoSimplify code
Aleksey Kladov [Thu, 12 Nov 2020 10:45:18 +0000 (11:45 +0100)]
Simplify code

3 years agoMerge #6531
bors[bot] [Thu, 12 Nov 2020 10:23:40 +0000 (10:23 +0000)]
Merge #6531

6531: Update crates r=matklad a=kjeremy

Co-authored-by: kjeremy <kjeremy@gmail.com>
Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
3 years agoUpdate tests
Aleksey Kladov [Thu, 12 Nov 2020 10:19:26 +0000 (11:19 +0100)]
Update tests

3 years agoUpdate crates
kjeremy [Wed, 11 Nov 2020 16:17:48 +0000 (11:17 -0500)]
Update crates

3 years agoMerge #6530
bors[bot] [Wed, 11 Nov 2020 16:03:42 +0000 (16:03 +0000)]
Merge #6530

6530: Do not use yanked once_cell r=kjeremy a=kjeremy

Co-authored-by: kjeremy <kjeremy@gmail.com>
3 years agoDo not use yanked once_cell
kjeremy [Wed, 11 Nov 2020 16:02:49 +0000 (11:02 -0500)]
Do not use yanked once_cell

3 years agoReorder rustc_private loading
Xavier Denis [Wed, 11 Nov 2020 12:03:44 +0000 (13:03 +0100)]
Reorder rustc_private loading

3 years agoAdd support for loading rustc private crates
Xavier Denis [Tue, 10 Nov 2020 20:50:05 +0000 (21:50 +0100)]
Add support for loading rustc private crates

3 years agoMerge #6526
bors[bot] [Wed, 11 Nov 2020 02:13:46 +0000 (02:13 +0000)]
Merge #6526

6526: Replace RacyFlag with OnceCell r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
3 years agoReplace RacyFlag with OnceCell
Aleksey Kladov [Wed, 11 Nov 2020 02:11:40 +0000 (03:11 +0100)]
Replace RacyFlag with OnceCell

3 years agoMerge #6523
bors[bot] [Tue, 10 Nov 2020 19:39:27 +0000 (19:39 +0000)]
Merge #6523

6523: Be more pedantic when checking codeAction/resolve support r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
3 years agoBe more pedantic when checking codeAction/resolve support
Aleksey Kladov [Tue, 10 Nov 2020 19:38:10 +0000 (20:38 +0100)]
Be more pedantic when checking codeAction/resolve support

3 years agoMerge #6521
bors[bot] [Tue, 10 Nov 2020 17:53:10 +0000 (17:53 +0000)]
Merge #6521

6521: Switch to upstream protocol for resolving code action r=matklad a=matklad

Note that we have to maintain custom implementation on the client
side: I don't see how to marry bulitin resolve support with groups and
snippets.

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
3 years agoSwitch to upstream protocol for resolving code action
Aleksey Kladov [Tue, 10 Nov 2020 17:20:01 +0000 (18:20 +0100)]
Switch to upstream protocol for resolving code action

Note that we have to maintain custom implementation on the client
side: I don't see how to marry bulitin resolve support with groups and
snippets.

3 years agoMerge #6512
bors[bot] [Mon, 9 Nov 2020 23:41:43 +0000 (23:41 +0000)]
Merge #6512

6512: Don't replace parent node when inserting as first child in algo::diff r=SomeoneToIgnore a=Veykril

This makes the diff a bit more detailed.

See https://github.com/rust-analyzer/rust-analyzer/pull/6287#issuecomment-723889267 for context
cc @SomeoneToIgnore

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
3 years agoMerge #6516
bors[bot] [Mon, 9 Nov 2020 23:35:33 +0000 (23:35 +0000)]
Merge #6516

6516: Textmate grammar: prevent `/**/` from matching block doc comments r=dustypomerleau a=dustypomerleau

Fixes #6493.

Co-authored-by: Dusty Pomerleau <dustypomerleau@users.noreply.github.com>
3 years agofix: prevent `/**/` from matching block doc comments
Dusty Pomerleau [Mon, 9 Nov 2020 22:54:00 +0000 (09:54 +1100)]
fix: prevent `/**/` from matching block doc comments

3 years agoMerge #6472
bors[bot] [Mon, 9 Nov 2020 21:13:51 +0000 (21:13 +0000)]
Merge #6472

6472: Add `static` modifier for associated functions r=matklad a=p3achyjr

Adds static semantic token modifier to associated functions, resolves #6194

## Info

- Associated functions are more-or-less equivalent to static methods in other languages. This PR checks, for each function, whether that function has a self_param, and whether it's enclosed in a trait/impl.

## Changes

- Added method ```is_associated``` to code_model::Function. This basically gets the source from the ast, and checks whether the enclosing scope is an impl or trait.
- Added `static` to HighlightModifiers
- Added unit test

## Tests

- Ran ```cargo test```

Co-authored-by: Anatol Liu <axlui@anatols-mbp.lan>
3 years agoAdd static semantic token modifier for associated functions with no &self
Anatol Liu [Thu, 5 Nov 2020 04:08:46 +0000 (20:08 -0800)]
Add static semantic token modifier for associated functions with no &self

refactor logic into code_model.rs

address comments

3 years agoDon't replace parent node when inserting as first child in algo::diff
Lukas Wirth [Mon, 9 Nov 2020 17:42:32 +0000 (18:42 +0100)]
Don't replace parent node when inserting as first child in algo::diff

3 years agoAdd multiple file edit tes to remove_unused_param assist
Lukas Wirth [Mon, 9 Nov 2020 18:06:11 +0000 (19:06 +0100)]
Add multiple file edit tes to remove_unused_param assist

3 years agoMerge #6511
bors[bot] [Mon, 9 Nov 2020 17:12:57 +0000 (17:12 +0000)]
Merge #6511

6511: . is an operator r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
3 years ago. is an operator
Aleksey Kladov [Mon, 9 Nov 2020 17:06:54 +0000 (18:06 +0100)]
. is an operator

closes #6498

3 years agoMerge #6510
bors[bot] [Mon, 9 Nov 2020 16:01:19 +0000 (16:01 +0000)]
Merge #6510

6510: Fix panic when extracting struct r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
3 years agoFix panic when extracting struct
Aleksey Kladov [Mon, 9 Nov 2020 15:40:41 +0000 (16:40 +0100)]
Fix panic when extracting struct

3 years agoMerge #6509
bors[bot] [Mon, 9 Nov 2020 13:44:44 +0000 (13:44 +0000)]
Merge #6509

6509: Support multi-file assist tests r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
3 years agoSupport multi-file assist tests
Aleksey Kladov [Mon, 9 Nov 2020 13:22:45 +0000 (14:22 +0100)]
Support multi-file assist tests

3 years agoMerge #6508
bors[bot] [Mon, 9 Nov 2020 13:10:23 +0000 (13:10 +0000)]
Merge #6508

6508: Fix debug for SyntaxRewriter r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
3 years agoFix debug for SyntaxRewriter
Aleksey Kladov [Mon, 9 Nov 2020 13:09:49 +0000 (14:09 +0100)]
Fix debug for SyntaxRewriter

3 years agoMerge #6506
bors[bot] [Mon, 9 Nov 2020 12:28:57 +0000 (12:28 +0000)]
Merge #6506

6506: Cleanup assists r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
3 years agoUse standard style for test code
Aleksey Kladov [Mon, 9 Nov 2020 12:28:04 +0000 (13:28 +0100)]
Use standard style for test code

3 years agoMore consistent naming
Aleksey Kladov [Mon, 9 Nov 2020 12:18:40 +0000 (13:18 +0100)]
More consistent naming

3 years agoMore consistent naming
Aleksey Kladov [Mon, 9 Nov 2020 12:07:18 +0000 (13:07 +0100)]
More consistent naming

3 years agoMerge #6465
bors[bot] [Mon, 9 Nov 2020 11:54:42 +0000 (11:54 +0000)]
Merge #6465

6465: Support multiple file edits in AssistBuilder r=matklad a=Veykril

Fixes #6459

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
3 years agoMerge #6501
bors[bot] [Mon, 9 Nov 2020 11:40:08 +0000 (11:40 +0000)]
Merge #6501

6501: Remove text_edit_builder api from AssistBuilder r=matklad a=Veykril

Also fixes a small bug in `expand_glob_import` in regards to the very nice looking `something::{*}` import when only one item was used. Before it would duplicate the path and just append it, causing the following wrong import `something::something::UsedItem`.

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
3 years agoMerge #6500
bors[bot] [Mon, 9 Nov 2020 09:55:46 +0000 (09:55 +0000)]
Merge #6500

6500: Add some postfix snippet r=matklad a=pksunkara

Nothing much to explain. Just a simple addition. I was recently doing some refactoring and this would have made it a bit more faster.

Co-authored-by: Pavan Kumar Sunkara <pavan.sss1991@gmail.com>
3 years agoRemove text_edit_builder api from AssistBuilder
Lukas Wirth [Sun, 8 Nov 2020 22:22:11 +0000 (23:22 +0100)]
Remove text_edit_builder api from AssistBuilder

3 years agoAdd some postfix snippet
Pavan Kumar Sunkara [Sun, 8 Nov 2020 18:43:25 +0000 (19:43 +0100)]
Add some postfix snippet

3 years agoAdd static semantic token modifier for associated functions with no &self
Anatol Liu [Thu, 5 Nov 2020 04:08:46 +0000 (20:08 -0800)]
Add static semantic token modifier for associated functions with no &self

refactor logic into code_model.rs

address comments

3 years agoMerge #6497
bors[bot] [Sun, 8 Nov 2020 01:47:10 +0000 (01:47 +0000)]
Merge #6497

6497: vscode: fix tmGrammar issues around non-controlflow keywords r=dustypomerleau a=cynecx

Addresses some of the issues mentioned here: https://github.com/dustypomerleau/rust-syntax/issues/5.
In sync with https://github.com/dustypomerleau/rust-syntax/issues/6.

Co-authored-by: cynecx <me@cynecx.net>
3 years agovscode: fix tmGrammar issues around non-controlflow keywords
cynecx [Sat, 7 Nov 2020 19:12:56 +0000 (20:12 +0100)]
vscode: fix tmGrammar issues around non-controlflow keywords

3 years agoMerge #6476
bors[bot] [Sat, 7 Nov 2020 18:21:11 +0000 (18:21 +0000)]
Merge #6476

6476: Add missing AssocItems in add_custom_impl assist r=matklad a=Veykril

```rust
use std::fmt;

#[derive(Debu<|>g)]
struct Foo {
    bar: String,
}
```
->
```rust
use std::fmt;

struct Foo {
    bar: String,
}

impl fmt::Debug for Foo {
    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
        ${0:todo!()}
    }
}
```

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
3 years agoMerge #6491
bors[bot] [Sat, 7 Nov 2020 11:17:55 +0000 (11:17 +0000)]
Merge #6491

6491: Textmate grammar: allow variables to terminate ranges r=dustypomerleau a=dustypomerleau

Variables were originally designed not to match after a dot, in order to avoid matching struct field access, however this resulted in variables that end ranges not being highlighted. In order to fix this we match a preceding dot, only if it's preceded by at least one other dot. Attempting to match on `(\.{2,})?` won't work, because the optional group allows struct field access to match even when one dot is present.

Co-authored-by: Dusty Pomerleau <dustypomerleau@users.noreply.github.com>
3 years agoallow variables to terminate ranges
Dusty Pomerleau [Sat, 7 Nov 2020 11:08:29 +0000 (22:08 +1100)]
allow variables to terminate ranges

3 years agoMerge #6490
bors[bot] [Sat, 7 Nov 2020 10:45:09 +0000 (10:45 +0000)]
Merge #6490

6490: Minimize convert_integer_literal tests r=matklad a=m-ysk

Closes #6455

This PR removes some redundant tests around convert_integer_literal.

First, it removes test cases about converting integer with underscores except for just one case. This is because the process of removing of underscores in given integer literals is independent from radix.

Second, as well as underscore cases, it removes test cases about converting integer with suffix except for just one case. This is because the process of handling suffix is independent from radix.

Finally, it removes small decimal integer cases. This is because "special case where they return early" has been removed by the PR #6482, so we have no need to retain this cases.

Co-authored-by: m-ysk <myskjp@gmail.com>
3 years agoMinimize convert_integer_literal tests
m-ysk [Sat, 7 Nov 2020 09:47:25 +0000 (18:47 +0900)]
Minimize convert_integer_literal tests

3 years agoMerge #6489
bors[bot] [Sat, 7 Nov 2020 03:59:36 +0000 (03:59 +0000)]
Merge #6489

6489: Textmate grammar: Precedence fixes r=dustypomerleau a=dustypomerleau

- prevent `pat` from matching before `path` in metavariable types
- reduce the precedence of math operators so that assignment operators match correctly

Co-authored-by: Dusty Pomerleau <dustypomerleau@users.noreply.github.com>
3 years agoprecedence fixes:
Dusty Pomerleau [Sat, 7 Nov 2020 03:56:06 +0000 (14:56 +1100)]
precedence fixes:

- prevent `pat` from matching before `path` in metavariable types
- reduce the precedence of math operators so that assignment operators match correctly

3 years agoMerge #6488
bors[bot] [Fri, 6 Nov 2020 22:52:13 +0000 (22:52 +0000)]
Merge #6488

6488: Textmate grammar: add `+=` to assignment operators r=dustypomerleau a=dustypomerleau

Fixes https://github.com/dustypomerleau/rust-syntax/issues/3.

Co-authored-by: Dusty Pomerleau <dustypomerleau@users.noreply.github.com>
3 years agoadd `+=` to assignment operators
Dusty Pomerleau [Fri, 6 Nov 2020 22:49:08 +0000 (09:49 +1100)]
add `+=` to assignment operators

3 years agoMerge #6486
bors[bot] [Fri, 6 Nov 2020 21:54:14 +0000 (21:54 +0000)]
Merge #6486

6486: Cleanup API r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
3 years agoCleanup API
Aleksey Kladov [Fri, 6 Nov 2020 21:52:22 +0000 (22:52 +0100)]
Cleanup API

3 years agoMerge #6485
bors[bot] [Fri, 6 Nov 2020 21:39:02 +0000 (21:39 +0000)]
Merge #6485

6485: Remove RAW literals r=matklad a=matklad

bors r+
🤖

closes https://github.com/rust-analyzer/rust-analyzer/issues/6308

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
3 years agoMerge #6477
bors[bot] [Fri, 6 Nov 2020 21:32:27 +0000 (21:32 +0000)]
Merge #6477

6477: Add infer_function_return_type assist r=matklad a=Veykril

This adds an assist to insert a functions return type if it hasn't been specified yet by inferring it from the functions tail expression. This assist only becomes active if the cursor is on the tail expression. See https://github.com/rust-analyzer/rust-analyzer/issues/6303#issuecomment-714657326

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
3 years agoSimplify
Aleksey Kladov [Fri, 6 Nov 2020 21:30:58 +0000 (22:30 +0100)]
Simplify

3 years agoKill RAW_ literals
Aleksey Kladov [Fri, 6 Nov 2020 21:21:56 +0000 (22:21 +0100)]
Kill RAW_ literals

Syntactically, they are indistinguishable from non-raw versions, so it
doesn't make sense to separate then *at the syntax* level.

3 years agoAdjust test-texts in infer_function_return_type
Lukas Wirth [Fri, 6 Nov 2020 20:51:15 +0000 (21:51 +0100)]
Adjust test-texts in infer_function_return_type

3 years agoEnable infer_function_return_type in return-type position
Lukas Wirth [Fri, 6 Nov 2020 20:49:03 +0000 (21:49 +0100)]
Enable infer_function_return_type in return-type position

3 years agoMerge #6484
bors[bot] [Fri, 6 Nov 2020 20:10:15 +0000 (20:10 +0000)]
Merge #6484

6484: Minor, cleanup style r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>