]>
git.lizzy.rs Git - rust.git/log
Maybe Waffle [Thu, 27 Jan 2022 20:34:33 +0000 (23:34 +0300)]
Add `crate_limits` query to `SourceDatabase`
This allows fetching crate limits like `recursion_limit`. The
implementation is currently dummy and just returns the defaults.
Future work: Use this query instead of the hardcoded constant.
Future work: Actually implement this query by parsing
`#![recursion_limit = N]` attribute.
bors[bot] [Thu, 27 Jan 2022 22:26:34 +0000 (22:26 +0000)]
Merge #11288
11288: Support <code> blocks from Rust docs in vscode hover r=oandrew a=oandrew
Set `"supportHtml": true` to support rendering `<code>` blocks in hovers.
e.g. https://github.com/rust-lang/rust/blob/
1bd4fdc943513e1004f498bbf289279c9784fc6f /library/std/src/fs.rs#L109
Co-authored-by: Andrew Onyshchuk <andryk.rv@gmail.com>
Andrew Onyshchuk [Fri, 14 Jan 2022 23:20:35 +0000 (15:20 -0800)]
Support <code> blocks from Rust docs
bors[bot] [Thu, 27 Jan 2022 18:09:08 +0000 (18:09 +0000)]
Merge #11353
11353: Set current working directory for procedural macros r=vlad20012 a=vlad20012
Fixes #11079
Co-authored-by: vlad20012 <beskvlad@gmail.com>
bors[bot] [Thu, 27 Jan 2022 15:59:18 +0000 (15:59 +0000)]
Merge #11354
11354: fix: More correct `$crate` handling in eager macros r=jonas-schievink a=jonas-schievink
Fixes a few of the additional bugs in https://github.com/rust-analyzer/rust-analyzer/issues/10300, but not yet that issue itself.
bors r+
Co-authored-by: Jonas Schievink <jonas.schievink@ferrous-systems.com>
Jonas Schievink [Thu, 27 Jan 2022 15:57:53 +0000 (16:57 +0100)]
More correct `$crate` handling in eager macros
vlad20012 [Thu, 27 Jan 2022 12:54:06 +0000 (15:54 +0300)]
Set current working directory for procedural macros
bors[bot] [Wed, 26 Jan 2022 18:11:47 +0000 (18:11 +0000)]
Merge #11348
11348: fix: Fix merge commit check for git 2.35 r=jonas-schievink a=jonas-schievink
git 2.35 introduces a [change in behavior](https://github.com/git/git/blob/
89bece5c8c96f0b962cfc89e63f82d603fd60bed /Documentation/RelNotes/2.35.0.txt#L330-L333) that breaks this check.
bors r+
Co-authored-by: Jonas Schievink <jonas.schievink@ferrous-systems.com>
Jonas Schievink [Wed, 26 Jan 2022 18:10:39 +0000 (19:10 +0100)]
Fix merge commit check for git 2.35
bors[bot] [Wed, 26 Jan 2022 17:35:51 +0000 (17:35 +0000)]
Merge #11347
11347: fix: Fix resolution of eager macro contents r=jonas-schievink a=jonas-schievink
Eager macros resolve and expand any contained macro invocations before they are expanded. The logic for this was previously pretty broken: any nameres failure would be reported as a generic macro expansion error, so this didn't work correctly with the fixed-point resolution loop. This manifested as spurious errors whenever a non-legacy macro was used in an eager macro (that means *any* path with more than one segment).
After an intense staring contest with the abyss, this PR fixes the basic logic, but some bugs still remain (particularly around `$crate`). As a side-effect, this PR moves `ModPath` into `hir_expand`.
bors r+
Co-authored-by: Jonas Schievink <jonas.schievink@ferrous-systems.com>
Jonas Schievink [Wed, 26 Jan 2022 17:31:07 +0000 (18:31 +0100)]
Fix resolution of eager macro contents
bors[bot] [Wed, 26 Jan 2022 14:14:36 +0000 (14:14 +0000)]
Merge #11345
11345: minor: fix a typo in the style guide r=Veykril a=WaffleLapkin
An example of preferring `<`/`<=` over `>`/`>=` was using `>`.
Co-authored-by: Waffle Maybe <waffle.lapkin@gmail.com>
Waffle Maybe [Wed, 26 Jan 2022 14:07:17 +0000 (17:07 +0300)]
minor: fix a typo in the style guide
bors[bot] [Tue, 25 Jan 2022 16:03:35 +0000 (16:03 +0000)]
Merge #11281
11281: ide: parallel prime caches r=jonas-schievink a=jhgg
cache priming goes brrrr... the successor to #10149
---
this PR implements a parallel cache priming strategy that uses a topological work queue to feed a pool of worker threads the crates to index in parallel.
## todo
- [x] should we keep the old prime caches?
- [x] we should use num_cpus to detect how many cpus to use to prime caches. should we also expose a config for # of worker CPU threads to use?
- [x] something is wonky with cancellation, need to figure it out before this can merge.
Co-authored-by: Jake Heinz <jh@discordapp.com>
bors[bot] [Mon, 24 Jan 2022 16:28:53 +0000 (16:28 +0000)]
Merge #11340
11340: internal: Make syntax bridge fully infallible r=jonas-schievink a=jonas-schievink
bors r+
Co-authored-by: Jonas Schievink <jonas.schievink@ferrous-systems.com>
Jonas Schievink [Mon, 24 Jan 2022 16:27:39 +0000 (17:27 +0100)]
Make syntax bridge fully infallible
bors[bot] [Sun, 23 Jan 2022 16:43:22 +0000 (16:43 +0000)]
Merge #11334
11334: fix: don't panic in semantics due to `cfg_attr` disrupting offsets r=Veykril a=Veykril
Reduces the panic in https://github.com/rust-analyzer/rust-analyzer/issues/11298 to an early return, that means we won't resolve these cases again for now, but this is better than constantly panicking in highlighting and hovering.
bors r+
Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
Lukas Wirth [Sun, 23 Jan 2022 16:29:31 +0000 (17:29 +0100)]
fix: don't panic in semantics due to `cfg_attr` disrupting offsets
Jeroen Vannevel [Sat, 22 Jan 2022 13:28:23 +0000 (13:28 +0000)]
fixed whitespace
Jeroen Vannevel [Sat, 22 Jan 2022 12:25:33 +0000 (12:25 +0000)]
whitespace
Jeroen Vannevel [Sat, 22 Jan 2022 12:17:24 +0000 (12:17 +0000)]
generated docs
Jeroen Vannevel [Sat, 22 Jan 2022 12:10:48 +0000 (12:10 +0000)]
clarify doc
Jeroen Vannevel [Sat, 22 Jan 2022 12:05:35 +0000 (12:05 +0000)]
Support standalone comments
Jeroen Vannevel [Sat, 22 Jan 2022 11:53:13 +0000 (11:53 +0000)]
redundant type specified
Jeroen Vannevel [Sat, 22 Jan 2022 11:51:56 +0000 (11:51 +0000)]
shorter arms
Jeroen Vannevel [Sat, 22 Jan 2022 11:46:41 +0000 (11:46 +0000)]
removed prints
Jeroen Vannevel [Sat, 22 Jan 2022 11:42:03 +0000 (11:42 +0000)]
hacky_block_expr_with_comments
Jeroen Vannevel [Sat, 22 Jan 2022 11:32:26 +0000 (11:32 +0000)]
removed unwrapping from indent
Jeroen Vannevel [Sat, 22 Jan 2022 11:18:17 +0000 (11:18 +0000)]
simplified tail_expr
Jeroen Vannevel [Sat, 22 Jan 2022 10:54:37 +0000 (10:54 +0000)]
removing unwraps
Jeroen Vannevel [Wed, 19 Jan 2022 23:26:30 +0000 (23:26 +0000)]
don't remove the comment token if it's last
Jeroen Vannevel [Wed, 19 Jan 2022 23:21:17 +0000 (23:21 +0000)]
very rough but comments get extracted
Jeroen Vannevel [Tue, 18 Jan 2022 22:21:38 +0000 (22:21 +0000)]
repro
bors[bot] [Sat, 22 Jan 2022 10:02:26 +0000 (10:02 +0000)]
Merge #11330
11330: minor: Bump npm deps r=lnicola a=lnicola
Co-authored-by: Laurențiu Nicola <lnicola@dend.ro>
Laurențiu Nicola [Sat, 22 Jan 2022 09:59:45 +0000 (11:59 +0200)]
Bump npm deps
bors[bot] [Fri, 21 Jan 2022 17:52:08 +0000 (17:52 +0000)]
Merge #11329
11329: minor: Bump deps r=lnicola a=lnicola
bors r+
Co-authored-by: Laurențiu Nicola <lnicola@dend.ro>
Laurențiu Nicola [Fri, 21 Jan 2022 17:51:21 +0000 (19:51 +0200)]
Bump chalk
Laurențiu Nicola [Fri, 21 Jan 2022 17:49:57 +0000 (19:49 +0200)]
Bump pulldown-cmark and pulldown-cmark-to-cmark
Laurențiu Nicola [Fri, 21 Jan 2022 17:44:03 +0000 (19:44 +0200)]
Bump hashbrown
Laurențiu Nicola [Fri, 21 Jan 2022 17:42:04 +0000 (19:42 +0200)]
Bump dashmap
bors[bot] [Fri, 21 Jan 2022 11:59:10 +0000 (11:59 +0000)]
Merge #11327
11327: internal: Remove redundant `Option` from eager macro fns r=jonas-schievink a=jonas-schievink
This isn't needed since `tt::Subtree` already implements `Default`, and an empty expansion is the appropriate default here.
bors r+
Co-authored-by: Jonas Schievink <jonas.schievink@ferrous-systems.com>
Jonas Schievink [Fri, 21 Jan 2022 11:58:06 +0000 (12:58 +0100)]
Remove redundant `Option` from eager macro fns
bors[bot] [Wed, 19 Jan 2022 20:01:41 +0000 (20:01 +0000)]
Merge #11321
11321: Remove spurious format r=lnicola a=schuyler-cohen-zipline
Co-authored-by: Schuyler Cohen <schuyler.cohen@flyzipline.com>
Schuyler Cohen [Wed, 19 Jan 2022 19:37:25 +0000 (13:37 -0600)]
Remove spurious format
bors[bot] [Wed, 19 Jan 2022 10:31:27 +0000 (10:31 +0000)]
Merge #11314
11314: fix: Don't load auxiliary crates outside the workspace r=jonas-schievink a=jonas-schievink
I'm a bit unsure about this change since this might have unanticipated consequences, but this does fix https://github.com/rust-analyzer/rust-analyzer/issues/11300.
Co-authored-by: Jonas Schievink <jonas.schievink@ferrous-systems.com>
Jonas Schievink [Tue, 18 Jan 2022 17:27:29 +0000 (18:27 +0100)]
Update tests
We're now omitting the libc crate's build script and const_fn test
Jonas Schievink [Tue, 18 Jan 2022 17:17:43 +0000 (18:17 +0100)]
Don't load auxiliary crates outside the workspace
bors[bot] [Tue, 18 Jan 2022 07:55:56 +0000 (07:55 +0000)]
Merge #11310
11310: fix: remove pipe from surroundingPairs r=lnicola a=chrisprice
Closes https://github.com/rust-analyzer/rust-analyzer/issues/11192
Co-authored-by: Chris Price <price.c@gmail.com>
bors[bot] [Mon, 17 Jan 2022 23:57:30 +0000 (23:57 +0000)]
Merge #11311
11311: fix: insert auto-imports after header comments r=repnop a=repnop
Fixes #8607.
This commit changes the auto-import functionality and causes it to add imports after any leading comments, which are commonly license headers. This does not affect comments on items as they're considered part of the item itself and not separate.
Co-authored-by: Wesley Norris <repnop@outlook.com>
Wesley Norris [Mon, 17 Jan 2022 23:44:43 +0000 (18:44 -0500)]
Add test for comments not directly next to items
Wesley Norris [Mon, 17 Jan 2022 22:12:32 +0000 (17:12 -0500)]
Add a test for multi-single-line comments as well
Wesley Norris [Mon, 17 Jan 2022 22:06:10 +0000 (17:06 -0500)]
fix: insert auto-imports after header comments
Fixes #8607.
This commit changes the auto-import functionality and causes it to add
imports after any leading comments, which are commonly license headers.
This does not affect comments on items as they're considered part of the
item itself and not separate.
Chris Price [Mon, 17 Jan 2022 20:08:39 +0000 (20:08 +0000)]
fix: remove pipe from surroundingPairs
Closes https://github.com/rust-analyzer/rust-analyzer/issues/11192
bors[bot] [Mon, 17 Jan 2022 17:12:14 +0000 (17:12 +0000)]
Merge #11308
11308: fix: status: output all crates a file belongs to r=jonas-schievink a=jonas-schievink
While investigating https://github.com/rust-analyzer/rust-analyzer/issues/11300 I noticed that we only output the first crate, which masks the reason for that issue – the file in question is the root of multiple crates, and one is missing dependencies.
This PR makes "Rust Analyzer: Status" include *every* crate a file is part of.
bors r+
Co-authored-by: Jonas Schievink <jonas.schievink@ferrous-systems.com>
Jonas Schievink [Mon, 17 Jan 2022 17:10:01 +0000 (18:10 +0100)]
status: output all crates a file belongs to
bors[bot] [Mon, 17 Jan 2022 15:53:43 +0000 (15:53 +0000)]
Merge #11307
11307: fix: Allow macros to expand to or-patterns r=jonas-schievink a=jonas-schievink
Fixes https://github.com/rust-analyzer/rust-analyzer/issues/11097
Also simplifies the diagnostic slightly.
bors r+
Co-authored-by: Jonas Schievink <jonas.schievink@ferrous-systems.com>
Jonas Schievink [Mon, 17 Jan 2022 15:52:53 +0000 (16:52 +0100)]
Allow macros to expand to or-patterns
bors[bot] [Mon, 17 Jan 2022 07:31:19 +0000 (07:31 +0000)]
Merge #11304
11304: fix: Temporarily disable format string completions r=lnicola a=lnicola
CC #11303
bors r+
Co-authored-by: Laurențiu Nicola <lnicola@dend.ro>
Laurențiu Nicola [Mon, 17 Jan 2022 07:18:40 +0000 (09:18 +0200)]
Temporarily disable format string completions
bors[bot] [Sun, 16 Jan 2022 15:13:52 +0000 (15:13 +0000)]
Merge #11287
11287: fix: rust-analyzer spamming overly error message when workspace not being loaded r=lnicola a=Milo123459
Fixes #10120
Co-authored-by: Milo <50248166+Milo123459@users.noreply.github.com>
bors[bot] [Sat, 15 Jan 2022 12:18:46 +0000 (12:18 +0000)]
Merge #11294
11294: internal: Move format specifier lexing from syntax to ide_db r=Veykril a=Veykril
bors r+
Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
Lukas Wirth [Sat, 15 Jan 2022 12:14:59 +0000 (13:14 +0100)]
Move format specifier lexing from syntax to ide_db
bors[bot] [Sat, 15 Jan 2022 11:24:21 +0000 (11:24 +0000)]
Merge #11293
11293: feat: Add very simplistic ident completion for format_args! macro input r=Veykril a=Veykril
Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
Lukas Wirth [Sat, 15 Jan 2022 11:12:02 +0000 (12:12 +0100)]
feat: Add very simplistic ident completion for format_args! macro input
bors[bot] [Sat, 15 Jan 2022 10:17:01 +0000 (10:17 +0000)]
Merge #11292
11292: internal: Decrease PartialOrd and PartialEq trait methods completion relevance r=Veykril a=Veykril
Fixes https://github.com/rust-analyzer/rust-analyzer/issues/10245
bors r+
Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
Lukas Wirth [Sat, 15 Jan 2022 09:54:09 +0000 (10:54 +0100)]
internal: Decrease PartialOrd and PartialEq trait methods completion relevance
Jake Heinz [Sat, 15 Jan 2022 02:47:47 +0000 (02:47 +0000)]
make it a config
Milo [Fri, 14 Jan 2022 22:13:45 +0000 (22:13 +0000)]
format
Milo [Fri, 14 Jan 2022 22:06:30 +0000 (22:06 +0000)]
fix overly
bors[bot] [Fri, 14 Jan 2022 19:03:55 +0000 (19:03 +0000)]
Merge #11248
11248: Merge match assist: take arm types into consideration r=Vannevelj a=Vannevelj
Fixes https://github.com/rust-analyzer/rust-analyzer/issues/9337
Co-authored-by: Jeroen Vannevel <jer_vannevel@outlook.com>
Jeroen Vannevel [Fri, 14 Jan 2022 18:53:28 +0000 (18:53 +0000)]
styling fixes
bors[bot] [Fri, 14 Jan 2022 17:50:05 +0000 (17:50 +0000)]
Merge #11286
11286: internal: Clean up assoc item collection a bit r=jonas-schievink a=jonas-schievink
Introduce an `AssocItemCollector` instead of passing a lot of parameters around.
bors r+
Co-authored-by: Jonas Schievink <jonas.schievink@ferrous-systems.com>
Jonas Schievink [Fri, 14 Jan 2022 17:45:23 +0000 (18:45 +0100)]
Clean up assoc item collection a bit
bors[bot] [Fri, 14 Jan 2022 16:53:26 +0000 (16:53 +0000)]
Merge #11284
11284: internal: Remove redundant recursion limit r=jonas-schievink a=jonas-schievink
`Expander` already does this, so we don't have to track the depth when collecting associated items.
bors r+
Co-authored-by: Jonas Schievink <jonas.schievink@ferrous-systems.com>
Jonas Schievink [Fri, 14 Jan 2022 16:45:57 +0000 (17:45 +0100)]
Remove redundant recursion limit
bors[bot] [Fri, 14 Jan 2022 11:16:18 +0000 (11:16 +0000)]
Merge #11283
11283: fix: Adjust `.` typing auto indentation r=Veykril a=Veykril
Fixes https://github.com/rust-analyzer/rust-analyzer/issues/629
bors r+
Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
Lukas Wirth [Fri, 14 Jan 2022 11:15:43 +0000 (12:15 +0100)]
fix: Adjust `.` typing auto indentation
Jake Heinz [Fri, 14 Jan 2022 10:30:51 +0000 (10:30 +0000)]
hacky fix for cancelling
Jake Heinz [Fri, 14 Jan 2022 10:10:47 +0000 (10:10 +0000)]
one last bit of cleanup
bors[bot] [Fri, 14 Jan 2022 10:08:27 +0000 (10:08 +0000)]
Merge #11282
11282: fix: Properly cache files in Semantics when ascending macros r=Veykril a=Veykril
Fixes https://github.com/rust-analyzer/rust-analyzer/issues/11280
bors r+
Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
Lukas Wirth [Fri, 14 Jan 2022 10:07:53 +0000 (11:07 +0100)]
fix: Properly cache files in Semantics when ascending macros
Jake Heinz [Fri, 14 Jan 2022 10:06:28 +0000 (10:06 +0000)]
removed scoped threads, cleanup
Lukas Wirth [Fri, 14 Jan 2022 09:59:27 +0000 (10:59 +0100)]
Replace HasSource usages with Semantics equivalent
Jake Heinz [Fri, 14 Jan 2022 09:48:59 +0000 (09:48 +0000)]
cleanup + detect num cpus
Jake Heinz [Fri, 14 Jan 2022 09:36:03 +0000 (09:36 +0000)]
cleanup
Jake Heinz [Fri, 14 Jan 2022 09:35:41 +0000 (09:35 +0000)]
use index map
Jake Heinz [Fri, 14 Jan 2022 09:33:40 +0000 (09:33 +0000)]
make progress callback dyn
Jake Heinz [Fri, 14 Jan 2022 09:25:45 +0000 (09:25 +0000)]
fix warnings
Jake Heinz [Fri, 14 Jan 2022 09:21:25 +0000 (09:21 +0000)]
simplify
Jake Heinz [Fri, 14 Jan 2022 09:11:47 +0000 (09:11 +0000)]
ide: parallel prime caches
Jeroen Vannevel [Fri, 14 Jan 2022 01:26:17 +0000 (01:26 +0000)]
simple return
Jeroen Vannevel [Fri, 14 Jan 2022 01:22:48 +0000 (01:22 +0000)]
formatting
Jeroen Vannevel [Fri, 14 Jan 2022 01:22:19 +0000 (01:22 +0000)]
removed toy
Jeroen Vannevel [Fri, 14 Jan 2022 01:20:40 +0000 (01:20 +0000)]
happy slice
Jeroen Vannevel [Fri, 14 Jan 2022 01:18:03 +0000 (01:18 +0000)]
refpat & slicepat
Jeroen Vannevel [Fri, 14 Jan 2022 00:39:44 +0000 (00:39 +0000)]
ParenPat
Jeroen Vannevel [Fri, 14 Jan 2022 00:35:21 +0000 (00:35 +0000)]
support TuplePat
Jeroen Vannevel [Tue, 11 Jan 2022 21:53:39 +0000 (21:53 +0000)]
battle of the Some
Jeroen Vannevel [Tue, 11 Jan 2022 21:50:42 +0000 (21:50 +0000)]
cleaning up Some
Jeroen Vannevel [Tue, 11 Jan 2022 21:44:30 +0000 (21:44 +0000)]
removed unwrap