]> git.lizzy.rs Git - rust.git/log
rust.git
2 years agoMerge #11411
bors[bot] [Fri, 4 Feb 2022 13:36:34 +0000 (13:36 +0000)]
Merge #11411

11411: minor: Simplify r=Veykril a=Veykril

bors r+

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2 years agoSimplify
Lukas Wirth [Fri, 4 Feb 2022 01:50:33 +0000 (02:50 +0100)]
Simplify

2 years agoMerge #11406
bors[bot] [Thu, 3 Feb 2022 20:11:18 +0000 (20:11 +0000)]
Merge #11406

11406: Update install notes for bundled servers r=stanciuadrian a=lnicola

r? `@stanciuadrian`

Co-authored-by: Laurențiu Nicola <lnicola@dend.ro>
2 years agoUpdate install notes
Laurențiu Nicola [Thu, 3 Feb 2022 19:54:23 +0000 (21:54 +0200)]
Update install notes

2 years agoMerge #11403
bors[bot] [Thu, 3 Feb 2022 16:30:01 +0000 (16:30 +0000)]
Merge #11403

11403: internal: Shrink `mbe::ExpandError` and `mbe::ParseError` r=Veykril a=Veykril

Also fixes https://github.com/rust-analyzer/rust-analyzer/issues/10051, as we no longer emit an empty diagnostic in some expansion cases which seems to trip up vscode for some reason. Using `compile_error!("")` will still trigger the vscode bug.
bors r+

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2 years agoShrink `mbe::ExpandError` and `mbe::ParseError`
Lukas Wirth [Thu, 3 Feb 2022 16:25:24 +0000 (17:25 +0100)]
Shrink `mbe::ExpandError` and `mbe::ParseError`

2 years agoMerge #11402
bors[bot] [Thu, 3 Feb 2022 16:02:51 +0000 (16:02 +0000)]
Merge #11402

11402: fix: Fix vis restriction path completions always using the parent module r=Veykril a=Veykril

bors r+

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2 years agofix: Fix vis restriction path completions always using the parent module
Lukas Wirth [Thu, 3 Feb 2022 16:02:12 +0000 (17:02 +0100)]
fix: Fix vis restriction path completions always using the parent module

2 years agoMerge #11401
bors[bot] [Thu, 3 Feb 2022 15:38:45 +0000 (15:38 +0000)]
Merge #11401

11401: Sort completion calls lexicographically r=Veykril a=Veykril

bors r+

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2 years agoAdd abi string completions
Lukas Wirth [Thu, 3 Feb 2022 15:29:23 +0000 (16:29 +0100)]
Add abi string completions

2 years agoSort completion calls lexicographically
Lukas Wirth [Thu, 3 Feb 2022 15:05:21 +0000 (16:05 +0100)]
Sort completion calls lexicographically

2 years agoMerge #11397
bors[bot] [Thu, 3 Feb 2022 15:01:08 +0000 (15:01 +0000)]
Merge #11397

11397: internal: Refactor completion module split r=Veykril a=Veykril

Currently our completion infra is split into several modules, each trying to do completions for something specific. This "something" is rather unstructured as it stands now, we have a module for `flyimporting path` completions, `unqualified` and `qualified path` completions, modules for `pattern position` completions that only try to complete extra things for patterns that aren't done in the path modules, `attribute` completions that again only try to add builtin attribute completions without adding the normal path completions and a bunch of other special "entity" completions like lifetimes, method call/field access, function param cloning, ... which serve a more specific purpose than the previous listed ones.

As is evident, the former mentioned ones have some decent overlap which requires extra filtering in them so that they don't collide with each other duplicating a bunch of completions(which we had happen in the past at times).

Now this overlap mostly happens with path completions(and keyword completions as well in some sense) which gives me the feeling that having `qualified` and `unqualified` path completions be separate from the rest gives us more troubles than benefits in the long run.
So this is an attempt at changing this structure to instead still go by rough entity for special cases, but when it comes to paths we instead do the module split on the "path kinds"/"locations"(think pattern, type, expr position etc) that exist. This goes hand in hand with the test refactoring I have done that moved tests to "location oriented" modules as well as the `CompletionContext` refactoring that actually already started splitting the context up for path kinds.

This PR moves some path completions out of the `qualified` and `unqualified` path modules namely attribute, visibility, use and pattern paths.

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2 years agoSimplify
Lukas Wirth [Wed, 2 Feb 2022 17:18:08 +0000 (18:18 +0100)]
Simplify

2 years agoMove path completions for patterns into pattern module
Lukas Wirth [Wed, 2 Feb 2022 17:09:30 +0000 (18:09 +0100)]
Move path completions for patterns into pattern module

2 years agoCleanup PathCompletionContext qualifier handling
Lukas Wirth [Wed, 2 Feb 2022 15:01:46 +0000 (16:01 +0100)]
Cleanup PathCompletionContext qualifier handling

2 years agoAdd missing test for use completions
Lukas Wirth [Wed, 2 Feb 2022 14:28:23 +0000 (15:28 +0100)]
Add missing test for use completions

2 years agoAdd completion module tailored towards visibility modifiers
Lukas Wirth [Wed, 2 Feb 2022 14:14:43 +0000 (15:14 +0100)]
Add completion module tailored towards visibility modifiers

2 years agoAdd completion module tailored towards use trees
Lukas Wirth [Wed, 2 Feb 2022 14:03:46 +0000 (15:03 +0100)]
Add completion module tailored towards use trees

2 years agoMove attribute path completions into attribute completion module
Lukas Wirth [Wed, 2 Feb 2022 12:35:46 +0000 (13:35 +0100)]
Move attribute path completions into attribute completion module

2 years agoMerge #11399
bors[bot] [Thu, 3 Feb 2022 12:21:18 +0000 (12:21 +0000)]
Merge #11399

11399: Fix assoc type shorthand from method bounds r=flodiebold a=flodiebold

In code like this:
```rust
impl<T> Option<T> {
    fn as_deref(&self) -> T::Target where T: Deref {}
}
```

when trying to resolve the associated type `T::Target`, we were only
looking at the bounds on the impl (where the type parameter is defined),
but the method can add additional bounds that can also be used to refer
to associated types. Hence, when resolving such an associated type, it's
not enough to just know the type parameter T, we also need to know
exactly where we are currently.

This fixes #11364 (beta apparently switched some bounds around).

Co-authored-by: Florian Diebold <flodiebold@gmail.com>
2 years agoFix assoc type shorthand from method bounds
Florian Diebold [Thu, 3 Feb 2022 11:43:15 +0000 (12:43 +0100)]
Fix assoc type shorthand from method bounds

In code like this:
```rust
impl<T> Option<T> {
    fn as_deref(&self) -> T::Target where T: Deref {}
}
```

when trying to resolve the associated type `T::Target`, we were only
looking at the bounds on the impl (where the type parameter is defined),
but the method can add additional bounds that can also be used to refer
to associated types. Hence, when resolving such an associated type, it's
not enough to just know the type parameter T, we also need to know
exactly where we are currently.

This fixes #11364 (beta apparently switched some bounds around).

2 years agoMerge #11394
bors[bot] [Wed, 2 Feb 2022 11:42:40 +0000 (11:42 +0000)]
Merge #11394

11394: feat: Deprioritize completions of private but editable definitions r=Veykril a=Veykril

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2 years agoFix test fixture
Lukas Wirth [Wed, 2 Feb 2022 11:42:13 +0000 (12:42 +0100)]
Fix test fixture

2 years agoMerge #11395
bors[bot] [Wed, 2 Feb 2022 11:20:38 +0000 (11:20 +0000)]
Merge #11395

11395: fix: Fix and re-enable format string completions r=Veykril a=Veykril

bors r+

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2 years agofix: Fix and re-enable format string completions
Lukas Wirth [Wed, 2 Feb 2022 11:20:10 +0000 (12:20 +0100)]
fix: Fix and re-enable format string completions

2 years agoCleanup `Completions` api a bit
Lukas Wirth [Wed, 2 Feb 2022 11:05:21 +0000 (12:05 +0100)]
Cleanup `Completions` api a bit

2 years agoFix generate_function assist trying to use name-ref like keywords for names
Lukas Wirth [Wed, 2 Feb 2022 10:37:24 +0000 (11:37 +0100)]
Fix generate_function assist trying to use name-ref like keywords for names

2 years agofeat: Deprioritize completions of private but editable definitions
Lukas Wirth [Wed, 2 Feb 2022 01:05:49 +0000 (02:05 +0100)]
feat: Deprioritize completions of private but editable definitions

2 years agoMerge #11322
bors[bot] [Tue, 1 Feb 2022 23:05:28 +0000 (23:05 +0000)]
Merge #11322

11322: Extract function also extracts comments r=Vannevelj a=Vannevelj

Fixes #9011

The difficulty I came across is that the original assist works from the concept of a `ast::StmtList`, a node, but that does not allow me to (easily) represent comments, which are tokens. To combat this, I do a whole bunch of roundtrips: from the `ast::StmtList` I retrieve the `NodeOrToken`s it encompasses.

I then cast all `Node` ones back to a `Stmt` so I can apply indentation to it, after which it is again parsed as a `NodeOrToken`.

Lastly, I add a new `make::` api that accepts `NodeOrToken` rather than `StmtList` so we can write the comment tokens.

Co-authored-by: Jeroen Vannevel <jer_vannevel@outlook.com>
2 years agoMerge #11393
bors[bot] [Tue, 1 Feb 2022 22:48:34 +0000 (22:48 +0000)]
Merge #11393

11393: fix: Complete functions and methods from block level impls r=Veykril a=Veykril

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

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2 years agorollup match
Jeroen Vannevel [Tue, 1 Feb 2022 22:38:37 +0000 (22:38 +0000)]
rollup match

2 years agofix: Complete functions and methods from block level impls
Lukas Wirth [Tue, 1 Feb 2022 22:29:40 +0000 (23:29 +0100)]
fix: Complete functions and methods from block level impls

2 years agoMerge #11391
bors[bot] [Tue, 1 Feb 2022 12:35:52 +0000 (12:35 +0000)]
Merge #11391

11391: minor: Add some debug traces for cfg fetching r=Veykril a=Veykril

bors r+

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2 years agominor: Add some debug traces for cfg fetching
Lukas Wirth [Tue, 1 Feb 2022 12:32:09 +0000 (13:32 +0100)]
minor: Add some debug traces for cfg fetching

2 years agoMerge #11390
bors[bot] [Tue, 1 Feb 2022 11:34:40 +0000 (11:34 +0000)]
Merge #11390

11390: fix: Deprioritize ops function completions for non-method calls r=Veykril a=Veykril

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

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2 years agoDeprioritize ops function completions for non-method calls
Lukas Wirth [Tue, 1 Feb 2022 11:33:55 +0000 (12:33 +0100)]
Deprioritize ops function completions for non-method calls

2 years agobetter comparison
Jeroen Vannevel [Tue, 1 Feb 2022 09:00:30 +0000 (09:00 +0000)]
better comparison

2 years agoremoved redundant test
Jeroen Vannevel [Tue, 1 Feb 2022 00:38:33 +0000 (00:38 +0000)]
removed redundant test

2 years agoadded FIXME
Jeroen Vannevel [Tue, 1 Feb 2022 00:37:48 +0000 (00:37 +0000)]
added FIXME

2 years agodon't tear body
Jeroen Vannevel [Tue, 1 Feb 2022 00:36:50 +0000 (00:36 +0000)]
don't tear body

2 years agono longer support comments on their own
Jeroen Vannevel [Tue, 1 Feb 2022 00:21:35 +0000 (00:21 +0000)]
no longer support comments on their own

2 years agoMerge #11388
bors[bot] [Mon, 31 Jan 2022 16:03:23 +0000 (16:03 +0000)]
Merge #11388

11388: fix: Fix proc-macro server not using the supplied span in Ident::new r=Veykril a=Veykril

This makes the hack introduced by https://github.com/rust-analyzer/rust-analyzer/pull/10899 obsolete.

For async-trait specifically, (unfortunately, but technically correct) due to how async-trait works, the self local now renders white, as it now resolves to the `__self` local introduced by the attribute.

![Code_0Ezw6PJAbh](https://user-images.githubusercontent.com/3757771/151827812-c03b8fc7-7ecf-4959-804a-2680d8e61e8b.png)
bors r+

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2 years agofix: Fix proc-macro server not using the supplied span in Ident::new
Lukas Wirth [Mon, 31 Jan 2022 15:56:33 +0000 (16:56 +0100)]
fix: Fix proc-macro server not using the supplied span in Ident::new

2 years agoMerge #11291
bors[bot] [Mon, 31 Jan 2022 15:22:42 +0000 (15:22 +0000)]
Merge #11291

11291: internal: Make more precise range macro upmapping r=Veykril a=Veykril

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2 years agoMake more precise range macro upmapping
Lukas Wirth [Mon, 31 Jan 2022 12:56:14 +0000 (13:56 +0100)]
Make more precise range macro upmapping

2 years agoFix token ascension single token check being inverted
Lukas Wirth [Mon, 31 Jan 2022 12:10:53 +0000 (13:10 +0100)]
Fix token ascension single token check being inverted

2 years agoMerge #11182
bors[bot] [Mon, 31 Jan 2022 11:16:22 +0000 (11:16 +0000)]
Merge #11182

11182: fix: don't panic on seeing an unexpected offset r=Veykril a=dimbleby

Intended as a fix, or at least a sticking plaster, for #11081.

I have arranged that [offset()](https://github.com/rust-analyzer/rust-analyzer/blob/1ba9a924d7b161c52e605e157ee16d582e4a8684/crates/ide_db/src/line_index.rs#L105-L107) returns `Option<TextSize>` instead of going out of bounds; other changes are the result of following the compiler after doing this.

Perhaps there's still an issue here - I suppose the server and client have gotten out of sync and that probably shouldn't happen in the first place?  I see that https://github.com/rust-analyzer/rust-analyzer/issues/10138#issuecomment-913727554 suggests what sounds like a more substantial fix which I think might be aimed in this direction.  So perhaps that one should be left open to cover such things?

Meanwhile, I hope that not-crashing is a good improvement: and I can confirm that it works out just fine in the repro I have at #11081.

Co-authored-by: David Hotham <david.hotham@metaswitch.com>
2 years agoMerge #11384
bors[bot] [Mon, 31 Jan 2022 11:05:40 +0000 (11:05 +0000)]
Merge #11384

11384: feat: Complete local fn and closure params from surrounding locals scope r=Veykril a=Veykril

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2 years agoComplete local fn and closure params from surrounding locals scope
Lukas Wirth [Mon, 31 Jan 2022 10:56:42 +0000 (11:56 +0100)]
Complete local fn and closure params from surrounding locals scope

2 years agoMerge #11382
bors[bot] [Sun, 30 Jan 2022 22:08:25 +0000 (22:08 +0000)]
Merge #11382

11382: fix: Fix `cfg_attr` invalidating derive identifier IDE functionalities r=Veykril a=Veykril

Proper fix for https://github.com/rust-analyzer/rust-analyzer/issues/11298
bors r+

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2 years agoFix cfg_attr invalidating derive identifier IDE functionality
Lukas Wirth [Sun, 30 Jan 2022 21:46:05 +0000 (22:46 +0100)]
Fix cfg_attr invalidating derive identifier IDE functionality

2 years agoReduce allocations in attribute collection
Lukas Wirth [Sun, 30 Jan 2022 21:18:32 +0000 (22:18 +0100)]
Reduce allocations in attribute collection

2 years agoMerge #11377
bors[bot] [Sun, 30 Jan 2022 13:23:47 +0000 (13:23 +0000)]
Merge #11377

11377: Update README.md r=flodiebold a=flodiebold

I'm not currently sponsored anymore.

Co-authored-by: Florian Diebold <flodiebold@gmail.com>
2 years agoUpdate README.md
Florian Diebold [Sun, 30 Jan 2022 13:21:52 +0000 (14:21 +0100)]
Update README.md

I'm not currently sponsored anymore.

2 years agoMerge #11356
bors[bot] [Sun, 30 Jan 2022 08:05:55 +0000 (08:05 +0000)]
Merge #11356

11356: Rollback env vars changed by a proc macro r=vlad20012 a=vlad20012

Fixes #11355

Co-authored-by: vlad20012 <beskvlad@gmail.com>
2 years agoMerge #11367
bors[bot] [Fri, 28 Jan 2022 15:31:52 +0000 (15:31 +0000)]
Merge #11367

11367: minor: Use `compare_exchange_weak` in `limit::Limit::check` r=lnicola a=WaffleLapkin

Not a big deal, but generally loops should use `_weak` version of `compare_exchange`.

Co-authored-by: Maybe Waffle <waffle.lapkin@gmail.com>
2 years agoUse `compare_exchange_weak` in `limit::Limit::check`
Maybe Waffle [Fri, 28 Jan 2022 15:19:35 +0000 (18:19 +0300)]
Use `compare_exchange_weak` in `limit::Limit::check`

2 years agoMerge #11365
bors[bot] [Fri, 28 Jan 2022 13:21:24 +0000 (13:21 +0000)]
Merge #11365

11365: Add a way to disable dll copying for users of proc_macro_srv library r=lnicola a=vlad20012

We use `ra_ap_proc_macro_srv` library in IntelliJ Rust in order to expand proc macros. We need a way to disable [DLL copying to a temp dir on Windows](https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/proc_macro_srv/src/dylib.rs#L166) behavior because it causes issues like https://github.com/intellij-rust/intellij-rust/issues/7709. Unlike RA, file locking is not an issue for IntelliJ Rust because we copy DLLs to a temp dir before calling the expander.

Co-authored-by: vlad20012 <beskvlad@gmail.com>
2 years agoAdd a way to disable dll copying for users of proc_macro_srv library
vlad20012 [Fri, 28 Jan 2022 13:18:25 +0000 (16:18 +0300)]
Add a way to disable dll copying for users of proc_macro_srv library

2 years agoMerge #11360
bors[bot] [Fri, 28 Jan 2022 10:58:21 +0000 (10:58 +0000)]
Merge #11360

11360: feat: Support `#![recursion_limit]` attribute r=Veykril a=WaffleLapkin

![Peek 2022-01-28 02-33](https://user-images.githubusercontent.com/38225716/151508617-ac802b53-f088-4cac-b260-2cd077f3d32c.gif)

Resolves #8640

`@matklad` thanks, for the instructions, they were very helpful :)

Co-authored-by: Maybe Waffle <waffle.lapkin@gmail.com>
2 years agoRollback env vars changed by a proc macro
vlad20012 [Thu, 27 Jan 2022 18:34:18 +0000 (21:34 +0300)]
Rollback env vars changed by a proc macro

2 years agofeat: Honor recursion limit configuration
Maybe Waffle [Thu, 27 Jan 2022 22:23:09 +0000 (01:23 +0300)]
feat: Honor recursion limit configuration

This patch makes RA understand `#![recursion_limit = "N"]` annotations.

- `crate_limits` query is moved to `DefDatabase`
- `DefMap` now has `recursion_limit: Option<u32>` field

2 years agoUse `crate_limits` query in macro expansion
Maybe Waffle [Thu, 27 Jan 2022 20:53:49 +0000 (23:53 +0300)]
Use `crate_limits` query in macro expansion

2 years agoAdd `crate_limits` query to `SourceDatabase`
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.

2 years agoMerge #11288
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>
2 years agoSupport <code> blocks from Rust docs
Andrew Onyshchuk [Fri, 14 Jan 2022 23:20:35 +0000 (15:20 -0800)]
Support <code> blocks from Rust docs

2 years agoMerge #11353
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>
2 years agoMerge #11354
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>
2 years agoMore correct `$crate` handling in eager macros
Jonas Schievink [Thu, 27 Jan 2022 15:57:53 +0000 (16:57 +0100)]
More correct `$crate` handling in eager macros

2 years agoSet current working directory for procedural macros
vlad20012 [Thu, 27 Jan 2022 12:54:06 +0000 (15:54 +0300)]
Set current working directory for procedural macros

2 years agoMerge #11348
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>
2 years agoFix merge commit check for git 2.35
Jonas Schievink [Wed, 26 Jan 2022 18:10:39 +0000 (19:10 +0100)]
Fix merge commit check for git 2.35

2 years agoMerge #11347
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>
2 years agoFix resolution of eager macro contents
Jonas Schievink [Wed, 26 Jan 2022 17:31:07 +0000 (18:31 +0100)]
Fix resolution of eager macro contents

2 years agoMerge #11345
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>
2 years agominor: fix a typo in the style guide
Waffle Maybe [Wed, 26 Jan 2022 14:07:17 +0000 (17:07 +0300)]
minor: fix a typo in the style guide

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 agofixed whitespace
Jeroen Vannevel [Sat, 22 Jan 2022 13:28:23 +0000 (13:28 +0000)]
fixed whitespace

2 years agowhitespace
Jeroen Vannevel [Sat, 22 Jan 2022 12:25:33 +0000 (12:25 +0000)]
whitespace

2 years agogenerated docs
Jeroen Vannevel [Sat, 22 Jan 2022 12:17:24 +0000 (12:17 +0000)]
generated docs

2 years agoclarify doc
Jeroen Vannevel [Sat, 22 Jan 2022 12:10:48 +0000 (12:10 +0000)]
clarify doc

2 years agoSupport standalone comments
Jeroen Vannevel [Sat, 22 Jan 2022 12:05:35 +0000 (12:05 +0000)]
Support standalone comments

2 years agoredundant type specified
Jeroen Vannevel [Sat, 22 Jan 2022 11:53:13 +0000 (11:53 +0000)]
redundant type specified

2 years agoshorter arms
Jeroen Vannevel [Sat, 22 Jan 2022 11:51:56 +0000 (11:51 +0000)]
shorter arms

2 years agoremoved prints
Jeroen Vannevel [Sat, 22 Jan 2022 11:46:41 +0000 (11:46 +0000)]
removed prints

2 years agohacky_block_expr_with_comments
Jeroen Vannevel [Sat, 22 Jan 2022 11:42:03 +0000 (11:42 +0000)]
hacky_block_expr_with_comments

2 years agoremoved unwrapping from indent
Jeroen Vannevel [Sat, 22 Jan 2022 11:32:26 +0000 (11:32 +0000)]
removed unwrapping from indent

2 years agosimplified tail_expr
Jeroen Vannevel [Sat, 22 Jan 2022 11:18:17 +0000 (11:18 +0000)]
simplified tail_expr

2 years agoremoving unwraps
Jeroen Vannevel [Sat, 22 Jan 2022 10:54:37 +0000 (10:54 +0000)]
removing unwraps

2 years agodon't remove the comment token if it's last
Jeroen Vannevel [Wed, 19 Jan 2022 23:26:30 +0000 (23:26 +0000)]
don't remove the comment token if it's last

2 years agovery rough but comments get extracted
Jeroen Vannevel [Wed, 19 Jan 2022 23:21:17 +0000 (23:21 +0000)]
very rough but comments get extracted

2 years agorepro
Jeroen Vannevel [Tue, 18 Jan 2022 22:21:38 +0000 (22:21 +0000)]
repro

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