]> git.lizzy.rs Git - rust.git/log
rust.git
19 months agoAuto merge of #13379 - DropDemBits:ide-assists-format-args-capture, r=Veykril
bors [Sat, 5 Nov 2022 12:29:06 +0000 (12:29 +0000)]
Auto merge of #13379 - DropDemBits:ide-assists-format-args-capture, r=Veykril

internal: Migrate `ide_assists::utils` and `ide_assists::handlers` to use format arg captures (part 1)

This not only serves as making future migration to mutable syntax trees easier, it also finds out what needs to be migrated in the first place.

~~Aside from the first commit, subsequent commits are structured to only deal with one file/handler at a time.~~

This is the first of 3 PRs, migrating:

Utils:

- `gen_trait_fn_body`
- `render_snippet`
- `ReferenceConversion`
  - `convert_type`
  - `getter`

Handlers:

- `add_explicit_type`
- `add_return_type`
- `add_turbo_fish`
- `apply_demorgan`
- `auto_import`
- `convert_comment_block`
- `convert_integer_literal`
- `convert_into_to_from`
- `convert_iter_for_each_to_for`
- `convert_let_else_to_match`
- `convert_tuple_struct_to_named_struct`
- `convert_two_arm_bool_match_to_matches_macro`
- `destructure_tuple_binding`
- `extract_function`
- `extract_module`
- `extract_struct_from_enum_variant`
- `extract_type_alias`
- `extract_variable`
- `fix_visibility`

19 months agoAuto merge of #13549 - Veykril:search-fix, r=Veykril
bors [Sat, 5 Nov 2022 12:16:18 +0000 (12:16 +0000)]
Auto merge of #13549 - Veykril:search-fix, r=Veykril

fix: Fix reference searching only accounting substrings instead of whole identifiers

Fixes https://github.com/rust-lang/rust-analyzer/issues/13498

19 months agofix: Fix reference searching only accounting substrings instead of whole identifiers
Lukas Wirth [Sat, 5 Nov 2022 11:04:21 +0000 (12:04 +0100)]
fix: Fix reference searching only accounting substrings instead of whole identifiers

19 months agoAuto merge of #13454 - justinmmott:master, r=flodiebold
bors [Sat, 5 Nov 2022 10:05:52 +0000 (10:05 +0000)]
Auto merge of #13454 - justinmmott:master, r=flodiebold

Fixed local shadowing the caller's argument issue

fix https://github.com/rust-lang/rust-analyzer/issues/12536

19 months agoAuto merge of #13541 - Veykril:dbg-cmd, r=Veykril
bors [Fri, 4 Nov 2022 23:30:48 +0000 (23:30 +0000)]
Auto merge of #13541 - Veykril:dbg-cmd, r=Veykril

Clarify what commands are debug commands in VSCode

Renders as
![image](https://user-images.githubusercontent.com/3757771/199828895-4d7691f6-5c33-405c-9842-691b32745919.png)

19 months agoMark the Memory Usage command as debug command
Lukas Wirth [Fri, 4 Nov 2022 23:30:21 +0000 (00:30 +0100)]
Mark the Memory Usage command as debug command

19 months agoAuto merge of #13546 - Veykril:unsafe-fn-ptr, r=Veykril
bors [Fri, 4 Nov 2022 20:29:16 +0000 (20:29 +0000)]
Auto merge of #13546 - Veykril:unsafe-fn-ptr, r=Veykril

Lower unsafety of fn pointer and fn item types

19 months agoLower unsafety of fn pointer and fn item types
Lukas Wirth [Fri, 4 Nov 2022 20:07:15 +0000 (21:07 +0100)]
Lower unsafety of fn pointer and fn item types

19 months agoAuto merge of #13544 - HKalbasi:patch-2, r=Veykril
bors [Fri, 4 Nov 2022 16:12:21 +0000 (16:12 +0000)]
Auto merge of #13544 - HKalbasi:patch-2, r=Veykril

Add rustbot features related to PR state labels

It makes rustbot add `S-waiting-on-review` to every new PR, and ``@rustbot` author` and ``@rustbot` review` commands working.

19 months agoAdd rustbot features related to PR state labels
HKalbasi [Fri, 4 Nov 2022 11:57:50 +0000 (15:27 +0330)]
Add rustbot features related to PR state labels

19 months agoClarify what commands are debug commands in VSCode
Lukas Wirth [Thu, 3 Nov 2022 20:36:14 +0000 (21:36 +0100)]
Clarify what commands are debug commands in VSCode

19 months agoAuto merge of #13456 - emilio:scip-local-symbol, r=Veykril
bors [Thu, 3 Nov 2022 13:58:36 +0000 (13:58 +0000)]
Auto merge of #13456 - emilio:scip-local-symbol, r=Veykril

scip: Generate symbols for local crates.

Consider something like:

```
// a.rs
pub struct Foo { .. } // Foo is "local 1"

fn something() {
    crate::b::Bar::new() // Bar is "local 1", but of "b.rs"
}

// b.rs
pub struct Bar { .. } // "local 1"
```

Without this there's no way to disambiguate whether "local 1" references "Bar" or "Foo".

19 months agoAuto merge of #13537 - lnicola:ovsx-fail, r=lnicola
bors [Thu, 3 Nov 2022 13:43:38 +0000 (13:43 +0000)]
Auto merge of #13537 - lnicola:ovsx-fail, r=lnicola

minor: Allow ovsx publishing to fail

19 months agoAllow ovsx publishing to fail
Laurențiu Nicola [Thu, 3 Nov 2022 13:42:55 +0000 (15:42 +0200)]
Allow ovsx publishing to fail

19 months agoAuto merge of #13530 - lnicola:bump-ovsx, r=lnicola
bors [Wed, 2 Nov 2022 13:11:55 +0000 (13:11 +0000)]
Auto merge of #13530 - lnicola:bump-ovsx, r=lnicola

minor: Bump ovsx

CC https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/issues/1330#note_1033611

19 months agoBump ovsx
Laurențiu Nicola [Wed, 2 Nov 2022 12:50:04 +0000 (14:50 +0200)]
Bump ovsx

19 months agoAuto merge of #13527 - unexge:use-let-else-stmt-in-convert-to-guarded-return-assist...
bors [Wed, 2 Nov 2022 11:06:54 +0000 (11:06 +0000)]
Auto merge of #13527 - unexge:use-let-else-stmt-in-convert-to-guarded-return-assist, r=jonas-schievink

Use let-else statements in `Convert to guarded return` assist

Follow up for https://github.com/rust-lang/rust-analyzer/pull/13516, addresses remaining part of https://github.com/rust-lang/rust-analyzer/issues/13254#issuecomment-1250408527

19 months agoAuto merge of #13359 - feniljain:feat-must-use-option, r=Veykril
bors [Wed, 2 Nov 2022 10:50:08 +0000 (10:50 +0000)]
Auto merge of #13359 - feniljain:feat-must-use-option, r=Veykril

feat: add config for inserting must_use in `generate_enum_as_method`

Should fix #13312

Didn't add a test because I was not sure on how to add test for a specific configuration option, tried to look for the usages for other `AssistConfig` variants but couldn't find any in `tests`. If there is a way to test this, do point me towards it.

I tried to extract the formatting string as a common `template_string` and only have if-else for that, but it didn't compile :(

Also it seems these tests are failing:

```
test config::tests::generate_config_documentation ... FAILED
test config::tests::generate_package_json_config ... FAILED
```

Can you also point me to how to correct these 😅  ( I guess there is some command to automatically generate these? )

19 months agofix: indentation after inserting `#must_use`
feniljain [Wed, 2 Nov 2022 10:39:12 +0000 (16:09 +0530)]
fix: indentation after inserting `#must_use`

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
19 months agoAuto merge of #13517 - feniljain:fix_completions, r=Veykril
bors [Wed, 2 Nov 2022 10:15:18 +0000 (10:15 +0000)]
Auto merge of #13517 - feniljain:fix_completions, r=Veykril

fix: make custom expr prefix completions to understand refs

Possible fix of #7929

While reviewing the postfix completion code I saw that while calling `add_custom_postfix_completions` we were doing it under the part where reference was not taken into consideration, but as we are only adding postfix completions with `Expr` scope ( [source](https://github.com/rust-lang/rust-analyzer/blob/ba28e19b7838e3ad4223ae82d074dc3950ef1548/crates/ide-completion/src/completions/postfix.rs#L272) )

I shifted the `add_custom_postfix_completions` call to part where references are considered

I am not sure if this is the correct fix or I am understanding the problem exactly but this small move seemed to have fixed the issue :)

19 months agoUse let-else statements in `Convert to guarded return` assist
unexge [Tue, 1 Nov 2022 23:02:10 +0000 (23:02 +0000)]
Use let-else statements in `Convert to guarded return` assist

19 months agoAuto merge of #13525 - jonas-schievink:generic-call-signature, r=jonas-schievink
bors [Tue, 1 Nov 2022 17:01:07 +0000 (17:01 +0000)]
Auto merge of #13525 - jonas-schievink:generic-call-signature, r=jonas-schievink

feat: show signature help when calling generic types implementing `FnOnce`

This queries chalk for the `FnOnce` impl of callees and takes argument and return types from there, making generic `Callable`s available to the IDE. This makes signature help work for them, and potentially allows other features to take generic callables into account in the future.

19 months agoAuto merge of #13508 - koka831:fix/13492, r=jonas-schievink
bors [Tue, 1 Nov 2022 16:38:40 +0000 (16:38 +0000)]
Auto merge of #13508 - koka831:fix/13492, r=jonas-schievink

fix: async trait method for `unnecessary_async`

Fix https://github.com/rust-lang/rust-analyzer/issues/13492

19 months agoAuto merge of #13516 - unexge:add-convert-match-to-let-else-assist, r=jonas-schievink
bors [Tue, 1 Nov 2022 16:24:15 +0000 (16:24 +0000)]
Auto merge of #13516 - unexge:add-convert-match-to-let-else-assist, r=jonas-schievink

Add `Convert match to let-else` assist

Closes https://github.com/rust-lang/rust-analyzer/issues/13254

19 months agoFix doc test
Jonas Schievink [Tue, 1 Nov 2022 16:23:32 +0000 (17:23 +0100)]
Fix doc test

19 months agoRevert "Record diverging match arms in `InferenceResult`"
Jonas Schievink [Tue, 1 Nov 2022 16:18:17 +0000 (17:18 +0100)]
Revert "Record diverging match arms in `InferenceResult`"

This reverts commit 319611b7382fc4c84170519dade68f4f558a44b1.

19 months agoImport `option` in the tests
Jonas Schievink [Tue, 1 Nov 2022 16:18:13 +0000 (17:18 +0100)]
Import `option` in the tests

19 months agoCreate `Callable`s for generic types implementing `FnOnce`
Jonas Schievink [Tue, 1 Nov 2022 15:33:59 +0000 (16:33 +0100)]
Create `Callable`s for generic types implementing `FnOnce`

19 months agoAuto merge of #13523 - lowr:fix/adjust-expectation-for-if, r=lnicola
bors [Mon, 31 Oct 2022 15:39:20 +0000 (15:39 +0000)]
Auto merge of #13523 - lowr:fix/adjust-expectation-for-if, r=lnicola

fix: disregard type variable expectation for if expressions

Fixes #13522

As [the comment](https://github.com/rust-lang/rust-analyzer/blob/8142d1f606dc2e52b1d2b8992671e2bd73379f28/crates/hir-ty/src/infer.rs#L1087-L1090) on `Expectation::adjust_for_branches` explains:

> If the expected type is just a type variable, then don't use an expected type. Otherwise, we might write parts of the type when checking the 'then' block which are incompatible with the 'else' branch.

Note that we already use it in match expressions. I've added tests for them too nevertheless.

19 months agofix: disregard type variable expectation for if expressions
Ryo Yoshida [Mon, 31 Oct 2022 15:15:05 +0000 (00:15 +0900)]
fix: disregard type variable expectation for if expressions

19 months agoAuto merge of #13445 - notJoon:modify-dead-links, r=lnicola
bors [Mon, 31 Oct 2022 06:55:11 +0000 (06:55 +0000)]
Auto merge of #13445 - notJoon:modify-dead-links, r=lnicola

fix) update broken links in guide.md

Hi, I Just fixed some broken links in `guide.md`.

In most cases, it is not connected by an old version (expecially `guide-2019-01`) of the link, so I made some modifications.

Thanks for your time :)

20 months agofix: make custom expr prefix completions to understand refs
feniljain [Sun, 30 Oct 2022 09:25:44 +0000 (14:55 +0530)]
fix: make custom expr prefix completions to understand refs

20 months agoUpdate auto generated tests
unexge [Sat, 29 Oct 2022 23:00:53 +0000 (00:00 +0100)]
Update auto generated tests

20 months agoAdd `Convert match to let-else` assist
unexge [Sat, 29 Oct 2022 22:45:13 +0000 (23:45 +0100)]
Add `Convert match to let-else` assist

20 months agoRecord diverging match arms in `InferenceResult`
unexge [Sat, 29 Oct 2022 22:44:34 +0000 (23:44 +0100)]
Record diverging match arms in `InferenceResult`

20 months agoSimplify the procedure
koka [Sat, 29 Oct 2022 15:57:42 +0000 (00:57 +0900)]
Simplify the procedure

fix: remove unused import

20 months agoAuto merge of #13505 - lowr:feat/gats, r=flodiebold
bors [Sat, 29 Oct 2022 08:54:14 +0000 (08:54 +0000)]
Auto merge of #13505 - lowr:feat/gats, r=flodiebold

Clean up tests and add documentation for GATs related stuff

This is a follow-up PR for #13494.

- addresses https://github.com/rust-lang/rust-analyzer/pull/13494#discussion_r1006774897
- documents the ordering constraint on `Binders` and `Substitution` (which is not really follow-up for the previous PR, but it was introduced to support GATs and I strongly feel it's worth it)

20 months agoAuto merge of #13513 - Veykril:vscode-workspace-changes, r=Veykril
bors [Fri, 28 Oct 2022 23:41:22 +0000 (23:41 +0000)]
Auto merge of #13513 - Veykril:vscode-workspace-changes, r=Veykril

Properly handle vscode workspace changes

20 months agoProperly handle vscode workspace changes
Lukas Wirth [Fri, 28 Oct 2022 23:28:32 +0000 (01:28 +0200)]
Properly handle vscode workspace changes

20 months agoAuto merge of #13512 - Veykril:startup-commands, r=Veykril
bors [Fri, 28 Oct 2022 22:51:52 +0000 (22:51 +0000)]
Auto merge of #13512 - Veykril:startup-commands, r=Veykril

Always set up VSCode commands

20 months agoAlways set up VSCode commands
Lukas Wirth [Fri, 28 Oct 2022 22:44:37 +0000 (00:44 +0200)]
Always set up VSCode commands

20 months agoAuto merge of #13510 - Veykril:status-click, r=Veykril
bors [Fri, 28 Oct 2022 21:12:27 +0000 (21:12 +0000)]
Auto merge of #13510 - Veykril:status-click, r=Veykril

feat: Clicking the status bar item stops and starts the server

20 months agofeat: Clicking the status bar item stops and starts the server
Lukas Wirth [Fri, 28 Oct 2022 21:10:10 +0000 (23:10 +0200)]
feat: Clicking the status bar item stops and starts the server

20 months agofix: async trait method for `unnecessary_async`
koka [Fri, 28 Oct 2022 16:14:44 +0000 (01:14 +0900)]
fix: async trait method for `unnecessary_async`

20 months agoDocument the ordering constraint on `Binders` and `Substitution`
Ryo Yoshida [Fri, 28 Oct 2022 12:17:16 +0000 (21:17 +0900)]
Document the ordering constraint on `Binders` and `Substitution`

20 months agoReplace expect test for GATs with `check_types`
Ryo Yoshida [Fri, 28 Oct 2022 11:33:19 +0000 (20:33 +0900)]
Replace expect test for GATs with `check_types`

20 months agoAuto merge of #13496 - rust-lang:lnicola-patch-1, r=jonas-schievink
bors [Thu, 27 Oct 2022 13:37:45 +0000 (13:37 +0000)]
Auto merge of #13496 - rust-lang:lnicola-patch-1, r=jonas-schievink

internal: Clarify feature policy

CC #13495

20 months agoClarify feature policy
Laurențiu Nicola [Thu, 27 Oct 2022 13:35:07 +0000 (16:35 +0300)]
Clarify feature policy

20 months agoAuto merge of #13494 - lowr:feat/gats, r=flodiebold
bors [Thu, 27 Oct 2022 12:37:50 +0000 (12:37 +0000)]
Auto merge of #13494 - lowr:feat/gats, r=flodiebold

feat: type inference for generic associated types

This PR implements type inference for generic associated types. Basically, this PR lowers generic arguments for associated types in valid places and creates `Substitution`s for them.

I focused on the inference for correct Rust programs, so there are cases where we *accidentally* manage to infer things that are actually invalid (which would then be reported by flycheck so I deem them non-fatal). See the following tests and FIXME notes on them: `gats_with_dyn`, `gats_with_impl_trait`.

The added tests are rather arbitrary. Let me know if there are cases I'm missing or I should add.

Closes #9673

20 months agoLower generic arguments for GATs in associated type bindings
Ryo Yoshida [Thu, 27 Oct 2022 08:11:16 +0000 (17:11 +0900)]
Lower generic arguments for GATs in associated type bindings

20 months agoCollect generic arguments in associated type bindings
Ryo Yoshida [Wed, 26 Oct 2022 13:52:04 +0000 (22:52 +0900)]
Collect generic arguments in associated type bindings

20 months agoLower generic arguments for associated types in paths
Ryo Yoshida [Wed, 26 Oct 2022 08:21:08 +0000 (17:21 +0900)]
Lower generic arguments for associated types in paths

20 months agoDisplay generic arguments for associated types
Ryo Yoshida [Thu, 27 Oct 2022 08:05:22 +0000 (17:05 +0900)]
Display generic arguments for associated types

20 months agorefactor: remove obsolete code
Ryo Yoshida [Wed, 26 Oct 2022 07:41:11 +0000 (16:41 +0900)]
refactor: remove obsolete code

20 months agoAuto merge of #13484 - lnicola:position-encoding, r=lnicola
bors [Wed, 26 Oct 2022 18:12:47 +0000 (18:12 +0000)]
Auto merge of #13484 - lnicola:position-encoding, r=lnicola

Switch to upstream `positionEncoding`

Closes #13481

This drops support for the custom extension, but that's probably fine.

Draft because it's not tested yet.

20 months agoAuto merge of #13475 - lowr:fix/lookup-impl-method-trait-ref, r=flodiebold
bors [Wed, 26 Oct 2022 12:06:26 +0000 (12:06 +0000)]
Auto merge of #13475 - lowr:fix/lookup-impl-method-trait-ref, r=flodiebold

fix: Test all generic args for trait when finding matching impl

Addresses https://github.com/rust-lang/rust-analyzer/pull/13463#issuecomment-1287816680

When finding matching impl for a trait method, we've been testing the unifiability of self type. However, there can be multiple impl of a trait for the same type with different generic arguments for the trait. This patch takes it into account and tests the unifiability of all type arguments for the trait (the first being the self type) thus enables rust-analyzer to find the correct impl even in such cases.

20 months agoTest all generic args for trait when finding matching impl
Ryo Yoshida [Tue, 25 Oct 2022 12:20:16 +0000 (21:20 +0900)]
Test all generic args for trait when finding matching impl

20 months agoPin lsp-types
Laurențiu Nicola [Tue, 25 Oct 2022 12:03:35 +0000 (15:03 +0300)]
Pin lsp-types

20 months agoSwitch to upstream positionEncoding
Laurențiu Nicola [Tue, 25 Oct 2022 11:43:26 +0000 (14:43 +0300)]
Switch to upstream positionEncoding

20 months agorefactor: remove repetitive string interpolation and doc changes
feniljain [Mon, 24 Oct 2022 15:36:32 +0000 (21:06 +0530)]
refactor: remove repetitive string interpolation and doc changes

20 months agoLet `InferenceTable::unify()` relate `Zip` values
Ryo Yoshida [Mon, 24 Oct 2022 14:28:53 +0000 (23:28 +0900)]
Let `InferenceTable::unify()` relate `Zip` values

20 months agoAuto merge of #13478 - Veykril:fix-flycheck, r=Veykril
bors [Mon, 24 Oct 2022 14:08:45 +0000 (14:08 +0000)]
Auto merge of #13478 - Veykril:fix-flycheck, r=Veykril

fix: Fix standard flycheck command not being executed in the workspace it is being invoked for

Fixes https://github.com/rust-lang/rust-analyzer/issues/13477

20 months agofix: Fix standard flycheck command not being executed in the workspace it is being...
Lukas Wirth [Mon, 24 Oct 2022 14:07:42 +0000 (16:07 +0200)]
fix: Fix standard flycheck command not being executed in the workspace it is being invoked for

20 months agoAuto merge of #13476 - Veykril:prefer-shutdown, r=Veykril
bors [Mon, 24 Oct 2022 13:08:22 +0000 (13:08 +0000)]
Auto merge of #13476 - Veykril:prefer-shutdown, r=Veykril

fix: Don't respond with an error when requesting a shutdown while starting

20 months agofix: Don't respond with an error when requesting a shutdown while starting
Lukas Wirth [Mon, 24 Oct 2022 12:56:58 +0000 (14:56 +0200)]
fix: Don't respond with an error when requesting a shutdown while starting

20 months agoRefactor: unwrap `Option` once in the beginning of closure
Ryo Yoshida [Mon, 24 Oct 2022 10:38:16 +0000 (19:38 +0900)]
Refactor: unwrap `Option` once in the beginning of closure

20 months agofeat: add config for inserting must_use in `generate_enum_as_method`
feniljain [Thu, 6 Oct 2022 18:41:02 +0000 (00:11 +0530)]
feat: add config for inserting must_use in `generate_enum_as_method`

20 months agoAuto merge of #13471 - Veykril:invoc-strategy-once, r=Veykril
bors [Sun, 23 Oct 2022 16:02:07 +0000 (16:02 +0000)]
Auto merge of #13471 - Veykril:invoc-strategy-once, r=Veykril

Handle multiple projects sharing dependency correctly in `once` strategy

20 months agoHandle multiple projects sharing dependency correctly in `once` strategy
Lukas Wirth [Sun, 23 Oct 2022 16:01:35 +0000 (18:01 +0200)]
Handle multiple projects sharing dependency correctly in `once` strategy

20 months agoAuto merge of #13466 - Veykril:invocation-location, r=Veykril
bors [Sat, 22 Oct 2022 21:52:04 +0000 (21:52 +0000)]
Auto merge of #13466 - Veykril:invocation-location, r=Veykril

Implement invocation location config

This allows setting the working directory for build-scripts on flycheck
Complements https://github.com/rust-lang/rust-analyzer/pull/13128

This will be followed up by one more PR that adds a few simple interpolation vars for `overrideCommand`, with that we should cover the needs for most build systems I believe.

20 months agoImplement invocation location config
Lukas Wirth [Sat, 22 Oct 2022 21:02:59 +0000 (23:02 +0200)]
Implement invocation location config

20 months agoide: Generate monikers for local crates.
Emilio Cobos Álvarez [Sat, 22 Oct 2022 13:10:03 +0000 (15:10 +0200)]
ide: Generate monikers for local crates.

20 months agoAuto merge of #13463 - lowr:fix/builtin-derive-with-const-generics, r=Veykril
bors [Sat, 22 Oct 2022 15:49:00 +0000 (15:49 +0000)]
Auto merge of #13463 - lowr:fix/builtin-derive-with-const-generics, r=Veykril

Support const generics for builtin derive macro

Fixes #13121

We have been treating every generic parameter as type parameter during builtin derive macro expansion. This patch adds support for const generics in such expansions.

20 months agoSupport const generics for builtin derive macro
Ryo Yoshida [Sat, 22 Oct 2022 08:49:38 +0000 (17:49 +0900)]
Support const generics for builtin derive macro

20 months agoAuto merge of #13460 - emilio:scip-cleanups, r=Veykril
bors [Sat, 22 Oct 2022 13:46:23 +0000 (13:46 +0000)]
Auto merge of #13460 - emilio:scip-cleanups, r=Veykril

scip: minor clean-ups

Avoids a couple redundant hash map lookups and so.

20 months agoAuto merge of #13461 - emilio:ide-cleanup-continue, r=Veykril
bors [Sat, 22 Oct 2022 13:29:58 +0000 (13:29 +0000)]
Auto merge of #13461 - emilio:ide-cleanup-continue, r=Veykril

ide: Remove unnecessary continue.

Just a minor clean-up I found while going through the code.

20 months agoscip: Rewrite tests to be closer to what we actually do.
Emilio Cobos Álvarez [Fri, 21 Oct 2022 20:04:43 +0000 (22:04 +0200)]
scip: Rewrite tests to be closer to what we actually do.

It's also less code.

20 months agoide: Remove unnecessary continue.
Emilio Cobos Álvarez [Sat, 22 Oct 2022 12:04:47 +0000 (14:04 +0200)]
ide: Remove unnecessary continue.

20 months agoscip: minor clean-ups
Emilio Cobos Álvarez [Sat, 22 Oct 2022 11:50:02 +0000 (13:50 +0200)]
scip: minor clean-ups

Avoids a couple redundant hash map lookups and so.

20 months agoaddressed https://github.com/rust-lang/rust-analyzer/issues/12536
Justin Mott [Fri, 21 Oct 2022 17:28:59 +0000 (13:28 -0400)]
addressed https://github.com/rust-lang/rust-analyzer/issues/12536

20 months agoAuto merge of #13453 - Veykril:disabled-commands, r=Veykril
bors [Fri, 21 Oct 2022 14:05:25 +0000 (14:05 +0000)]
Auto merge of #13453 - Veykril:disabled-commands, r=Veykril

internal: Properly handle commands in the VSCode client when the server is stopped

20 months agointernal: Properly handle commands in the VSCode client when the server is stopped
Lukas Wirth [Fri, 21 Oct 2022 14:00:43 +0000 (16:00 +0200)]
internal: Properly handle commands in the VSCode client when the server is stopped

20 months agoAuto merge of #13451 - Veykril:lang-config, r=Veykril
bors [Thu, 20 Oct 2022 19:15:30 +0000 (19:15 +0000)]
Auto merge of #13451 - Veykril:lang-config, r=Veykril

internal: Properly handle language configuration config changes

20 months agointernal: Properly handle language configuration config changes
Lukas Wirth [Thu, 20 Oct 2022 19:12:58 +0000 (21:12 +0200)]
internal: Properly handle language configuration config changes

20 months agoAuto merge of #13447 - Veykril:didsavedoc-block, r=Veykril
bors [Thu, 20 Oct 2022 18:13:09 +0000 (18:13 +0000)]
Auto merge of #13447 - Veykril:didsavedoc-block, r=Veykril

fix: Fix DidSaveDocument requests blocking the server on startup

Follow up to https://github.com/rust-lang/rust-analyzer/pull/13428
Fixes https://github.com/rust-lang/rust-analyzer/issues/13434

20 months agoAuto merge of #13448 - yotamofek:python-ext-polyfill-workaround, r=Veykril
bors [Thu, 20 Oct 2022 17:59:14 +0000 (17:59 +0000)]
Auto merge of #13448 - yotamofek:python-ext-polyfill-workaround, r=Veykril

Workaround the python vscode extension's polyfill

Fixes #13442

`String.replaceAll` and `String.replace` behave the same when given a (/g-flagged) Regex, so fix is very simple.

20 months agoWorkaround the python vscode extension's polyfill
Yotam Ofek [Thu, 20 Oct 2022 17:56:51 +0000 (17:56 +0000)]
Workaround the python vscode extension's polyfill

20 months agofix: Fix DidSaveDocument requests blocking the server on startup
Lukas Wirth [Thu, 20 Oct 2022 17:28:28 +0000 (19:28 +0200)]
fix: Fix DidSaveDocument requests blocking the server on startup

20 months agofix broken links in guide.md
not_joon [Thu, 20 Oct 2022 13:06:00 +0000 (22:06 +0900)]
fix broken links in guide.md

20 months agoAuto merge of #13365 - feniljain:master, r=Veykril
bors [Thu, 20 Oct 2022 12:07:28 +0000 (12:07 +0000)]
Auto merge of #13365 - feniljain:master, r=Veykril

feat: add multiple getters mode in `generate_getter`

This commit adds two modes to generate_getter action.
First, the plain old working on single fields.
Second, working on a selected range of fields.

Should partially solve #13246
If this gets approved will create a separate PR for setters version of the same

### Points to help in review:

- `generate_getter_from_record_info` contains code which is mostly taken from assist before refactor
- Same goes for `parse_record_fields`
- There are changes in other assists, as one of the methods in utils named `find_struct_impl` is changed, before it used to accept a single `fn_name`, now it takes a list of function names to check against. All old impls are updated to create a small list to pass their single element.

### Assumptions:

- If any of the fields have an implementation, the action will quit.

20 months agofeat: add multiple getters mode in `generate_getter`
feniljain [Fri, 7 Oct 2022 19:24:57 +0000 (00:54 +0530)]
feat: add multiple getters mode in `generate_getter`

This commit adds two modes to generate_getter action.
First, the plain old working on single fields.
Second, working on a selected range of fields.

20 months agoAuto merge of #13444 - Veykril:rethrow-err, r=Veykril
bors [Thu, 20 Oct 2022 09:34:06 +0000 (09:34 +0000)]
Auto merge of #13444 - Veykril:rethrow-err, r=Veykril

fix: Don't catch the server activation error

We are are rethrowing and showing errors higher up in the call stack already. This just ate the error hiding the stacktrace unnecessarily.

20 months agoDon't catch the server activation error
Lukas Wirth [Thu, 20 Oct 2022 09:32:02 +0000 (11:32 +0200)]
Don't catch the server activation error

20 months agoAuto merge of #13128 - Veykril:invocation-strategy, r=Veykril
bors [Wed, 19 Oct 2022 21:53:19 +0000 (21:53 +0000)]
Auto merge of #13128 - Veykril:invocation-strategy, r=Veykril

Implement invocation strategy config

Fixes https://github.com/rust-lang/rust-analyzer/issues/10793

This allows to change how we run build scripts (and `checkOnSave`), exposing two configs:
- `once`: run the specified command once in the project root (the working dir of the server)
- `per_workspace`: run the specified command per workspace in the corresponding workspace

This also applies to `checkOnSave` likewise, though `once_in_root` is useless there currently, due to https://github.com/rust-lang/cargo/issues/11007

20 months agoRemove simplistic interpolation for manifest-path
Lukas Wirth [Wed, 19 Oct 2022 21:34:36 +0000 (23:34 +0200)]
Remove simplistic interpolation for manifest-path

20 months ago{manifest-path} interpolation
Lukas Wirth [Mon, 26 Sep 2022 13:58:55 +0000 (15:58 +0200)]
{manifest-path} interpolation

20 months agoUse correct invocation strategy config for checkOnSave
Lukas Wirth [Thu, 15 Sep 2022 11:35:46 +0000 (13:35 +0200)]
Use correct invocation strategy config for checkOnSave

20 months agoImplement invocation strategy config for checkOnSave
Lukas Wirth [Thu, 15 Sep 2022 11:28:09 +0000 (13:28 +0200)]
Implement invocation strategy config for checkOnSave

Note that due to how cargo works, none of the modes currently work for r-a

20 months agoImplement invocation strategy config for build scripts
Lukas Wirth [Sat, 27 Aug 2022 16:28:09 +0000 (18:28 +0200)]
Implement invocation strategy config for build scripts

20 months agoAuto merge of #13441 - Veykril:sysroot-logging, r=Veykril
bors [Wed, 19 Oct 2022 20:27:09 +0000 (20:27 +0000)]
Auto merge of #13441 - Veykril:sysroot-logging, r=Veykril

Add some sysroot logging