]> git.lizzy.rs Git - rust.git/log
rust.git
2 years agoMerge #11281
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>
2 years agoMerge #11340
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>
2 years agoMake syntax bridge fully infallible
Jonas Schievink [Mon, 24 Jan 2022 16:27:39 +0000 (17:27 +0100)]
Make syntax bridge fully infallible

2 years agoMerge #11334
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>
2 years agofix: don't panic in semantics due to `cfg_attr` disrupting offsets
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

2 years agoMerge #11330
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>
2 years agoBump npm deps
Laurențiu Nicola [Sat, 22 Jan 2022 09:59:45 +0000 (11:59 +0200)]
Bump npm deps

2 years agoMerge #11329
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>
2 years agoBump chalk
Laurențiu Nicola [Fri, 21 Jan 2022 17:51:21 +0000 (19:51 +0200)]
Bump chalk

2 years agoBump pulldown-cmark and pulldown-cmark-to-cmark
Laurențiu Nicola [Fri, 21 Jan 2022 17:49:57 +0000 (19:49 +0200)]
Bump pulldown-cmark and pulldown-cmark-to-cmark

2 years agoBump hashbrown
Laurențiu Nicola [Fri, 21 Jan 2022 17:44:03 +0000 (19:44 +0200)]
Bump hashbrown

2 years agoBump dashmap
Laurențiu Nicola [Fri, 21 Jan 2022 17:42:04 +0000 (19:42 +0200)]
Bump dashmap

2 years agoMerge #11327
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>
2 years agoRemove redundant `Option` from eager macro fns
Jonas Schievink [Fri, 21 Jan 2022 11:58:06 +0000 (12:58 +0100)]
Remove redundant `Option` from eager macro fns

2 years agoMerge #11321
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>
2 years agoRemove spurious format
Schuyler Cohen [Wed, 19 Jan 2022 19:37:25 +0000 (13:37 -0600)]
Remove spurious format

2 years agoMerge #11314
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>
2 years agoUpdate tests
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

2 years agoDon't load auxiliary crates outside the workspace
Jonas Schievink [Tue, 18 Jan 2022 17:17:43 +0000 (18:17 +0100)]
Don't load auxiliary crates outside the workspace

2 years agoMerge #11310
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>
2 years agoMerge #11311
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>
2 years agoAdd test for comments not directly next to items
Wesley Norris [Mon, 17 Jan 2022 23:44:43 +0000 (18:44 -0500)]
Add test for comments not directly next to items

2 years agoAdd a test for multi-single-line comments as well
Wesley Norris [Mon, 17 Jan 2022 22:12:32 +0000 (17:12 -0500)]
Add a test for multi-single-line comments as well

2 years agofix: insert auto-imports after header comments
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.

2 years agofix: remove pipe from surroundingPairs
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

2 years agoMerge #11308
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>
2 years agostatus: output all crates a file belongs to
Jonas Schievink [Mon, 17 Jan 2022 17:10:01 +0000 (18:10 +0100)]
status: output all crates a file belongs to

2 years agoMerge #11307
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>
2 years agoAllow macros to expand to or-patterns
Jonas Schievink [Mon, 17 Jan 2022 15:52:53 +0000 (16:52 +0100)]
Allow macros to expand to or-patterns

2 years agoMerge #11304
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>
2 years agoTemporarily disable format string completions
Laurențiu Nicola [Mon, 17 Jan 2022 07:18:40 +0000 (09:18 +0200)]
Temporarily disable format string completions

2 years agoMerge #11287
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>
2 years agoMerge #11294
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>
2 years agoMove format specifier lexing from syntax to ide_db
Lukas Wirth [Sat, 15 Jan 2022 12:14:59 +0000 (13:14 +0100)]
Move format specifier lexing from syntax to ide_db

2 years agoMerge #11293
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>
2 years agofeat: Add very simplistic ident completion for format_args! macro input
Lukas Wirth [Sat, 15 Jan 2022 11:12:02 +0000 (12:12 +0100)]
feat: Add very simplistic ident completion for format_args! macro input

2 years agoMerge #11292
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>
2 years agointernal: Decrease PartialOrd and PartialEq trait methods completion relevance
Lukas Wirth [Sat, 15 Jan 2022 09:54:09 +0000 (10:54 +0100)]
internal: Decrease PartialOrd and PartialEq trait methods completion relevance

2 years agomake it a config
Jake Heinz [Sat, 15 Jan 2022 02:47:47 +0000 (02:47 +0000)]
make it a config

2 years agoformat
Milo [Fri, 14 Jan 2022 22:13:45 +0000 (22:13 +0000)]
format

2 years agofix overly
Milo [Fri, 14 Jan 2022 22:06:30 +0000 (22:06 +0000)]
fix overly

2 years agoMerge #11248
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>
2 years agostyling fixes
Jeroen Vannevel [Fri, 14 Jan 2022 18:53:28 +0000 (18:53 +0000)]
styling fixes

2 years agoMerge #11286
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>
2 years agoClean up assoc item collection a bit
Jonas Schievink [Fri, 14 Jan 2022 17:45:23 +0000 (18:45 +0100)]
Clean up assoc item collection a bit

2 years agoMerge #11284
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>
2 years agoRemove redundant recursion limit
Jonas Schievink [Fri, 14 Jan 2022 16:45:57 +0000 (17:45 +0100)]
Remove redundant recursion limit

2 years agoMerge #11283
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>
2 years agofix: Adjust `.` typing auto indentation
Lukas Wirth [Fri, 14 Jan 2022 11:15:43 +0000 (12:15 +0100)]
fix: Adjust `.` typing auto indentation

2 years agohacky fix for cancelling
Jake Heinz [Fri, 14 Jan 2022 10:30:51 +0000 (10:30 +0000)]
hacky fix for cancelling

2 years agoone last bit of cleanup
Jake Heinz [Fri, 14 Jan 2022 10:10:47 +0000 (10:10 +0000)]
one last bit of cleanup

2 years agoMerge #11282
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>
2 years agofix: Properly cache files in Semantics when ascending macros
Lukas Wirth [Fri, 14 Jan 2022 10:07:53 +0000 (11:07 +0100)]
fix: Properly cache files in Semantics when ascending macros

2 years agoremoved scoped threads, cleanup
Jake Heinz [Fri, 14 Jan 2022 10:06:28 +0000 (10:06 +0000)]
removed scoped threads, cleanup

2 years agoReplace HasSource usages with Semantics equivalent
Lukas Wirth [Fri, 14 Jan 2022 09:59:27 +0000 (10:59 +0100)]
Replace HasSource usages with Semantics equivalent

2 years agocleanup + detect num cpus
Jake Heinz [Fri, 14 Jan 2022 09:48:59 +0000 (09:48 +0000)]
cleanup + detect num cpus

2 years agocleanup
Jake Heinz [Fri, 14 Jan 2022 09:36:03 +0000 (09:36 +0000)]
cleanup

2 years agouse index map
Jake Heinz [Fri, 14 Jan 2022 09:35:41 +0000 (09:35 +0000)]
use index map

2 years agomake progress callback dyn
Jake Heinz [Fri, 14 Jan 2022 09:33:40 +0000 (09:33 +0000)]
make progress callback dyn

2 years agofix warnings
Jake Heinz [Fri, 14 Jan 2022 09:25:45 +0000 (09:25 +0000)]
fix warnings

2 years agosimplify
Jake Heinz [Fri, 14 Jan 2022 09:21:25 +0000 (09:21 +0000)]
simplify

2 years agoide: parallel prime caches
Jake Heinz [Fri, 14 Jan 2022 09:11:47 +0000 (09:11 +0000)]
ide: parallel prime caches

2 years agosimple return
Jeroen Vannevel [Fri, 14 Jan 2022 01:26:17 +0000 (01:26 +0000)]
simple return

2 years agoformatting
Jeroen Vannevel [Fri, 14 Jan 2022 01:22:48 +0000 (01:22 +0000)]
formatting

2 years agoremoved toy
Jeroen Vannevel [Fri, 14 Jan 2022 01:22:19 +0000 (01:22 +0000)]
removed toy

2 years agohappy slice
Jeroen Vannevel [Fri, 14 Jan 2022 01:20:40 +0000 (01:20 +0000)]
happy slice

2 years agorefpat & slicepat
Jeroen Vannevel [Fri, 14 Jan 2022 01:18:03 +0000 (01:18 +0000)]
refpat & slicepat

2 years agoParenPat
Jeroen Vannevel [Fri, 14 Jan 2022 00:39:44 +0000 (00:39 +0000)]
ParenPat

2 years agosupport TuplePat
Jeroen Vannevel [Fri, 14 Jan 2022 00:35:21 +0000 (00:35 +0000)]
support TuplePat

2 years agobattle of the Some
Jeroen Vannevel [Tue, 11 Jan 2022 21:53:39 +0000 (21:53 +0000)]
battle of the Some

2 years agocleaning up Some
Jeroen Vannevel [Tue, 11 Jan 2022 21:50:42 +0000 (21:50 +0000)]
cleaning up Some

2 years agoremoved unwrap
Jeroen Vannevel [Tue, 11 Jan 2022 21:44:30 +0000 (21:44 +0000)]
removed unwrap

2 years agoformatting
Jeroen Vannevel [Tue, 11 Jan 2022 21:40:57 +0000 (21:40 +0000)]
formatting

2 years agoremoved prints
Jeroen Vannevel [Tue, 11 Jan 2022 21:40:22 +0000 (21:40 +0000)]
removed prints

2 years agoall tests work
Jeroen Vannevel [Tue, 11 Jan 2022 21:39:50 +0000 (21:39 +0000)]
all tests work

2 years agomerge_match_arms_nested_with_conflicting_identifier
Jeroen Vannevel [Tue, 11 Jan 2022 20:17:47 +0000 (20:17 +0000)]
merge_match_arms_nested_with_conflicting_identifier

2 years agoAdded a few more test cases
Jeroen Vannevel [Tue, 11 Jan 2022 20:05:56 +0000 (20:05 +0000)]
Added a few more test cases

2 years agofixed test case
Jeroen Vannevel [Mon, 10 Jan 2022 23:10:09 +0000 (23:10 +0000)]
fixed test case

2 years agotest for different number of fields
Jeroen Vannevel [Mon, 10 Jan 2022 18:54:59 +0000 (18:54 +0000)]
test for different number of fields

2 years agotest cases with more branches
Jeroen Vannevel [Mon, 10 Jan 2022 18:46:47 +0000 (18:46 +0000)]
test cases with more branches

2 years agosimplified chain
Jeroen Vannevel [Mon, 10 Jan 2022 18:38:17 +0000 (18:38 +0000)]
simplified chain

2 years agodon't need the as_ref()
Jeroen Vannevel [Mon, 10 Jan 2022 18:33:28 +0000 (18:33 +0000)]
don't need the as_ref()

2 years agoextracted function
Jeroen Vannevel [Mon, 10 Jan 2022 18:30:27 +0000 (18:30 +0000)]
extracted function

2 years agoadded tests for multiple fields
Jeroen Vannevel [Mon, 10 Jan 2022 18:24:36 +0000 (18:24 +0000)]
added tests for multiple fields

2 years agousing classify()
Jeroen Vannevel [Mon, 10 Jan 2022 18:19:37 +0000 (18:19 +0000)]
using classify()

2 years agoremoved some unused stuff
Jeroen Vannevel [Mon, 10 Jan 2022 18:14:29 +0000 (18:14 +0000)]
removed some unused stuff

2 years agominicore
Jeroen Vannevel [Mon, 10 Jan 2022 12:44:45 +0000 (12:44 +0000)]
minicore

2 years agocompiles, but doesn't work yet
Jeroen Vannevel [Fri, 7 Jan 2022 23:44:14 +0000 (23:44 +0000)]
compiles, but doesn't work yet

2 years agoMerge #11276
bors[bot] [Thu, 13 Jan 2022 19:18:47 +0000 (19:18 +0000)]
Merge #11276

11276: internal: Slightly cleanup HasFormatSpecifier::lex_format_specifier r=Veykril a=Veykril

bors r+

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2 years agoMerge #11277
bors[bot] [Thu, 13 Jan 2022 19:08:38 +0000 (19:08 +0000)]
Merge #11277

11277: minor: reformat and fix warning r=lnicola a=lnicola

bors r+

Co-authored-by: Laurențiu Nicola <lnicola@dend.ro>
2 years agoRemove duplicate test attribute
Laurențiu Nicola [Thu, 13 Jan 2022 19:08:04 +0000 (21:08 +0200)]
Remove duplicate test attribute

2 years agoReformat code
Laurențiu Nicola [Thu, 13 Jan 2022 19:07:17 +0000 (21:07 +0200)]
Reformat code

2 years agoSlightly cleanup HasFormatSpecifier::lex_format_specifier
Lukas Wirth [Thu, 13 Jan 2022 18:12:39 +0000 (19:12 +0100)]
Slightly cleanup HasFormatSpecifier::lex_format_specifier

2 years agoMerge #11274
bors[bot] [Thu, 13 Jan 2022 15:19:03 +0000 (15:19 +0000)]
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>
2 years agoUnexport `MacroDefId` from `hir`
Jonas Schievink [Thu, 13 Jan 2022 15:18:05 +0000 (16:18 +0100)]
Unexport `MacroDefId` from `hir`

2 years agoMerge #11267
bors[bot] [Wed, 12 Jan 2022 19:22:15 +0000 (19:22 +0000)]
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>
2 years agoRemove `ModuleId` from `hir` reexports
Jonas Schievink [Wed, 12 Jan 2022 19:19:10 +0000 (20:19 +0100)]
Remove `ModuleId` from `hir` reexports

2 years agoMerge #11266
bors[bot] [Wed, 12 Jan 2022 18:58:24 +0000 (18:58 +0000)]
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>
2 years agoMostly restore `hir` API boundary
Jonas Schievink [Wed, 12 Jan 2022 18:56:47 +0000 (19:56 +0100)]
Mostly restore `hir` API boundary

2 years agoMerge #11265
bors[bot] [Wed, 12 Jan 2022 12:30:41 +0000 (12:30 +0000)]
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>