]> git.lizzy.rs Git - rust.git/log
rust.git
2 years agoMerge #10105
bors[bot] [Fri, 24 Sep 2021 15:12:17 +0000 (15:12 +0000)]
Merge #10105

10105: RfC: Use `todo!()` instead of `()` for missing fields r=jonas-schievink a=jo-so

Most commonly a field of a struct can be initialized with its default value than an empty tuple.

Co-authored-by: Jörg Sommer <joerg@jo-so.de>
2 years agoMerge #10332
bors[bot] [Fri, 24 Sep 2021 14:59:02 +0000 (14:59 +0000)]
Merge #10332

10332: minor: Allow overwriting RUST_BACKTRACE for the server manually r=jonas-schievink a=Veykril

Trying to figure out why we aren't getting backtraces for windows builds from CI, this let's one set the backtraces to `FULL`
Might be cc https://github.com/rust-lang/rust/issues/87481
bors r+

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2 years agoMerge #10331
bors[bot] [Fri, 24 Sep 2021 14:51:19 +0000 (14:51 +0000)]
Merge #10331

10331: minor: Include macro path in eager macro resolve error r=jonas-schievink a=jonas-schievink

bors r+

Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
2 years agoMerge #10329
bors[bot] [Fri, 24 Sep 2021 14:02:16 +0000 (14:02 +0000)]
Merge #10329

10329: Fix link to "Auto Import" r=lnicola a=carlos-menezes

https://github.com/rust-analyzer/rust-analyzer.github.io/pull/147#issuecomment-926600543

Co-authored-by: Carlos Menezes <carlos-menezes212@hotmail.com>
2 years agoAdd missing files
Carlos Menezes [Fri, 24 Sep 2021 13:53:11 +0000 (14:53 +0100)]
Add missing files

2 years agoAllow setting RUST_BACKTRACE for the server manually
Lukas Wirth [Fri, 24 Sep 2021 13:38:00 +0000 (15:38 +0200)]
Allow setting RUST_BACKTRACE for the server manually

2 years agoInclude macro path in eager macro resolve error
Jonas Schievink [Fri, 24 Sep 2021 13:34:57 +0000 (15:34 +0200)]
Include macro path in eager macro resolve error

2 years agoFix link to "Auto Import"
Carlos Menezes [Fri, 24 Sep 2021 12:59:44 +0000 (13:59 +0100)]
Fix link to "Auto Import"

2 years agoMerge #10328
bors[bot] [Fri, 24 Sep 2021 12:21:12 +0000 (12:21 +0000)]
Merge #10328

10328: fix: Fix incorrect mod.rs handling in unlinked_file fixes r=Veykril a=Veykril

bors r+

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2 years agoFix incorrect mod.rs handling in unlinked_file fixes
Lukas Wirth [Fri, 24 Sep 2021 12:20:43 +0000 (14:20 +0200)]
Fix incorrect mod.rs handling in unlinked_file fixes

2 years agoMerge #10322
bors[bot] [Thu, 23 Sep 2021 18:36:44 +0000 (18:36 +0000)]
Merge #10322

10322: internal: Split the hover module up r=Veykril a=Veykril

cc https://github.com/rust-analyzer/rust-analyzer/issues/10107
bors r+

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2 years agoSplit the hover module up
Lukas Wirth [Thu, 23 Sep 2021 17:54:57 +0000 (19:54 +0200)]
Split the hover module up

2 years agoMerge #10321
bors[bot] [Thu, 23 Sep 2021 18:06:08 +0000 (18:06 +0000)]
Merge #10321

10321: fix: Change the global setting when toggling inlay hints r=lnicola a=lnicola

Closes #10318

Co-authored-by: Laurențiu Nicola <lnicola@dend.ro>
2 years agoMerge #10320
bors[bot] [Thu, 23 Sep 2021 17:56:55 +0000 (17:56 +0000)]
Merge #10320

10320: feat: Hover/GotoDef works in macro invocations and on doc attribute strings r=Veykril a=Veykril

![image](https://user-images.githubusercontent.com/3757771/134554781-b903d33d-674f-4ed4-8acb-71ff5913f1cb.png)
cc https://github.com/rust-analyzer/rust-analyzer/issues/10271

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2 years agoChange the global setting when toggling inlay hints
Laurențiu Nicola [Thu, 23 Sep 2021 17:45:45 +0000 (20:45 +0300)]
Change the global setting when toggling inlay hints

2 years agoSupport goto_def for intra-doc-links in macro invocations
Lukas Wirth [Thu, 23 Sep 2021 17:17:29 +0000 (19:17 +0200)]
Support goto_def for intra-doc-links in macro invocations

2 years agoMake hover work for intra doc links in macro invocations
Lukas Wirth [Thu, 23 Sep 2021 15:32:39 +0000 (17:32 +0200)]
Make hover work for intra doc links in macro invocations

2 years agoMerge #10319
bors[bot] [Thu, 23 Sep 2021 14:28:27 +0000 (14:28 +0000)]
Merge #10319

10319: internal: Cleanup hover a bit r=Veykril a=Veykril

bors r+

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2 years agoCleanup
Lukas Wirth [Thu, 23 Sep 2021 13:37:52 +0000 (15:37 +0200)]
Cleanup

2 years agoMerge #10315
bors[bot] [Thu, 23 Sep 2021 04:55:34 +0000 (04:55 +0000)]
Merge #10315

10315: Fix title of User Manual page r=lnicola a=terrynsun

Asciidoc uses the first line of a doc as the title, so you can't put
comments before the heading.

---
I had an old copy of the Manual page open and I noticed that the "User Manual" heading (and page title) had disappeared in the live version:

![image](https://user-images.githubusercontent.com/2858750/134455658-3885b754-9eae-4dca-a6d4-4b1453910850.png)

With this change (and how it was a few days ago):

![image](https://user-images.githubusercontent.com/2858750/134455865-5acc7538-ccf8-4346-941f-3a5561b3181e.png)

Co-authored-by: Terry Sun <terrynsun@gmail.com>
2 years agoFix title of User Manual page
Terry Sun [Thu, 23 Sep 2021 04:37:17 +0000 (21:37 -0700)]
Fix title of User Manual page

Asciidoc uses the first line of a doc as the title, so you can't put
comments before the heading.

2 years agoMerge #10313
bors[bot] [Wed, 22 Sep 2021 20:04:30 +0000 (20:04 +0000)]
Merge #10313

10313: Mark large benchmark data files as binary to filter greps r=lnicola a=joshtriplett

When doing a git grep (of rust-analyzer or of rust-lang/rust with
--recurse-submodules), if the grep happens to match within the large
benchmark data files, the resulting long single lines can cause a text
pager or editor to slow down and distract from more useful matches.

These test data files aren't formatted for human consumption, so mark
them as binary, which causes git grep to instead just state that they
match without printing the matching "line".

Co-authored-by: Josh Triplett <josh@joshtriplett.org>
2 years agoMark large benchmark data files as binary to filter greps
Josh Triplett [Wed, 22 Sep 2021 19:51:58 +0000 (12:51 -0700)]
Mark large benchmark data files as binary to filter greps

When doing a git grep (of rust-analyzer or of rust-lang/rust with
--recurse-submodules), if the grep happens to match within the large
benchmark data files, the resulting long single lines can cause a text
pager or editor to slow down and distract from more useful matches.

These test data files aren't formatted for human consumption, so mark
them as binary, which causes git grep to instead just state that they
match without printing the matching "line".

2 years agoMerge #10284
bors[bot] [Wed, 22 Sep 2021 15:23:23 +0000 (15:23 +0000)]
Merge #10284

10284: internal: definition based hover functions r=Veykril a=HKalbasi

This is part of #10181 but since it is blocked and `hover.rs` is moving quickly so will cause conflicts, I submitted this PR.

This PR extract some parts of `hover` to `find_definition` (maybe this need to be moved to some other file?) and `hover_for_definition`, with those functions I will be able to calculate definition of every token, and calculate hover (and probably other queries) for each definition only once.

Co-authored-by: hamidreza kalbasi <hamidrezakalbasi@protonmail.com>
2 years agomove function to defs.rs
hamidreza kalbasi [Wed, 22 Sep 2021 15:05:54 +0000 (18:35 +0330)]
move function to defs.rs

2 years agoremove dead code
hamidreza kalbasi [Wed, 22 Sep 2021 08:14:23 +0000 (11:44 +0330)]
remove dead code

2 years agouse find_definition in go to
hamidreza kalbasi [Wed, 22 Sep 2021 08:07:26 +0000 (11:37 +0330)]
use find_definition in go to

2 years agoMerge #10306
bors[bot] [Tue, 21 Sep 2021 22:54:56 +0000 (22:54 +0000)]
Merge #10306

10306: Generate function assist creates bad param names for const/static item args r=XFFXFF a=XFFXFF

Try to fix #10278

Co-authored-by: zhoufan <1247714429@qq.com>
2 years agoChange the style of the code
zhoufan [Tue, 21 Sep 2021 22:32:23 +0000 (06:32 +0800)]
Change the style of the code

2 years agoGenerate function assist creates bad param names for const/static item args
zhoufan [Tue, 21 Sep 2021 16:15:57 +0000 (00:15 +0800)]
Generate function assist creates bad param names for const/static item args

2 years agofix derive hover in macro
hamidreza kalbasi [Tue, 21 Sep 2021 15:25:57 +0000 (19:55 +0430)]
fix derive hover in macro

2 years agoMerge #10304
bors[bot] [Tue, 21 Sep 2021 14:15:53 +0000 (14:15 +0000)]
Merge #10304

10304: internal: Generate ast nodes for each ast trait r=Veykril a=Veykril

Generate a `DynTrait` node per ast trait that implements the trait itself as well as conversions via the `AstNode` trait. This is a trick already employed in `hir_def::attr` with `AttrsOwner` where it was manually implemented for.

This basically gives us stack trait objects for these(only useful for `hir_def::attr` currently) as well as simple conversions of `SyntaxNode` to a trait, in cases where only a result of a function call of such a trait is of interest.

It doesn't have many uses yet but as its autogenerated it doesn't add any maintenance costs.

bors r+

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2 years agoSimplify
Lukas Wirth [Tue, 21 Sep 2021 14:15:30 +0000 (16:15 +0200)]
Simplify

2 years agoSimplify
Lukas Wirth [Tue, 21 Sep 2021 13:56:06 +0000 (15:56 +0200)]
Simplify

2 years agoGenerate ast nodes for each ast trait
Lukas Wirth [Tue, 21 Sep 2021 13:52:11 +0000 (15:52 +0200)]
Generate ast nodes for each ast trait

2 years agoMerge #10303
bors[bot] [Tue, 21 Sep 2021 12:56:37 +0000 (12:56 +0000)]
Merge #10303

10303: internal: Add a mirror function-like proc-macro expander for tests r=Veykril a=Veykril

bors r+

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2 years agoAdd a mirror function-like proc-macro expander for tests
Lukas Wirth [Tue, 21 Sep 2021 12:55:54 +0000 (14:55 +0200)]
Add a mirror function-like proc-macro expander for tests

2 years agoMerge #10301
bors[bot] [Tue, 21 Sep 2021 08:34:51 +0000 (08:34 +0000)]
Merge #10301

10301: minor: Merge iter_for_each_to_for and for_to_iter_for_each assists modules r=Veykril a=Veykril

bors r+

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2 years agoMerge iter_for_each_to_for and for_to_iter_for_each assists modules
Lukas Wirth [Tue, 21 Sep 2021 08:34:11 +0000 (10:34 +0200)]
Merge iter_for_each_to_for and for_to_iter_for_each assists modules

2 years agoMerge #10299
bors[bot] [Mon, 20 Sep 2021 22:54:39 +0000 (22:54 +0000)]
Merge #10299

10299: minor: Rename some assists r=Veykril a=Veykril

Trying to make our assist names a bit more uniform
`fill_match_arms` -> `add_missing_match_arms`
`infer_function_return_type` -> `add_return_type`
`replace_impl_trait_with_generic` -> `introduce_named_generic`
bors r+

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2 years agoRename some assists
Lukas Wirth [Mon, 20 Sep 2021 21:53:05 +0000 (23:53 +0200)]
Rename some assists

2 years agoMerge #10293
bors[bot] [Sun, 19 Sep 2021 22:33:42 +0000 (22:33 +0000)]
Merge #10293

10293: fix: Don't bail on parse errors in macro input for builtin expansion r=Veykril a=Veykril

Fixes https://github.com/rust-analyzer/rust-analyzer/issues/8158

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2 years agoDon't bail on parse errors in macro input for builtin expansion
Lukas Wirth [Sun, 19 Sep 2021 22:22:30 +0000 (00:22 +0200)]
Don't bail on parse errors in macro input for builtin expansion

2 years agoMerge #10289
bors[bot] [Sun, 19 Sep 2021 21:46:51 +0000 (21:46 +0000)]
Merge #10289

10289: fix: Only strip derive attributes when preparing macro input r=Veykril a=Veykril

Fixes https://github.com/rust-analyzer/rust-analyzer/issues/10246
cc https://github.com/rust-analyzer/rowan/pull/114, follow up to https://github.com/rust-analyzer/rust-analyzer/pull/10025

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2 years agoMerge #10292
bors[bot] [Sun, 19 Sep 2021 21:39:36 +0000 (21:39 +0000)]
Merge #10292

10292: minor: Simplify r=Veykril a=Veykril

bors r+

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2 years agoOnly strip derive attributes when preparing macro input
Lukas Wirth [Sun, 19 Sep 2021 16:30:29 +0000 (18:30 +0200)]
Only strip derive attributes when preparing macro input

2 years agoSimplify
Lukas Wirth [Sun, 19 Sep 2021 21:34:07 +0000 (23:34 +0200)]
Simplify

2 years agoMerge #10290
bors[bot] [Sun, 19 Sep 2021 17:01:23 +0000 (17:01 +0000)]
Merge #10290

10290: minor: Simplify r=Veykril a=Veykril

bors r+

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2 years agoSimplify
Lukas Wirth [Sun, 19 Sep 2021 17:00:06 +0000 (19:00 +0200)]
Simplify

2 years agoMerge #10287
bors[bot] [Sun, 19 Sep 2021 13:35:46 +0000 (13:35 +0000)]
Merge #10287

10287: internal: more focused tests for const arguments r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2 years agointernal: more focused tests for const arguments
Aleksey Kladov [Sun, 19 Sep 2021 13:35:10 +0000 (16:35 +0300)]
internal: more focused tests for const arguments

2 years agoMerge #10283
bors[bot] [Sun, 19 Sep 2021 11:51:38 +0000 (11:51 +0000)]
Merge #10283

10283: minor: simplify generics parsing r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2 years agominor: simplify
Aleksey Kladov [Sun, 19 Sep 2021 11:32:02 +0000 (14:32 +0300)]
minor: simplify

2 years agointernal: definition based hover functions
hamidreza kalbasi [Sun, 19 Sep 2021 11:45:44 +0000 (16:15 +0430)]
internal: definition based hover functions

2 years agominor: simplify
Aleksey Kladov [Sun, 19 Sep 2021 11:26:35 +0000 (14:26 +0300)]
minor: simplify

2 years agoMerge #10282
bors[bot] [Sun, 19 Sep 2021 09:10:32 +0000 (09:10 +0000)]
Merge #10282

10282: fix: don't allow two turbo-fishes in generic arguments r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2 years agofix: don't allow two turbo-fishes in generic arguments
Aleksey Kladov [Sun, 19 Sep 2021 09:09:50 +0000 (12:09 +0300)]
fix: don't allow two turbo-fishes in generic arguments

2 years agoMerge #10280
bors[bot] [Sun, 19 Sep 2021 08:54:02 +0000 (08:54 +0000)]
Merge #10280

10280: internal: type argument parsing refactoring r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2 years agointernal: add erroneous test for double turbo fish
Aleksey Kladov [Sun, 19 Sep 2021 08:42:10 +0000 (11:42 +0300)]
internal: add erroneous test for double turbo fish

We parse `f` successfully, but that is a bug.

2 years agominor: improve readability
Aleksey Kladov [Sun, 19 Sep 2021 08:34:25 +0000 (11:34 +0300)]
minor: improve readability

2 years agominor: reduce duplication
Aleksey Kladov [Sun, 19 Sep 2021 08:19:31 +0000 (11:19 +0300)]
minor: reduce duplication

2 years agoMerge #10276
bors[bot] [Sat, 18 Sep 2021 13:09:51 +0000 (13:09 +0000)]
Merge #10276

10276: internal: parser cleanup r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2 years agofix: correctly handle jointness
Aleksey Kladov [Sat, 18 Sep 2021 13:09:12 +0000 (16:09 +0300)]
fix: correctly handle jointness

2 years agominor: improve readability
Aleksey Kladov [Sat, 18 Sep 2021 12:56:26 +0000 (15:56 +0300)]
minor: improve readability

2 years agointernal: better naming
Aleksey Kladov [Sat, 18 Sep 2021 12:54:55 +0000 (15:54 +0300)]
internal: better naming

2 years agointernal: parser cleanup
Aleksey Kladov [Sat, 18 Sep 2021 12:46:28 +0000 (15:46 +0300)]
internal: parser cleanup

2 years agointernal: minimize use_tree parser tests
Aleksey Kladov [Sat, 18 Sep 2021 12:22:49 +0000 (15:22 +0300)]
internal: minimize use_tree parser tests

The code here is intentionally dense and does exactly what is written.
Explaining semantic difference between Rust 2015 and 2018 doesn't help
with understanding syntax. Better to just add more targeted tests.

2 years agoMerge #10275
bors[bot] [Sat, 18 Sep 2021 12:20:55 +0000 (12:20 +0000)]
Merge #10275

10275: internal: parser cleanups r=Veykril a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2 years agointernal: parser cleanups
Aleksey Kladov [Sat, 18 Sep 2021 11:53:46 +0000 (14:53 +0300)]
internal: parser cleanups

2 years agoMerge #10274
bors[bot] [Sat, 18 Sep 2021 11:43:10 +0000 (11:43 +0000)]
Merge #10274

10274: feat: Make inlay hints work in attributed items r=Veykril a=Veykril

Attempt at #10043(previous attempt #10231)
![image](https://user-images.githubusercontent.com/3757771/133887500-091675db-f473-44f8-9bf5-8313ecfbc9e7.png)
Slight difference to the first approach, chaining hints now work but attribute inputs do not as they are basically the same as normal macros in that they take a token tree.

Fixes #10043

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2 years agointernal: more focused trait item parsing tests
Aleksey Kladov [Sat, 18 Sep 2021 11:34:29 +0000 (14:34 +0300)]
internal: more focused trait item parsing tests

2 years agoMake inlay hints work in attributed items
Lukas Wirth [Sat, 18 Sep 2021 11:19:29 +0000 (13:19 +0200)]
Make inlay hints work in attributed items

2 years agoMerge #10273
bors[bot] [Sat, 18 Sep 2021 10:00:47 +0000 (10:00 +0000)]
Merge #10273

10273: minor: Add multi-token mapping test for goto_definition r=Veykril a=Veykril

bors r+

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2 years agoAdd multi-token mapping test for goto_definition
Lukas Wirth [Sat, 18 Sep 2021 09:59:57 +0000 (11:59 +0200)]
Add multi-token mapping test for goto_definition

2 years agoMerge #10252
bors[bot] [Sat, 18 Sep 2021 01:21:43 +0000 (01:21 +0000)]
Merge #10252

10252: fix: make `goto_definition` multi-token mapping aware r=Veykril a=XFFXFF

Implement #10070 in  [`goto_definition`](https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ide/src/goto_definition.rs)

Co-authored-by: zhoufan <1247714429@qq.com>
2 years agodo comment handling on the original token
zhoufan [Sat, 18 Sep 2021 00:22:57 +0000 (08:22 +0800)]
do comment handling on the original token

2 years agoMerge #10267
bors[bot] [Fri, 17 Sep 2021 22:44:39 +0000 (22:44 +0000)]
Merge #10267

10267: Narrow "if-let to match" assist available range r=Veykril a=rainy-me

ref: https://github.com/rust-analyzer/rust-analyzer/issues/10220

Co-authored-by: rainy-me <github@rainy.me>
2 years agoMerge #10270
bors[bot] [Fri, 17 Sep 2021 22:05:16 +0000 (22:05 +0000)]
Merge #10270

10270: intenral: more item parsing cleanup r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2 years agointenral: more local tests for statics
Aleksey Kladov [Fri, 17 Sep 2021 22:02:43 +0000 (01:02 +0300)]
intenral: more local tests for statics

2 years agominor: cleanup const parsing
Aleksey Kladov [Fri, 17 Sep 2021 21:58:35 +0000 (00:58 +0300)]
minor: cleanup const parsing

2 years agominor: better test placement
Aleksey Kladov [Fri, 17 Sep 2021 21:54:03 +0000 (00:54 +0300)]
minor: better test placement

2 years agointernal: cleanup adt parsing
Aleksey Kladov [Fri, 17 Sep 2021 21:50:27 +0000 (00:50 +0300)]
internal: cleanup adt parsing

2 years agoMerge #10269
bors[bot] [Fri, 17 Sep 2021 21:39:06 +0000 (21:39 +0000)]
Merge #10269

10269: internal: cleanup item parsing r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2 years agointernal: cleanup item parsing
Aleksey Kladov [Fri, 17 Sep 2021 21:33:42 +0000 (00:33 +0300)]
internal: cleanup item parsing

2 years agominor: parser cleanup
Aleksey Kladov [Fri, 17 Sep 2021 21:14:20 +0000 (00:14 +0300)]
minor: parser cleanup

2 years agoMerge #10268
bors[bot] [Fri, 17 Sep 2021 20:35:02 +0000 (20:35 +0000)]
Merge #10268

10268: intenral: simplify parser r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2 years agominor: simplify
Aleksey Kladov [Fri, 17 Sep 2021 20:31:37 +0000 (23:31 +0300)]
minor: simplify

2 years agoNarrow "if-let to match" assist available range
rainy-me [Fri, 17 Sep 2021 20:27:24 +0000 (05:27 +0900)]
Narrow "if-let to match" assist available range

2 years agominor: cleanup
Aleksey Kladov [Fri, 17 Sep 2021 20:27:26 +0000 (23:27 +0300)]
minor: cleanup

2 years agoMerge #10265
bors[bot] [Fri, 17 Sep 2021 19:27:32 +0000 (19:27 +0000)]
Merge #10265

10265: internal: parser cleanups r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2 years agominor: simplify
Aleksey Kladov [Fri, 17 Sep 2021 19:26:39 +0000 (22:26 +0300)]
minor: simplify

2 years agointernal: more local parsing tests for macros
Aleksey Kladov [Fri, 17 Sep 2021 19:21:07 +0000 (22:21 +0300)]
internal: more local parsing tests for macros

2 years agointernal: more focused parsing tests
Aleksey Kladov [Fri, 17 Sep 2021 19:15:12 +0000 (22:15 +0300)]
internal: more focused parsing tests

2 years agointernal: more local test for mod item
Aleksey Kladov [Fri, 17 Sep 2021 18:53:24 +0000 (21:53 +0300)]
internal: more local test for mod item

2 years agointernal: more local parsing tests
Aleksey Kladov [Fri, 17 Sep 2021 18:49:01 +0000 (21:49 +0300)]
internal: more local parsing tests

2 years agointernal: parser cleanups
Aleksey Kladov [Fri, 17 Sep 2021 18:40:28 +0000 (21:40 +0300)]
internal: parser cleanups

2 years agoMerge #10260
bors[bot] [Fri, 17 Sep 2021 18:35:36 +0000 (18:35 +0000)]
Merge #10260

10260: fix: fix names generation in `Generate function` r=Veykril a=iDawer

- Improve fn name computation (close #10176).
- Handle tuple indexing expressions in argument position (should close  #10241)

Co-authored-by: Dawer <7803845+iDawer@users.noreply.github.com>
2 years agoMerge #10264
bors[bot] [Fri, 17 Sep 2021 18:28:55 +0000 (18:28 +0000)]
Merge #10264

10264: fix: Don't seek outside of character boundaries in completion handler r=Veykril a=iDawer

Fixes #10219 panic when entering `:` in `$0` places:
```rust
fn main() {
    "⊞$0";
}
```

```rust
struct S {
    д$0 u8
}
```

Co-authored-by: Dawer <7803845+iDawer@users.noreply.github.com>
2 years agofix completion handler trying to seek outside of character boundaries.
Dawer [Fri, 17 Sep 2021 18:04:20 +0000 (23:04 +0500)]
fix completion handler trying to seek outside of character boundaries.

With this patch, in these examples
```rust
fn main() {
    "⊞$0";
}
```

```rust
struct S {
д$0 u8
}
```
entering ':' character in `$0` places shouldn't cause panics.

2 years agoMerge #10257
bors[bot] [Thu, 16 Sep 2021 21:04:42 +0000 (21:04 +0000)]
Merge #10257

10257: assists: turn while into loop r=Veykril a=agluszak

Implements an assist to turn a `while` loop into a `loop` loop, as requested in #10214.
I'm not sure sure what the guidelines are regarding naming assists convert_x_to_y vs replace_x_with_y.

This is my first commit to rust-analyzer :D Thank you `@matklad` for your awesome Explaining rust-analyzer series <3

Closes #10214

Co-authored-by: Andrzej Głuszak <gluszak.andrzej@gmail.com>