Commit graph

20800 commits

Author SHA1 Message Date
Jeroen Vannevel
5dfc8da77e
don't need the as_ref() 2022-01-14 01:32:10 +00:00
Jeroen Vannevel
c52605024c
extracted function 2022-01-14 01:32:10 +00:00
Jeroen Vannevel
d8a3e51a5f
added tests for multiple fields 2022-01-14 01:32:10 +00:00
Jeroen Vannevel
9252c76255
using classify() 2022-01-14 01:32:10 +00:00
Jeroen Vannevel
6a1b4912bf
removed some unused stuff 2022-01-14 01:32:09 +00:00
Jeroen Vannevel
c9fc91822f
minicore 2022-01-14 01:32:09 +00:00
Jeroen Vannevel
215f896665
compiles, but doesn't work yet 2022-01-14 01:32:09 +00:00
bors[bot]
b4c31481a5
Merge #11276
11276: internal: Slightly cleanup HasFormatSpecifier::lex_format_specifier r=Veykril a=Veykril

bors r+

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2022-01-13 19:18:47 +00:00
bors[bot]
07ded2aef0
Merge #11277
11277: minor: reformat and fix warning r=lnicola a=lnicola

bors r+

Co-authored-by: Laurențiu Nicola <lnicola@dend.ro>
2022-01-13 19:08:38 +00:00
Laurențiu Nicola
0721a55a48 Remove duplicate test attribute 2022-01-13 21:08:04 +02:00
Laurențiu Nicola
84c59a1f9f Reformat code 2022-01-13 21:07:17 +02:00
Lukas Wirth
c3148cb396 Slightly cleanup HasFormatSpecifier::lex_format_specifier 2022-01-13 19:12:39 +01:00
bors[bot]
1bfd903af0
Merge #11274
11274: internal: Unexport `MacroDefId` from `hir` r=jonas-schievink a=jonas-schievink

It's not used outside of it

bors r+

Co-authored-by: Jonas Schievink <jonas.schievink@ferrous-systems.com>
2022-01-13 15:19:03 +00:00
Jonas Schievink
3fde9f820a Unexport MacroDefId from hir 2022-01-13 16:18:05 +01:00
bors[bot]
62a13cce9b
Merge #11267
11267: internal: Remove `ModuleId` from `hir` reexports r=jonas-schievink a=jonas-schievink

followup to https://github.com/rust-analyzer/rust-analyzer/pull/11266

bors r+

Co-authored-by: Jonas Schievink <jonas.schievink@ferrous-systems.com>
2022-01-12 19:22:15 +00:00
Jonas Schievink
18e80e6892 Remove ModuleId from hir reexports 2022-01-12 20:21:13 +01:00
bors[bot]
16d3a7bf08
Merge #11266
11266: internal: Mostly restore `hir` API boundary r=jonas-schievink a=jonas-schievink

The boundary was broken in https://github.com/rust-analyzer/rust-analyzer/pull/10872 by reexporting a bunch of `hir_def`-internal types.

This PR moves symbol collection to `hir` and removes those reexports again.

bors r+

Co-authored-by: Jonas Schievink <jonas.schievink@ferrous-systems.com>
2022-01-12 18:58:24 +00:00
Jonas Schievink
09219e10f1 Mostly restore hir API boundary 2022-01-12 19:56:47 +01:00
bors[bot]
4fe10b7bfe
Merge #11265
11265: fix: Fix postfix completion panic r=lnicola a=Veykril

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

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2022-01-12 12:30:41 +00:00
Lukas Wirth
09ce5d81d0 fix: Fix postfix completion panic 2022-01-12 13:07:16 +01:00
bors[bot]
de50ef4bea
Merge #11263
11263: fix: Fix don't drop param completions when fully typing out a pattern r=Veykril a=Veykril

bors r+

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2022-01-12 11:37:18 +00:00
Lukas Wirth
314b199e3c fix: Fix don't drop param completions when fully typing out a pattern 2022-01-12 12:36:46 +01:00
bors[bot]
54782428a6
Merge #11261
11261: fix: Don't complete attributes with existing expressions r=Veykril a=Veykril

Fixes https://github.com/rust-analyzer/rust-analyzer/issues/11254 due to the comment being lowered to an attribute
bors r+ 

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2022-01-11 18:04:09 +00:00
Lukas Wirth
51419c1931 Don't complete attributes with existing expressions 2022-01-11 19:03:21 +01:00
bors[bot]
a3393c9a57
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>
2022-01-11 14:43:44 +00:00
Jonas Schievink
7e8b96f07c Fix concatenation of super mod paths 2022-01-11 15:39:13 +01:00
bors[bot]
e9d590d63a
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>
2022-01-11 14:17:18 +00:00
bors[bot]
6824722f54
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>
2022-01-11 13:36:53 +00:00
Matt Williams
1ded222c8b
Kate uses rust-analyzer by default 2022-01-11 13:36:06 +00:00
Jonas Schievink
0706de94bb Report DefDiagnostics from inside item bodies 2022-01-11 14:34:25 +01:00
bors[bot]
5a711d4f3a
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>
2022-01-11 09:39:12 +00:00
Lukas Wirth
4901ea3eef Lookup lang attribute on assoc item trait directly 2022-01-11 10:28:38 +01:00
Lukas Wirth
94b369faa3 Update tests 2022-01-11 09:26:53 +01:00
Lukas Wirth
ca0633c808 feat: Deprioritize ops methods in completion 2022-01-11 09:26:53 +01:00
bors[bot]
85bcca6b37
Merge #11252
11252: Fix documentation of snippet r=Veykril a=weirane

Closes #11234

Co-authored-by: Wang Ruochen <wrc@ruo-chen.wang>
2022-01-11 08:11:55 +00:00
Wang Ruochen
01b3ce3006
Fix documentation of snippet 2022-01-10 21:29:41 -08:00
bors[bot]
8dd58ceb7b
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>
2022-01-10 15:56:54 +00:00
Jonas Schievink
601dc50b5a Print a single ellipsis for any number of omitted types 2022-01-10 16:55:53 +01:00
bors[bot]
0f8c96c926
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>
2022-01-08 14:46:01 +00:00
Jonas Schievink
3dd5e273b6 Shrink diagnostic spans for errors inside macros 2022-01-08 15:40:42 +01:00
Jonas Schievink
67f548d8e9 Allow doc comments on all Items 2022-01-08 15:27:48 +01:00
bors[bot]
ca8bd3ec42
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>
2022-01-08 13:55:18 +00:00
Lukas Wirth
b32f611b6e fix: Fix outline modules spilling inner doc injections into their parent 2022-01-08 14:54:31 +01:00
bors[bot]
01c3303270
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>
2022-01-08 11:17:56 +00:00
Lukas Wirth
47591f0fb2 Remove InFile wrapping from DynMap keys 2022-01-08 12:16:44 +01:00
Lukas Wirth
b6826e9246 Only add generics with the correct file id to DynMap 2022-01-08 11:34:58 +01:00
bors[bot]
926ba99f43
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>
2022-01-08 10:11:37 +00:00
Lukas Wirth
8d4f40e881 Do less allocs in trait_data and impl_data queries 2022-01-08 11:04:16 +01:00
Lukas Wirth
6746ba5839 Record attribute calls on assoc items in TraitData and ImplData 2022-01-08 10:45:12 +01:00
bors[bot]
c17db9fa53
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>
2022-01-08 09:05:09 +00:00