]> git.lizzy.rs Git - rust.git/log
rust.git
2 years agoMerge #11259
bors[bot] [Tue, 11 Jan 2022 14:43:44 +0000 (14:43 +0000)]
Merge #11259

11259: fix: fix `use super::{super::...};` r=jonas-schievink a=jonas-schievink

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

bors r+

Co-authored-by: Jonas Schievink <jonas.schievink@ferrous-systems.com>
2 years agoFix concatenation of `super` mod paths
Jonas Schievink [Tue, 11 Jan 2022 14:30:39 +0000 (15:30 +0100)]
Fix concatenation of `super` mod paths

2 years agoMerge #11258
bors[bot] [Tue, 11 Jan 2022 14:17:18 +0000 (14:17 +0000)]
Merge #11258

11258: Kate uses rust-analyzer by default now r=jonas-schievink a=milliams

Since Kate 21.12 rust-analyzer is the default. See this Kate MR: https://invent.kde.org/utilities/kate/-/merge_requests/495

Co-authored-by: Matt Williams <matt@milliams.com>
2 years agoMerge #11257
bors[bot] [Tue, 11 Jan 2022 13:36:53 +0000 (13:36 +0000)]
Merge #11257

11257: feat: Report `DefDiagnostic`s from inside item bodies r=jonas-schievink a=jonas-schievink

Reports diagnostics from all block-level `DefMap`s, and adds some code to avoid adding duplicate diagnostics to the body's `SourceMap`.

bors r+

Co-authored-by: Jonas Schievink <jonas.schievink@ferrous-systems.com>
2 years agoKate uses rust-analyzer by default
Matt Williams [Tue, 11 Jan 2022 13:36:06 +0000 (13:36 +0000)]
Kate uses rust-analyzer by default

2 years agoReport `DefDiagnostic`s from inside item bodies
Jonas Schievink [Tue, 11 Jan 2022 13:34:25 +0000 (14:34 +0100)]
Report `DefDiagnostic`s from inside item bodies

2 years agoMerge #11210
bors[bot] [Tue, 11 Jan 2022 09:39:12 +0000 (09:39 +0000)]
Merge #11210

11210: feat: Deprioritize ops methods in completion r=Veykril a=Veykril

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

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2 years agoLookup lang attribute on assoc item trait directly
Lukas Wirth [Tue, 11 Jan 2022 09:07:16 +0000 (10:07 +0100)]
Lookup lang attribute on assoc item trait directly

2 years agoUpdate tests
Lukas Wirth [Thu, 6 Jan 2022 12:36:43 +0000 (13:36 +0100)]
Update tests

2 years agofeat: Deprioritize ops methods in completion
Lukas Wirth [Thu, 6 Jan 2022 12:31:36 +0000 (13:31 +0100)]
feat: Deprioritize ops methods in completion

2 years agoMerge #11252
bors[bot] [Tue, 11 Jan 2022 08:11:55 +0000 (08:11 +0000)]
Merge #11252

11252: Fix documentation of snippet r=Veykril a=weirane

Closes #11234

Co-authored-by: Wang Ruochen <wrc@ruo-chen.wang>
2 years agoFix documentation of snippet
Wang Ruochen [Tue, 11 Jan 2022 04:47:54 +0000 (20:47 -0800)]
Fix documentation of snippet

2 years agoMerge #11247
bors[bot] [Mon, 10 Jan 2022 15:56:54 +0000 (15:56 +0000)]
Merge #11247

11247: Print a single ellipsis for any number of omitted types r=jonas-schievink a=jonas-schievink

Helps a little bit with https://github.com/rust-analyzer/rust-analyzer/issues/11240

bors r+

Co-authored-by: Jonas Schievink <jonas.schievink@ferrous-systems.com>
2 years agoPrint a single ellipsis for any number of omitted types
Jonas Schievink [Mon, 10 Jan 2022 15:55:53 +0000 (16:55 +0100)]
Print a single ellipsis for any number of omitted types

2 years agoMerge #11238
bors[bot] [Sat, 8 Jan 2022 14:46:01 +0000 (14:46 +0000)]
Merge #11238

11238: fix: shrink the span of errors from attribute macros and derives r=jonas-schievink a=jonas-schievink

Some procedural macros tend to get very large invocations, for example RTIC's, leading to issues like https://github.com/rtic-rs/cortex-m-rtic/issues/582, where almost the entire screen is underlined while editing incomplete code in the macro.

This PR shrinks the spans of errors from attribute macros and derives to point only at the attribute, which also matches rustc more closely.

bors r+

Co-authored-by: Jonas Schievink <jonas.schievink@ferrous-systems.com>
2 years agoShrink diagnostic spans for errors inside macros
Jonas Schievink [Sat, 8 Jan 2022 14:38:50 +0000 (15:38 +0100)]
Shrink diagnostic spans for errors inside macros

2 years agoAllow doc comments on all `Item`s
Jonas Schievink [Sat, 8 Jan 2022 14:01:26 +0000 (15:01 +0100)]
Allow doc comments on all `Item`s

2 years agoMerge #11237
bors[bot] [Sat, 8 Jan 2022 13:55:18 +0000 (13:55 +0000)]
Merge #11237

11237: fix: Fix outline modules spilling inner doc injections into their parent r=Veykril a=Veykril

Fixes another regression caused by https://github.com/rust-analyzer/rust-analyzer/pull/11225
bors r+

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2 years agofix: Fix outline modules spilling inner doc injections into their parent
Lukas Wirth [Sat, 8 Jan 2022 13:54:31 +0000 (14:54 +0100)]
fix: Fix outline modules spilling inner doc injections into their parent

2 years agoMerge #11236
bors[bot] [Sat, 8 Jan 2022 11:17:56 +0000 (11:17 +0000)]
Merge #11236

11236: internal: Remove `InFile` wrapping from `DynMap` keys r=Veykril a=Veykril

We already store a `DynMap` per `(Container, HirFileId)` pair, so the `InFile` keys are already guruanteed to always be of the same file id
bors r+

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2 years agoRemove `InFile` wrapping from DynMap keys
Lukas Wirth [Sat, 8 Jan 2022 11:13:45 +0000 (12:13 +0100)]
Remove `InFile` wrapping from DynMap keys

2 years agoOnly add generics with the correct file id to DynMap
Lukas Wirth [Sat, 8 Jan 2022 10:34:58 +0000 (11:34 +0100)]
Only add generics with the correct file id to DynMap

2 years agoMerge #11235
bors[bot] [Sat, 8 Jan 2022 10:11:37 +0000 (10:11 +0000)]
Merge #11235

11235: internal: Record attribute calls on assoc items in TraitData and ImplData r=Veykril a=Veykril

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

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2 years agoDo less allocs in `trait_data` and `impl_data` queries
Lukas Wirth [Sat, 8 Jan 2022 10:04:16 +0000 (11:04 +0100)]
Do less allocs in `trait_data` and `impl_data` queries

2 years agoRecord attribute calls on assoc items in TraitData and ImplData
Lukas Wirth [Sat, 8 Jan 2022 09:45:12 +0000 (10:45 +0100)]
Record attribute calls on assoc items in TraitData and ImplData

2 years agoMerge #11107
bors[bot] [Sat, 8 Jan 2022 09:05:09 +0000 (09:05 +0000)]
Merge #11107

11107: Fix generic type substitution in impl trait with assoc type r=pnevyk a=pnevyk

Fixes #11045

The path transform now detects if a type parameter that is being substituted has an associated type. In that case it is necessary (or safe in general case) to fully qualify the substitution with a trait which the associated type belongs to.

This PR also fixes the previous wrong behavior of the substitution that could create an invalid tree `PATH_TYPE -> PATH_TYPE -> ...`.

Co-authored-by: Petr Nevyhoštěný <petr.nevyhosteny@gmail.com>
2 years agoMerge #11232
bors[bot] [Fri, 7 Jan 2022 20:52:57 +0000 (20:52 +0000)]
Merge #11232

11232: Filter out macro calls by file id in when building DynMap r=Veykril a=Veykril

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2 years agoSimplify
Lukas Wirth [Fri, 7 Jan 2022 20:51:59 +0000 (21:51 +0100)]
Simplify

2 years agoFilter out macro calls by file id in when building DynMap
Lukas Wirth [Fri, 7 Jan 2022 20:31:08 +0000 (21:31 +0100)]
Filter out macro calls by file id in when building DynMap

2 years agoMerge #11230
bors[bot] [Fri, 7 Jan 2022 18:06:33 +0000 (18:06 +0000)]
Merge #11230

11230: fix: Fix attribute stripping ignoring doc comments r=Veykril a=Veykril

Follow up to https://github.com/rust-analyzer/rust-analyzer/pull/11225#pullrequestreview-846779237

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2 years agofix: Fix attribute stripping ignoring doc comments
Lukas Wirth [Fri, 7 Jan 2022 17:51:10 +0000 (18:51 +0100)]
fix: Fix attribute stripping ignoring doc comments

2 years agoFix generic type substitution in impl trait with assoc const
Petr Nevyhoštěný [Fri, 7 Jan 2022 15:41:39 +0000 (16:41 +0100)]
Fix generic type substitution in impl trait with assoc const

2 years agoMerge #11145
bors[bot] [Fri, 7 Jan 2022 14:10:11 +0000 (14:10 +0000)]
Merge #11145

11145: feat: add config to use reasonable default expression instead of todo! when filling missing fields r=Veykril a=bnjjj

Use `Default::default()` in struct fields when we ask to fill it instead of putting `todo!()` for every fields

before:

```rust
pub enum Other {
    One,
    Two,
}

pub struct Test {
    text: String,
    num: usize,
    other: Other,
}

fn t_test() {
    let test = Test {<|>};
}
```

after:

```rust
pub enum Other {
    One,
    Two,
}

pub struct Test {
    text: String,
    num: usize,
    other: Other,
}

fn t_test() {
    let test = Test {
        text: String::new(),
        num: 0,
        other: todo!(),
    };
}
```

Co-authored-by: Benjamin Coenen <5719034+bnjjj@users.noreply.github.com>
Co-authored-by: Coenen Benjamin <benjamin.coenen@hotmail.com>
2 years agoMerge #11220
bors[bot] [Fri, 7 Jan 2022 14:02:01 +0000 (14:02 +0000)]
Merge #11220

11220: Turbo fish assist: don't include lifetime parameters r=Veykril a=Vannevelj

Fixes #11219

The issue talks about three different types of params: type, const & lifetime. I wasn't entirely sure which ones are intended to be included here so I've gone for the type & const params (i.e. exclude lifetime).

I've added a test case for both a lifetime param and a const param. I'm still making my way through the rust book (chapter 7, yay) so I'm not too sure yet what these are but my testing shows that this approach generates code that compiles.

Co-authored-by: Jeroen Vannevel <jer_vannevel@outlook.com>
2 years agofeat(diagnostics): use default expression instead of todo! when missing fields
Benjamin Coenen [Fri, 7 Jan 2022 14:01:37 +0000 (15:01 +0100)]
feat(diagnostics): use default expression instead of todo! when missing fields

Signed-off-by: Benjamin Coenen <5719034+bnjjj@users.noreply.github.com>
2 years agosuccinct code
Jeroen Vannevel [Fri, 7 Jan 2022 13:53:42 +0000 (13:53 +0000)]
succinct code

2 years agoMerge #11225
bors[bot] [Fri, 7 Jan 2022 13:38:23 +0000 (13:38 +0000)]
Merge #11225

11225: internal: Cleanup doc and attribute handling r=Veykril a=Veykril

(very vague PR title but as I tried to fix the mentioned issue I ran into more and more subtle things that were interwoven)
Fixes https://github.com/rust-analyzer/rust-analyzer/issues/11215

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2 years agoUpdate item tree test output
Lukas Wirth [Fri, 7 Jan 2022 13:29:58 +0000 (14:29 +0100)]
Update item tree test output

2 years agoMerge #11194
bors[bot] [Fri, 7 Jan 2022 13:24:58 +0000 (13:24 +0000)]
Merge #11194

11194: fix(gen-doc-assist): remove lifetimes in description of `new` r=Veykril a=numero-744

From wrong behavior:

```rust
/// Creates a new [`MyGenericStruct<'a, T>`].
```

to correct behavior:

```rust
/// Creates a new [`MyGenericStruct<T>`].
```

But I feel like there is a better way to implement it. Do you know if there is an existing function that could do the work of `lifetimes_removed()` below?

Co-authored-by: Côme ALLART <come.allart@etu.emse.fr>
2 years agoUse `FileAstId<ast::Adt>` in nameres where appropriate instead
Lukas Wirth [Fri, 7 Jan 2022 13:19:11 +0000 (14:19 +0100)]
Use `FileAstId<ast::Adt>` in nameres where appropriate instead

2 years agoinclude tabstops
Jeroen Vannevel [Fri, 7 Jan 2022 13:17:21 +0000 (13:17 +0000)]
include tabstops

2 years agoBetter interface for doc comment and attribute processing
Lukas Wirth [Fri, 7 Jan 2022 13:14:33 +0000 (14:14 +0100)]
Better interface for doc comment and attribute processing

2 years agofeat(diagnostics): use default expression instead of todo! when missing fields
Benjamin Coenen [Fri, 7 Jan 2022 13:13:34 +0000 (14:13 +0100)]
feat(diagnostics): use default expression instead of todo! when missing fields

Signed-off-by: Benjamin Coenen <5719034+bnjjj@users.noreply.github.com>
2 years agorefactor: apply suggestions
Côme ALLART [Fri, 7 Jan 2022 13:04:03 +0000 (14:04 +0100)]
refactor: apply suggestions

See PR #11194

2 years agoUpdate crates/rust-analyzer/src/config.rs
Coenen Benjamin [Fri, 7 Jan 2022 13:07:02 +0000 (14:07 +0100)]
Update crates/rust-analyzer/src/config.rs

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2 years agofmt
Jeroen Vannevel [Fri, 7 Jan 2022 12:40:41 +0000 (12:40 +0000)]
fmt

2 years agoconcise filtering
Jeroen Vannevel [Fri, 7 Jan 2022 12:34:03 +0000 (12:34 +0000)]
concise filtering

2 years agoGenerate `AnyHasDocComments` node
Lukas Wirth [Fri, 7 Jan 2022 11:37:58 +0000 (12:37 +0100)]
Generate `AnyHasDocComments` node

2 years agosupport const params
Jeroen Vannevel [Fri, 7 Jan 2022 01:09:32 +0000 (01:09 +0000)]
support const params

2 years agoCount the type parameters only
Jeroen Vannevel [Fri, 7 Jan 2022 01:02:16 +0000 (01:02 +0000)]
Count the type parameters only

2 years agoMerge #11218
bors[bot] [Thu, 6 Jan 2022 23:17:51 +0000 (23:17 +0000)]
Merge #11218

11218: fix: Correct has_ref detection, avoiding duplicate &mut insertion on parameter completion r=Veykril a=weirane

The original code fails to detect there's a ref in scenarios such as `&mut s` and `& s` because `WHITESPACE` and `IDENT` got reversed.

Closes #11199.

Co-authored-by: Wang Ruochen <wrc@ruo-chen.wang>
2 years agoCorrect has_ref detection
Wang Ruochen [Thu, 6 Jan 2022 19:45:09 +0000 (11:45 -0800)]
Correct has_ref detection

2 years agoadd better default behavior on fill struct fields diagnostic
Benjamin Coenen [Thu, 6 Jan 2022 14:42:29 +0000 (15:42 +0100)]
add better default behavior on fill struct fields diagnostic

Signed-off-by: Benjamin Coenen <5719034+bnjjj@users.noreply.github.com>
2 years agoMerge #11217
bors[bot] [Thu, 6 Jan 2022 14:39:34 +0000 (14:39 +0000)]
Merge #11217

11217: minor: Move pretty-printing test out of assist r=lnicola a=lnicola

bors r+

Co-authored-by: Laurențiu Nicola <lnicola@dend.ro>
2 years agoMove pretty-printing test out of assist
Laurențiu Nicola [Thu, 6 Jan 2022 14:38:25 +0000 (16:38 +0200)]
Move pretty-printing test out of assist

2 years agoMerge #11216
bors[bot] [Thu, 6 Jan 2022 13:57:17 +0000 (13:57 +0000)]
Merge #11216

11216: internal: Support registered tools and attributes in ide layer r=Veykril a=Veykril

bors r+

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2 years agointernal: Support registered tools and attributes in ide layer
Lukas Wirth [Thu, 6 Jan 2022 13:56:50 +0000 (14:56 +0100)]
internal: Support registered tools and attributes in ide layer

2 years agoMerge #11214
bors[bot] [Thu, 6 Jan 2022 13:24:43 +0000 (13:24 +0000)]
Merge #11214

11214: feat: poke user when supplying faulty configurations r=Veykril a=Veykril

bors r+

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2 years agofeat: poke user when supplying faulty configurations
Lukas Wirth [Thu, 6 Jan 2022 13:23:35 +0000 (14:23 +0100)]
feat: poke user when supplying faulty configurations

2 years agoMerge #11193
bors[bot] [Thu, 6 Jan 2022 12:53:49 +0000 (12:53 +0000)]
Merge #11193

11193: feat: Add config to replace specific proc-macros with dummy expanders r=Veykril a=Veykril

With this one can specify proc-macros from crates to expand into their input as a (temporary) workaround for the current completion problems with some of the bigger attribute proc-macros like `async_trait`.

This could've been done by just not expanding these macros, but that would require fiddling with nameres. I felt like this approach was simpler to pull off while also keeping the behaviour of the attributes/proc-macro in that they still expand instead of being dead syntax to us.

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

Usage(`async_trait` as example):
```jsonc
    "rust-analyzer.procMacro.dummies": {
        "async-trait": [ // crate name(as per its cargo.toml definition, not the dependency name)
            "async_trait" // exported proc-macro name
        ]
    },
```

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2 years agoAdjust config name
Lukas Wirth [Thu, 6 Jan 2022 12:44:21 +0000 (13:44 +0100)]
Adjust config name

2 years agoRegenrate docs and package.json
Lukas Wirth [Wed, 5 Jan 2022 18:35:48 +0000 (19:35 +0100)]
Regenrate docs and package.json

2 years agofeat: Add config to replace specific proc-macros with dummy expanders
Lukas Wirth [Tue, 4 Jan 2022 19:40:16 +0000 (20:40 +0100)]
feat: Add config to replace specific proc-macros with dummy expanders

2 years agoMerge #11211
bors[bot] [Thu, 6 Jan 2022 12:41:02 +0000 (12:41 +0000)]
Merge #11211

11211: fix: Fix parsing of `#[derive]` paths r=jonas-schievink a=jonas-schievink

Currently this code produces an empty derive path for every `,`, which makes the IDE layer resolve derive paths to the wrong derive macro in the list. Skip `,`s to fix that. (nameres just ignored them, so it didn't cause problems there)

bors r+

Co-authored-by: Jonas Schievink <jonas.schievink@ferrous-systems.com>
2 years agoFix parsing of `#[derive]` paths
Jonas Schievink [Thu, 6 Jan 2022 12:39:20 +0000 (13:39 +0100)]
Fix parsing of `#[derive]` paths

2 years agoMerge #11209
bors[bot] [Thu, 6 Jan 2022 11:56:29 +0000 (11:56 +0000)]
Merge #11209

11209: minor: Use`const _` instead of `mod __` r=jonas-schievink a=jonas-schievink

We now handle it correctly

bors r+

Co-authored-by: Jonas Schievink <jonas.schievink@ferrous-systems.com>
2 years agoUse`const _` instead of `mod __`
Jonas Schievink [Thu, 6 Jan 2022 11:55:33 +0000 (12:55 +0100)]
Use`const _` instead of `mod __`

2 years agoMerge #11208
bors[bot] [Thu, 6 Jan 2022 11:31:19 +0000 (11:31 +0000)]
Merge #11208

11208: feat: expand attribute macros on impl and trait items r=jonas-schievink a=jonas-schievink

fixes https://github.com/rust-analyzer/rust-analyzer/issues/11104

bors r+

Co-authored-by: Jonas Schievink <jonas.schievink@ferrous-systems.com>
2 years agoExpand attribute macros on impl and trait items
Jonas Schievink [Thu, 6 Jan 2022 11:30:16 +0000 (12:30 +0100)]
Expand attribute macros on impl and trait items

2 years agoMerge #11207
bors[bot] [Thu, 6 Jan 2022 10:48:54 +0000 (10:48 +0000)]
Merge #11207

11207: Always put a space after impl in macro pretty-printing r=Veykril a=jplatte

… regardless of whether the next symbol is punctuation or not.

Followup to #11200.

Co-authored-by: Jonas Platte <jplatte+git@posteo.de>
2 years agoAlways put a space after impl in macro pretty-printing
Jonas Platte [Thu, 6 Jan 2022 10:08:32 +0000 (11:08 +0100)]
Always put a space after impl in macro pretty-printing

… regardless of whether the next symbol is punctuation or not.

2 years agofix: remove brackets if no generic types
Côme ALLART [Thu, 6 Jan 2022 00:51:04 +0000 (01:51 +0100)]
fix: remove brackets if no generic types

2 years agoMerge #11204
bors[bot] [Wed, 5 Jan 2022 22:47:30 +0000 (22:47 +0000)]
Merge #11204

11204: fix: `replace_qualified_name_with_use` does not use full item path for replacements r=Veykril a=Veykril

bors r+

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2 years agofix: `replace_qualified_name_with_use` does not use full item path for replacements
Lukas Wirth [Wed, 5 Jan 2022 22:46:58 +0000 (23:46 +0100)]
fix: `replace_qualified_name_with_use` does not use full item path for replacements

2 years agoMerge #11195 #11202
bors[bot] [Wed, 5 Jan 2022 21:30:50 +0000 (21:30 +0000)]
Merge #11195 #11202

11195: Correctly pass through reference modifiers when extracting a variable r=Veykril a=Vannevelj

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

This will parse the field expression and look at whether it is marked `&` or `&mut` and include a modifier if appropriate. The original issue only mentions `&mut params` but I've found that this issue also occurs for `&mut locals` as well as `&params` and `&locals` so I've also added tests for them.

I'd definitely be interested in hearing where I can make my code more idiomatic for Rust.

11202: fix: Fix `apply_demorgan` assist hanging for certain binary expressions r=Veykril a=Veykril

Fixes https://github.com/rust-analyzer/rust-analyzer/issues/10963
bors r+

Co-authored-by: Jeroen Vannevel <jer_vannevel@outlook.com>
Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2 years agofix: Fix `apply_demorgan` assist hanging for certain binary expressions
Lukas Wirth [Wed, 5 Jan 2022 21:30:19 +0000 (22:30 +0100)]
fix: Fix `apply_demorgan` assist hanging for certain binary expressions

2 years agoremoved double matching
Jeroen Vannevel [Wed, 5 Jan 2022 21:16:24 +0000 (21:16 +0000)]
removed double matching

2 years agono PathExpr arm
Jeroen Vannevel [Wed, 5 Jan 2022 21:12:09 +0000 (21:12 +0000)]
no PathExpr arm

2 years ago.clone() over .to_owned()
Jeroen Vannevel [Wed, 5 Jan 2022 21:10:03 +0000 (21:10 +0000)]
.clone() over .to_owned()

2 years agoless wordy ref_kind assignment
Jeroen Vannevel [Wed, 5 Jan 2022 21:08:46 +0000 (21:08 +0000)]
less wordy ref_kind assignment

2 years agoMerge #11201
bors[bot] [Wed, 5 Jan 2022 20:45:27 +0000 (20:45 +0000)]
Merge #11201

11201: fix: Fix completions not considering ancestor items for attribute search r=Veykril a=Veykril

Turns out we never filled the `CompletionContext` with the attribute expansion of attributed impls and traits when typing in the assoc items, as we were only considering the assoc item to have an attribute to expand.
bors r+

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2 years agofix: Fix completions not considering ancestor items for attribute search
Lukas Wirth [Wed, 5 Jan 2022 20:12:36 +0000 (21:12 +0100)]
fix: Fix completions not considering ancestor items for attribute search

2 years agoMerge #11200
bors[bot] [Wed, 5 Jan 2022 20:04:49 +0000 (20:04 +0000)]
Merge #11200

11200: Always put a space after dyn in macro pretty-printing r=Veykril a=jplatte

Fixes #11100.

Co-authored-by: Jonas Platte <jplatte+git@posteo.de>
2 years agoMerge #11198
bors[bot] [Wed, 5 Jan 2022 18:08:09 +0000 (18:08 +0000)]
Merge #11198

11198: Remove unused lifetime r=lnicola a=Aaron1011

Co-authored-by: Aaron Hill <aa1ronham@gmail.com>
2 years agoAlways put a space after `dyn` in macro pretty-printing
Jonas Platte [Wed, 5 Jan 2022 17:04:44 +0000 (18:04 +0100)]
Always put a space after `dyn` in macro pretty-printing

… regardless of whether the next symbol is punctuation or not.
Fixes issue 11100.

2 years agoAdd failing test case for issue 11100
Jonas Platte [Wed, 5 Jan 2022 17:04:36 +0000 (18:04 +0100)]
Add failing test case for issue 11100

2 years agosimplify
Jonas Schievink [Wed, 5 Jan 2022 16:26:34 +0000 (17:26 +0100)]
simplify

2 years agoRemove unused lifetime
Aaron Hill [Wed, 5 Jan 2022 15:19:10 +0000 (10:19 -0500)]
Remove unused lifetime

2 years agoremoved trailing whitespace
Jeroen Vannevel [Wed, 5 Jan 2022 02:16:22 +0000 (02:16 +0000)]
removed trailing whitespace

2 years agocomment
Jeroen Vannevel [Wed, 5 Jan 2022 01:48:57 +0000 (01:48 +0000)]
comment

2 years agoadditional test for a reference local (on top of mutable reference local)
Jeroen Vannevel [Wed, 5 Jan 2022 01:36:04 +0000 (01:36 +0000)]
additional test for a reference local (on top of mutable reference local)

2 years agofailing test for a reference local
Jeroen Vannevel [Wed, 5 Jan 2022 01:27:15 +0000 (01:27 +0000)]
failing test for a reference local

2 years agoDon't include a ref if none was declared
Jeroen Vannevel [Wed, 5 Jan 2022 01:18:55 +0000 (01:18 +0000)]
Don't include a ref if none was declared

2 years agosupport ref params as well
Jeroen Vannevel [Wed, 5 Jan 2022 01:15:54 +0000 (01:15 +0000)]
support ref params as well

2 years agocorrectly handle mutable references
Jeroen Vannevel [Wed, 5 Jan 2022 01:03:27 +0000 (01:03 +0000)]
correctly handle mutable references

2 years agofix(gen-doc-assist): remove lifetimes in description of `new`
Côme ALLART [Tue, 4 Jan 2022 23:23:36 +0000 (00:23 +0100)]
fix(gen-doc-assist): remove lifetimes in description of `new`

2 years agoMerge #11190
bors[bot] [Tue, 4 Jan 2022 22:40:10 +0000 (22:40 +0000)]
Merge #11190

11190: fix(completions): improve fn_param r=dbofmmbt a=dbofmmbt

- insert commas around when necessary
- only suggest `self` completions when param list is empty
- stop suggesting completions for identifiers which are already on the param list

Closes #11085

Co-authored-by: Eduardo Canellas <eduardocanellas98@gmail.com>
2 years agorefactor: apply review suggestions
Eduardo Canellas [Tue, 4 Jan 2022 22:30:57 +0000 (19:30 -0300)]
refactor: apply review suggestions

2 years agoMerge #11112
bors[bot] [Tue, 4 Jan 2022 21:51:37 +0000 (21:51 +0000)]
Merge #11112

11112: Evaluate constants in array repeat expression r=HKalbasi a=HKalbasi

cc #8655

Co-authored-by: hkalbasi <hamidrezakalbasi@protonmail.com>
2 years agoEvaluate constants in array repeat expression
hkalbasi [Thu, 23 Dec 2021 17:49:18 +0000 (21:19 +0330)]
Evaluate constants in array repeat expression