]> git.lizzy.rs Git - rust.git/log
rust.git
3 years agoMerge #6335
bors[bot] [Fri, 23 Oct 2020 13:19:09 +0000 (13:19 +0000)]
Merge #6335

6335: Fix panic context r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
3 years agoFix panic context
Aleksey Kladov [Fri, 23 Oct 2020 13:18:33 +0000 (15:18 +0200)]
Fix panic context

3 years agoMerge #6324
bors[bot] [Fri, 23 Oct 2020 10:38:30 +0000 (10:38 +0000)]
Merge #6324

6324: Improve #[cfg] diagnostics r=jonas-schievink a=jonas-schievink

Unfortunately I ran into https://github.com/rust-analyzer/rust-analyzer/issues/4058 while testing this on https://github.com/nrf-rs/nrf-hal/, so I didn't see much of it in action yet, but it does seem to work.

Co-authored-by: Jonas Schievink <jonas.schievink@ferrous-systems.com>
Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
3 years agocfg: move tests to separate file
Jonas Schievink [Fri, 23 Oct 2020 10:14:58 +0000 (12:14 +0200)]
cfg: move tests to separate file

that way we don't have to re-check the entire project when a test is
changed

3 years agoReorder items
Jonas Schievink [Fri, 23 Oct 2020 10:10:22 +0000 (12:10 +0200)]
Reorder items

3 years agoUse format_to
Jonas Schievink [Fri, 23 Oct 2020 10:08:55 +0000 (12:08 +0200)]
Use format_to

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
3 years agoMerge #6098
bors[bot] [Thu, 22 Oct 2020 20:46:24 +0000 (20:46 +0000)]
Merge #6098

6098: Insert ref for completions r=adamrk a=adamrk

Follow up to https://github.com/rust-analyzer/rust-analyzer/pull/5846. When we have a local in scope which needs a ref or mutable ref to match the name and type of the active in the completion context then a new completion item with `&` or `&mut ` is inserted. E.g.
```rust
fn foo(arg: &i32){};
fn main() {
    let arg = 1_i32;
    foo(a<|>)
}
```
now offers `&arg` as a completion option with the highest score.

Co-authored-by: adamrk <ark.email@gmail.com>
3 years agoInsert ref for completions
adamrk [Tue, 29 Sep 2020 20:24:56 +0000 (22:24 +0200)]
Insert ref for completions

3 years agoMerge #6325 #6327
bors[bot] [Thu, 22 Oct 2020 18:15:48 +0000 (18:15 +0000)]
Merge #6325 #6327

6325: Add generated diagnostic docs to the manual r=matklad a=flodiebold

It seemed that we're not actually including the generated diagnostic docs anywhere yet? So I added something to the manual. This is completely untested though.

6327: Update debugging.md r=matklad a=stanciuadrian

`on_task` is no longer there.
I have used `on_request` instead.

Co-authored-by: Florian Diebold <flodiebold@gmail.com>
Co-authored-by: Adrian Stanciu <stanciu.adrian@gmail.com>
3 years agoMerge #6326
bors[bot] [Thu, 22 Oct 2020 18:09:43 +0000 (18:09 +0000)]
Merge #6326

6326: hide paramater inlay hints for cloned vars if applicable r=SomeoneToIgnore a=Veykril

This causes `foo.clone()` parameters to be handled as if they were just `foo` parameters for inlay hint logic.

Fixes #6315

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
3 years agoUpdate crates/cfg/src/cfg_expr.rs
Jonas Schievink [Thu, 22 Oct 2020 18:08:27 +0000 (20:08 +0200)]
Update crates/cfg/src/cfg_expr.rs

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
3 years agoUpdate debugging.md
Adrian Stanciu [Thu, 22 Oct 2020 18:04:09 +0000 (21:04 +0300)]
Update debugging.md

3 years agoHide paramater inlay hints for cloned vars if applicable
Lukas Wirth [Thu, 22 Oct 2020 17:42:39 +0000 (19:42 +0200)]
Hide paramater inlay hints for cloned vars if applicable

3 years agoAdd generated diagnostic docs to the manual
Florian Diebold [Thu, 22 Oct 2020 17:42:01 +0000 (19:42 +0200)]
Add generated diagnostic docs to the manual

3 years agoEmit better #[cfg] diagnostics
Jonas Schievink [Thu, 22 Oct 2020 17:19:18 +0000 (19:19 +0200)]
Emit better #[cfg] diagnostics

3 years agoFix typo
Jonas Schievink [Thu, 22 Oct 2020 17:19:05 +0000 (19:19 +0200)]
Fix typo

3 years agoImplement DNF-based `#[cfg]` introspection
Jonas Schievink [Wed, 21 Oct 2020 17:54:04 +0000 (19:54 +0200)]
Implement DNF-based `#[cfg]` introspection

3 years agoMerge #6319
bors[bot] [Thu, 22 Oct 2020 14:24:10 +0000 (14:24 +0000)]
Merge #6319

6319: Properly identify camel cased acronyms as UpperCamelCase r=popzxc a=ArifRoktim

This closes #6305.

Co-authored-by: Arif Roktim <arifrroktim@gmail.com>
3 years agoMerge #6320 #6321
bors[bot] [Thu, 22 Oct 2020 12:04:50 +0000 (12:04 +0000)]
Merge #6320 #6321

6320: Textmate grammar: prevent line comments from breaking block comments (closes #6281) r=matklad a=dustypomerleau

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

Previously, line comments were able to break block comments by essentially commenting out the closing `*/`, resulting in a never-ending comment. This PR splits block comments into a separate repository group to fix this problem.

Since the comment scopes also include ignored parameters and inferred types, I've added the change proposed by @bnjjj in https://github.com/rust-analyzer/rust-analyzer/pull/6317, in order to close https://github.com/rust-analyzer/rust-analyzer/issues/6311 as well.

6321: Fix opening module documentation opening parent documentation instead r=matklad a=zacps

The whole path/URL joining code is kind of ugly which is what led to
this, but at the same time I don't really want to rewrite it right
now...

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

Co-authored-by: Dusty Pomerleau <dustypomerleau@users.noreply.github.com>
Co-authored-by: Zac Pullar-Strecker <zacmps@gmail.com>
3 years agoMerge #6314
bors[bot] [Thu, 22 Oct 2020 11:58:11 +0000 (11:58 +0000)]
Merge #6314

6314: generate assist respect cfg attributes  r=matklad a=bnjjj

close #6312

Co-authored-by: Benjamin Coenen <5719034+bnjjj@users.noreply.github.com>
3 years agogenerate_impl assist respect cfg attributes #6312
Benjamin Coenen [Wed, 21 Oct 2020 19:29:15 +0000 (21:29 +0200)]
generate_impl assist respect cfg attributes #6312

Signed-off-by: Benjamin Coenen <5719034+bnjjj@users.noreply.github.com>
3 years agoFix opening module documentation opening parent documentation instead
Zac Pullar-Strecker [Thu, 22 Oct 2020 04:31:25 +0000 (17:31 +1300)]
Fix opening module documentation opening parent documentation instead

The whole path/URL joining code is kind of ugly which is what led to
this, but at the same time I don't really want to rewrite it right
now...

3 years agofix: prevent line comments inside block comments
Dusty Pomerleau [Thu, 22 Oct 2020 02:03:04 +0000 (13:03 +1100)]
fix: prevent line comments inside block comments

- prevent line comments inside block comments
- prevent underscore-prefixed functions and macros from receiving comment scope

3 years agoProperly identify camel cased acronyms as UpperCamelCase
Arif Roktim [Wed, 21 Oct 2020 20:56:20 +0000 (16:56 -0400)]
Properly identify camel cased acronyms as UpperCamelCase

3 years agoMerge #6307
bors[bot] [Wed, 21 Oct 2020 20:09:11 +0000 (20:09 +0000)]
Merge #6307

6307: Add whitelist of safe intrinsics r=frazar a=frazar

This PR should fix #5996, where intrinsic operations where all marked as unsafe.

I'm rather new to this codebase, so I might be doing something *very* wrong. Please forgive me!

In particular, I'm not sure how to "check that we are in extern `rust-intrinsics`" as mentioned [in this comment](https://github.com/rust-analyzer/rust-analyzer/issues/5996#issuecomment-709234802).

Co-authored-by: Francesco Zardi <frazar@users.noreply.github.com>
3 years agoRefactor is_intrinsic_fn_unsafe() and make it private
Francesco Zardi [Wed, 21 Oct 2020 19:53:37 +0000 (21:53 +0200)]
Refactor is_intrinsic_fn_unsafe() and make it private

3 years agoMove safe intrinsic tests
Francesco Zardi [Wed, 21 Oct 2020 19:53:05 +0000 (21:53 +0200)]
Move safe intrinsic tests

3 years agoFix typo in comment
Francesco Zardi [Wed, 21 Oct 2020 19:51:53 +0000 (21:51 +0200)]
Fix typo in comment

3 years agoSimplify cfg representation
Jonas Schievink [Wed, 21 Oct 2020 11:57:12 +0000 (13:57 +0200)]
Simplify cfg representation

3 years agoMerge #6302
bors[bot] [Wed, 21 Oct 2020 08:39:03 +0000 (08:39 +0000)]
Merge #6302

6302: Textmate grammar: fix raw string highlighting r=matklad a=dustypomerleau

1. Fixes the raw string highlighting issue noted by @matklad in https://github.com/rust-analyzer/rust-analyzer/pull/6275.
2. Improves raw string highlighting by requiring the number of surrounding `#` to match.

Co-authored-by: Dusty Pomerleau <dustypomerleau@users.noreply.github.com>
3 years agoAdd whitelist of safe intrinsics
Francesco Zardi [Wed, 21 Oct 2020 07:06:05 +0000 (09:06 +0200)]
Add whitelist of safe intrinsics

3 years agofix: require matching hash quantities for raw strings
Dusty Pomerleau [Tue, 20 Oct 2020 23:38:31 +0000 (10:38 +1100)]
fix: require matching hash quantities for raw strings

3 years agoMerge #6270
bors[bot] [Tue, 20 Oct 2020 22:26:31 +0000 (22:26 +0000)]
Merge #6270

6270: Update crates r=matklad a=kjeremy

This brings in a number of new dependencies though.

Co-authored-by: Jeremy Kolb <kjeremy@gmail.com>
3 years agoUpdate crates
Jeremy Kolb [Sat, 17 Oct 2020 18:20:52 +0000 (14:20 -0400)]
Update crates

This brings in a number of new dependencies though.

3 years agoMerge #6259
bors[bot] [Tue, 20 Oct 2020 20:49:17 +0000 (20:49 +0000)]
Merge #6259

6259: allow xtask install --client[=CLIENT] to specify client r=Emilgardis a=Emilgardis

Co-authored-by: Emil Gardström <emil.gardstrom@gmail.com>
3 years agorename flag --client-code to --client on xtask install
Emil Gardström [Tue, 20 Oct 2020 20:37:02 +0000 (22:37 +0200)]
rename flag --client-code to --client on xtask install

3 years agoMerge #6109
bors[bot] [Tue, 20 Oct 2020 19:43:44 +0000 (19:43 +0000)]
Merge #6109

6109: add completions for clippy lint in attributes r=bnjjj a=bnjjj

Co-authored-by: Benjamin Coenen <5719034+bnjjj@users.noreply.github.com>
3 years agoadd completions for clippy lint in attributes
Benjamin Coenen [Tue, 20 Oct 2020 19:29:31 +0000 (21:29 +0200)]
add completions for clippy lint in attributes

Signed-off-by: Benjamin Coenen <5719034+bnjjj@users.noreply.github.com>
3 years agoMerge #6256
bors[bot] [Tue, 20 Oct 2020 19:03:25 +0000 (19:03 +0000)]
Merge #6256

6256: Assist: replace string with char r=bnjjj a=bnjjj

close #6252

Co-authored-by: Benjamin Coenen <5719034+bnjjj@users.noreply.github.com>
Co-authored-by: Coenen Benjamin <benjamin.coenen@hotmail.com>
3 years agoUpdate crates/assists/src/handlers/replace_string_with_char.rs
Coenen Benjamin [Tue, 20 Oct 2020 18:07:39 +0000 (20:07 +0200)]
Update crates/assists/src/handlers/replace_string_with_char.rs

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
3 years agoMerge #6172
bors[bot] [Tue, 20 Oct 2020 17:03:19 +0000 (17:03 +0000)]
Merge #6172

6172: Add qualify path assist r=matklad a=Veykril

This implements a `qualify_path` assist which works quite similar to the `auto_import` assist but instead of adding imports to the file it well, qualifies the path. This PR also moves out the `AutoImportAssets` struct and functions from `auto_import` into a utils submodule as most of this is now shared between `auto_import` and `qualify_path`.

Changes made to `AutoImportAssets` are solely in its `search_for_imports` function which now takes a prefixed parameter to discern between using `find_use_path_prefixed` and `find_use_path` as the former is the required behavior by `auto_import` and the latter by this assist.

For missing imported traits instead of importing this will qualify the path with a trait cast as in:
```rust
test_mod::TestStruct::TEST_CONST<|>
```
becomes
```rust
<test_mod::TestStruct as test_mod::TestTrait>::TEST_CONST
```

and for trait methods ideally it would do the following:
```rust
let test_struct = test_mod::TestStruct {};
test_struct.test_meth<|>od()
```
becomes
```rust
let test_struct = test_mod::TestStruct {};
test_mod::TestTrait::test_method(&test_struct)
```

Fixes #4124.

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
3 years agoMerge #6299
bors[bot] [Tue, 20 Oct 2020 16:35:05 +0000 (16:35 +0000)]
Merge #6299

6299: Diagnose items that are #[cfg]d out r=jonas-schievink a=jonas-schievink

This emits a hint-level diagnostic with `Unnecessary` tag to "gray out" any items whose `#[cfg]` attributes remove the item before name resolution.

Co-authored-by: Jonas Schievink <jonas.schievink@ferrous-systems.com>
3 years agoFixup botched rename
Jonas Schievink [Tue, 20 Oct 2020 16:29:47 +0000 (18:29 +0200)]
Fixup botched rename

3 years agoMore detailed message
Jonas Schievink [Tue, 20 Oct 2020 16:23:55 +0000 (18:23 +0200)]
More detailed message

3 years agoRename UnconfiguredCode -> InactiveCode
Jonas Schievink [Tue, 20 Oct 2020 16:22:31 +0000 (18:22 +0200)]
Rename UnconfiguredCode -> InactiveCode

3 years agoMerge #6301
bors[bot] [Tue, 20 Oct 2020 16:14:40 +0000 (16:14 +0000)]
Merge #6301

6301: Don't rely on display names in inlay_hints r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
3 years agoDon't rely on display names in inlay_hints
Aleksey Kladov [Tue, 20 Oct 2020 15:38:21 +0000 (17:38 +0200)]
Don't rely on display names in inlay_hints

3 years agoAdd a (hint) diagnostic for unconfigured items
Jonas Schievink [Tue, 20 Oct 2020 15:49:21 +0000 (17:49 +0200)]
Add a (hint) diagnostic for unconfigured items

3 years agoSimplify diagnostic construction, add unused field
Jonas Schievink [Tue, 20 Oct 2020 15:48:43 +0000 (17:48 +0200)]
Simplify diagnostic construction, add unused field

3 years agoMerge #6297
bors[bot] [Tue, 20 Oct 2020 15:15:58 +0000 (15:15 +0000)]
Merge #6297

6297: Support Display name in project.json r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
3 years agoSupport Display name in project.json
Aleksey Kladov [Tue, 20 Oct 2020 15:13:15 +0000 (17:13 +0200)]
Support Display name in project.json

3 years agoMerge #6295
bors[bot] [Tue, 20 Oct 2020 15:09:51 +0000 (15:09 +0000)]
Merge #6295

6295: More type safety around names r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
3 years agoMore type safety around names
Aleksey Kladov [Tue, 20 Oct 2020 15:04:38 +0000 (17:04 +0200)]
More type safety around names

3 years agoIntroduce CrateDisplayName
Aleksey Kladov [Tue, 20 Oct 2020 14:00:51 +0000 (16:00 +0200)]
Introduce CrateDisplayName

3 years agoAssist: replace string with char
Benjamin Coenen [Sat, 17 Oct 2020 14:08:25 +0000 (16:08 +0200)]
Assist: replace string with char

Signed-off-by: Benjamin Coenen <5719034+bnjjj@users.noreply.github.com>
3 years agoRename declaration_name -> display_name
Aleksey Kladov [Tue, 20 Oct 2020 13:38:11 +0000 (15:38 +0200)]
Rename declaration_name -> display_name

Declaration names sounds like a name of declaration -- something you
can use for analysis. It empathically isn't, and is just a label
displayed in various UI. It's important not to confuse the two, least
we accidentally mix semantics with UI (I believe, there's already a
case of this in the FamousDefs at least).

3 years agoMerge #6294
bors[bot] [Tue, 20 Oct 2020 10:36:28 +0000 (10:36 +0000)]
Merge #6294

6294: Add a hacky remidy for #6038 r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
3 years agoAdd a hacky remidy for #6038
Aleksey Kladov [Tue, 20 Oct 2020 10:34:39 +0000 (12:34 +0200)]
Add a hacky remidy for #6038

The proper fix I think is:

* move rust-lang/rust library crates to a separate workspace
* when packaging rust-src component, vendor sources of external deps

3 years agoMerge #6266
bors[bot] [Tue, 20 Oct 2020 09:46:43 +0000 (09:46 +0000)]
Merge #6266

6266: Generate diagnostics docs r=matklad a=popzxc

Resolves #6215

Co-authored-by: Igor Aleksanov <popzxc@yandex.ru>
3 years agoAdd generated_diagnostic.adoc to the release.rs and smoke_test_docs_generation
Igor Aleksanov [Mon, 19 Oct 2020 18:07:40 +0000 (21:07 +0300)]
Add generated_diagnostic.adoc to the release.rs and smoke_test_docs_generation

3 years agoUse xshell::read_file instead of fs::read_to_string
Igor Aleksanov [Mon, 19 Oct 2020 17:58:32 +0000 (20:58 +0300)]
Use xshell::read_file instead of fs::read_to_string

3 years agoAdd descriptions for diagnostics parseable by xtask
Igor Aleksanov [Sat, 17 Oct 2020 14:29:06 +0000 (17:29 +0300)]
Add descriptions for diagnostics parseable by xtask

3 years agoCreate xtask module to generate diagnostics docs
Igor Aleksanov [Sat, 17 Oct 2020 14:06:42 +0000 (17:06 +0300)]
Create xtask module to generate diagnostics docs

3 years agoMerge #6290
bors[bot] [Mon, 19 Oct 2020 17:06:34 +0000 (17:06 +0000)]
Merge #6290

6290: Fix deprecation warning r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
3 years agoFix deprecation warning
Aleksey Kladov [Mon, 19 Oct 2020 17:05:55 +0000 (19:05 +0200)]
Fix deprecation warning

See https://github.blog/changelog/2020-10-01-github-actions-deprecating-set-env-and-add-path-commands/

3 years agoMerge #6288
bors[bot] [Mon, 19 Oct 2020 16:30:09 +0000 (16:30 +0000)]
Merge #6288

6288: Tag release branch rather than master r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
3 years agoTag release branch rather than master
Aleksey Kladov [Mon, 19 Oct 2020 16:28:59 +0000 (18:28 +0200)]
Tag release branch rather than master

3 years agoMerge #6274
bors[bot] [Mon, 19 Oct 2020 15:35:32 +0000 (15:35 +0000)]
Merge #6274

6274: Check cargoExtraArgs for undefined before using r=matklad a=feileacan

Fixes #6273

Co-authored-by: feileacan <54381366+feileacan@users.noreply.github.com>
3 years agoMerge #6284
bors[bot] [Mon, 19 Oct 2020 14:04:58 +0000 (14:04 +0000)]
Merge #6284

6284: Document logging of project model r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
3 years agoDocument logging of project model
Aleksey Kladov [Mon, 19 Oct 2020 14:04:22 +0000 (16:04 +0200)]
Document logging of project model

3 years agoMerge #6283
bors[bot] [Mon, 19 Oct 2020 13:54:16 +0000 (13:54 +0000)]
Merge #6283

6283: Minor, rename feature r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
3 years agoMinor, rename feature
Aleksey Kladov [Mon, 19 Oct 2020 13:53:48 +0000 (15:53 +0200)]
Minor, rename feature

3 years agoMerge #6282
bors[bot] [Mon, 19 Oct 2020 13:19:33 +0000 (13:19 +0000)]
Merge #6282

6282: Try to fix publishing r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
3 years agoTry to fix publishing
Aleksey Kladov [Mon, 19 Oct 2020 13:18:28 +0000 (15:18 +0200)]
Try to fix publishing

This errro specifically:

Updating crates.io index
 error: failed to select a version for the requirement `ra_ap_stdx = "^0.0.0"`
 candidate versions found which didn't match: 0.0.20
 location searched: /home/runner/work/rust-analyzer/rust-analyzer/crates/stdx
 required by package `ra_ap_completion v0.0.20 (/home/runner/work/rust-analyzer/rust-analyzer/crates/completion)`
 error: unable to update Cargo.lock
 Error: Process completed with exit code 1.

3 years agoMerge #6280
bors[bot] [Mon, 19 Oct 2020 11:58:33 +0000 (11:58 +0000)]
Merge #6280

6280: :arrow_up: crates r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
3 years ago:arrow_up: crates
Aleksey Kladov [Mon, 19 Oct 2020 11:54:01 +0000 (13:54 +0200)]
:arrow_up: crates

3 years agoMerge #6277
bors[bot] [Sun, 18 Oct 2020 15:06:08 +0000 (15:06 +0000)]
Merge #6277

6277: Change visibility works for type aliases r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
3 years agoChange visibility works for type aliases
Aleksey Kladov [Sun, 18 Oct 2020 15:04:12 +0000 (17:04 +0200)]
Change visibility works for type aliases

3 years agoMerge #6276
bors[bot] [Sun, 18 Oct 2020 10:41:46 +0000 (10:41 +0000)]
Merge #6276

6276: Extract call_info and completion into separate crates r=matklad a=popzxc

As it was discussed in [zulip](https://rust-lang.zulipchat.com/#narrow/stream/185405-t-compiler.2Fwg-rls-2.2E0/topic/Completion.20refactoring), we need to move `completions` into a separate crate.

Unfortunately, the dependency on `call_info::ActiveParameter` doesn't look easy to get rid of, and it seems to be a topic for a separate PR, thus I also extracted `call_info` into a separate crate (on which both `ide` and `completion` crates depend).

Additionally, a few `FIXME`s in doc-comments were resolved in order to make `tidy` happy.

Co-authored-by: Igor Aleksanov <popzxc@yandex.ru>
3 years agoExtract call_info and completion into separate crates
Igor Aleksanov [Sun, 18 Oct 2020 10:09:00 +0000 (13:09 +0300)]
Extract call_info and completion into separate crates

3 years agoMerge #6275
bors[bot] [Sun, 18 Oct 2020 08:30:28 +0000 (08:30 +0000)]
Merge #6275

6275: Textmate grammar: prevent unwanted interpolation scopes r=matklad a=dustypomerleau

Fixes the issues noted by @matklad after merging #6248.

1. prevent accidental interpolation scopes when `{` is used in a string
1. prevent interpolations from extending beyond the end of a string

Co-authored-by: Dusty Pomerleau <dustypomerleau@users.noreply.github.com>
3 years agofix: prevent unwanted interpolation scopes
Dusty Pomerleau [Sun, 18 Oct 2020 02:27:03 +0000 (13:27 +1100)]
fix: prevent unwanted interpolation scopes

3 years agoCheck cargoExtraArgs for undefined before using
feileacan [Sun, 18 Oct 2020 00:40:48 +0000 (11:40 +1100)]
Check cargoExtraArgs for undefined before using

3 years agoMerge #6272
bors[bot] [Sat, 17 Oct 2020 23:53:42 +0000 (23:53 +0000)]
Merge #6272

6272: :arrow_up: xshell r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
3 years agoupdate deps
Aleksey Kladov [Sat, 17 Oct 2020 23:53:01 +0000 (01:53 +0200)]
update deps

3 years ago:arrow_up: xshell
Aleksey Kladov [Sat, 17 Oct 2020 23:51:39 +0000 (01:51 +0200)]
:arrow_up: xshell

3 years agoMerge #6271
bors[bot] [Sat, 17 Oct 2020 22:45:32 +0000 (22:45 +0000)]
Merge #6271

6271: Complete methods when receiver is a macro r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
3 years agoMerge #6248
bors[bot] [Sat, 17 Oct 2020 22:38:04 +0000 (22:38 +0000)]
Merge #6248

6248: Textmate grammar: prevent early termination of raw strings with hash (closes #6042) r=matklad a=dustypomerleau

Problematic sample code from #6042:

```rust
#[derive(Debug, Clone, Logos)]
enum Quoted<'source> {
    #[regex(r#"[^\\"']+"#)]
    Text(&'source str),
    #[token("\\")]
    StartEscape,
    #[token("\'", |_| Quote::Single)]
    #[token("\"", |_| Quote::Double)]
    End(Quote),

    #[error]
    Error,
}
```

Before fix:

<img width="400" alt="Screen Shot 2020-10-16 at 10 45 59" src="https://user-images.githubusercontent.com/6304651/96198390-6a726d00-0fa0-11eb-8428-e76b2866836b.png">

After fix:

<img width="400" alt="Screen Shot 2020-10-16 at 10 45 33" src="https://user-images.githubusercontent.com/6304651/96198408-7a8a4c80-0fa0-11eb-9104-ca708009fe63.png">

Co-authored-by: Dusty Pomerleau <dustypomerleau@users.noreply.github.com>
3 years agoComplete methods when receiver is a macro
Aleksey Kladov [Sat, 17 Oct 2020 21:43:13 +0000 (23:43 +0200)]
Complete methods when receiver is a macro

3 years agoImprove readability
Aleksey Kladov [Sat, 17 Oct 2020 21:35:21 +0000 (23:35 +0200)]
Improve readability

3 years agoMerge #6265
bors[bot] [Sat, 17 Oct 2020 11:25:48 +0000 (11:25 +0000)]
Merge #6265

6265: :arrow_up: xshell r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
3 years ago:arrow_up: xshell
Aleksey Kladov [Sat, 17 Oct 2020 11:25:22 +0000 (13:25 +0200)]
:arrow_up: xshell

3 years agoMerge #6262
bors[bot] [Sat, 17 Oct 2020 10:31:37 +0000 (10:31 +0000)]
Merge #6262

6262: Do not spawn redundant hints r=SomeoneToIgnore a=popzxc

Closes #5206

This is a second part of the fix (first was #5997).

This PR adds a new method to the `CompletionContext`: `no_completion_required`. If this method returns `true`, it essentially means that user is unlikely to expect any hints from the IDE at this cursor position.

Currently, checks for the following cases were added:

- Previous item is `fn`: user creates a new function, names of existing functions won't be helpful. Exception for this case is `impl Foo for Bar` -- we must suggest trait function names.
- User entered `for _ i<|>`: it's obviously going to be `in` keyword, any hints here will be confusing.

More checks may be added there later, but currently I've only figured two cases.

![no_redundant_hints](https://user-images.githubusercontent.com/12111581/96332088-da4d2a00-106a-11eb-89a1-1159ece18f9d.png)

Co-authored-by: Igor Aleksanov <popzxc@yandex.ru>
3 years agoallow xtask install --client-code[=CLIENT] to specify client
Emil Gardström [Fri, 16 Oct 2020 22:35:06 +0000 (00:35 +0200)]
allow xtask install --client-code[=CLIENT] to specify client

3 years agoScan all ancestors for the impl trait block check
Igor Aleksanov [Sat, 17 Oct 2020 08:17:58 +0000 (11:17 +0300)]
Scan all ancestors for the impl trait block check

3 years agoAllow hints after 'fn' keyword if it's an impl trait block
Igor Aleksanov [Sat, 17 Oct 2020 08:03:07 +0000 (11:03 +0300)]
Allow hints after 'fn' keyword if it's an impl trait block

3 years agoAdd test for new pattern functions
Igor Aleksanov [Sat, 17 Oct 2020 07:56:00 +0000 (10:56 +0300)]
Add test for new pattern functions

3 years agoImprove test_no_completions_required test
Igor Aleksanov [Sat, 17 Oct 2020 07:47:35 +0000 (10:47 +0300)]
Improve test_no_completions_required test

3 years agoRemove redundant completions
Igor Aleksanov [Mon, 12 Oct 2020 07:59:15 +0000 (10:59 +0300)]
Remove redundant completions

3 years agoMerge #6260
bors[bot] [Sat, 17 Oct 2020 00:44:12 +0000 (00:44 +0000)]
Merge #6260

6260: xshell r=matklad a=matklad

bors r+
🤖

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