]> git.lizzy.rs Git - rust.git/log
rust.git
3 years agoMerge #8901
bors[bot] [Sat, 22 May 2021 12:26:40 +0000 (12:26 +0000)]
Merge #8901

8901: fix: `fill_match_arms` hangs on a tuple of large enums r=matklad a=iDawer

+ Lazy computation of missing arms.
+ Convenience function to test lazy computation: `ide_assists::tests::check_assist_unresolved`.

Fixes #8835

Co-authored-by: Dawer <7803845+iDawer@users.noreply.github.com>
3 years agoMerge #8918
bors[bot] [Sat, 22 May 2021 00:31:17 +0000 (00:31 +0000)]
Merge #8918

8918: fix: fix hang caused by non-unique attribute IDs r=jonas-schievink a=jonas-schievink

Fixes https://github.com/rust-analyzer/rust-analyzer/issues/8905 (again)

bors r+

Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
3 years agoWork around non-unique AttrIds
Jonas Schievink [Sat, 22 May 2021 00:30:03 +0000 (02:30 +0200)]
Work around non-unique AttrIds

3 years agoMerge #8916
bors[bot] [Fri, 21 May 2021 23:18:19 +0000 (23:18 +0000)]
Merge #8916

8916: ItemTree pretty-printing r=jonas-schievink a=jonas-schievink

This adds a printer for `ItemTree` contents, and a few tests to ensure that `ItemTree` lowering works like we expect it to. It also adds a new "Debug ItemTree" command that can be used to see the `ItemTree` of the currently open file. The pretty-printed output is usually close enough to Rust syntax that we can even use Rust syntax highlighting.

This is similar to the old `ItemTree` tests we had, but produces significantly more readable output, so these should actually carry their weight.

Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
3 years agoUse `.rs` file ending to get syntax highlighting
Jonas Schievink [Fri, 21 May 2021 22:11:54 +0000 (00:11 +0200)]
Use `.rs` file ending to get syntax highlighting

3 years agoUpdate lsp-extensions.md
Jonas Schievink [Fri, 21 May 2021 22:03:36 +0000 (00:03 +0200)]
Update lsp-extensions.md

3 years agoAdd a "Debug ItemTree" LSP request
Jonas Schievink [Fri, 21 May 2021 21:59:52 +0000 (23:59 +0200)]
Add a "Debug ItemTree" LSP request

3 years agoAdd an ItemTree pretty-printer
Jonas Schievink [Fri, 21 May 2021 21:45:27 +0000 (23:45 +0200)]
Add an ItemTree pretty-printer

3 years agoimpl Display for AttrInput/ImportAlias
Jonas Schievink [Fri, 21 May 2021 21:45:09 +0000 (23:45 +0200)]
impl Display for AttrInput/ImportAlias

3 years agoMerge #8914
bors[bot] [Fri, 21 May 2021 19:08:49 +0000 (19:08 +0000)]
Merge #8914

8914: internal: remove `StructDefKind` r=jonas-schievink a=jonas-schievink

The `Fields` enum already encodes this, so `StructDefKind` is redundant.

bors r+

Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
3 years agoRemove `StructDefKind`
Jonas Schievink [Fri, 21 May 2021 19:08:06 +0000 (21:08 +0200)]
Remove `StructDefKind`

3 years agoMerge #8856
bors[bot] [Fri, 21 May 2021 17:51:53 +0000 (17:51 +0000)]
Merge #8856

8856: Use Chalk for unification r=flodiebold a=flodiebold

 - use Chalk's unification, get rid of our own `unify`
 - rewrite coercion to not use unification internals and to be more analogous to rustc
 - fix various coercion bugs
 - rewrite handling of obligations, since the old hacky optimization where we noted when an inference variable changes wasn't possible anymore
 - stop trying to deeply resolve types all the time during inference, instead only do it shallowly where necessary

Co-authored-by: Florian Diebold <flodiebold@gmail.com>
3 years agoClean up visibilities
Florian Diebold [Fri, 21 May 2021 17:50:18 +0000 (19:50 +0200)]
Clean up visibilities

3 years agoMerge #8910
bors[bot] [Fri, 21 May 2021 16:29:31 +0000 (16:29 +0000)]
Merge #8910

8910: Don't lower extern block in the ItemTree r=jonas-schievink a=jonas-schievink

The ItemTree lowering code used to attach attributes on an `extern {}` block to all the children. This is wrong and causes problems with attribute resolution that manifested as a hang.

This PR treats extern blocks as first-class items in the ItemTree and lowers its contents in the `ModCollector` instead.

Fixes https://github.com/rust-analyzer/rust-analyzer/issues/8414#issuecomment-845607923
Fixes https://github.com/rust-analyzer/rust-analyzer/issues/8905
Fixes https://github.com/rust-analyzer/rust-analyzer/issues/8909

bors r+

Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
3 years agoDon't lower extern block in the ItemTree
Jonas Schievink [Fri, 21 May 2021 16:27:25 +0000 (18:27 +0200)]
Don't lower extern block in the ItemTree

3 years agoSome remaining cleanups
Florian Diebold [Fri, 21 May 2021 16:20:56 +0000 (18:20 +0200)]
Some remaining cleanups

3 years agoFix test after rebase
Florian Diebold [Fri, 21 May 2021 16:07:30 +0000 (18:07 +0200)]
Fix test after rebase

3 years agoRecord type mismatches for failed coercions in match etc.
Florian Diebold [Fri, 21 May 2021 15:48:15 +0000 (17:48 +0200)]
Record type mismatches for failed coercions in match etc.

3 years agoRefactor expectation handling
Florian Diebold [Fri, 21 May 2021 15:41:20 +0000 (17:41 +0200)]
Refactor expectation handling

So as to not use `TyKind::Error` as "no expectation".

3 years agoRemove TypeVariableTable
Florian Diebold [Sun, 16 May 2021 18:04:00 +0000 (20:04 +0200)]
Remove TypeVariableTable

3 years agoDeal with goals arising from unification
Florian Diebold [Sun, 16 May 2021 16:27:17 +0000 (18:27 +0200)]
Deal with goals arising from unification

3 years agoGet rid of resolve_ty_as_possible
Florian Diebold [Sun, 16 May 2021 15:56:38 +0000 (17:56 +0200)]
Get rid of resolve_ty_as_possible

Instead use shallow resolving where necessary.

3 years agoMake resolve_ty_shallow return Ty
Florian Diebold [Sun, 16 May 2021 13:56:27 +0000 (15:56 +0200)]
Make resolve_ty_shallow return Ty

3 years agoRework obligation handling
Florian Diebold [Sun, 16 May 2021 13:50:28 +0000 (15:50 +0200)]
Rework obligation handling

We can't do the easy hack that we did before anymore, where we kept
track of whether any inference variables changed since the last time we
rechecked obligations. Instead, we store the obligations in
canonicalized form; that way we can easily check the inference variables
to see whether they have changed since the goal was canonicalized.

3 years agoFix another panic
Florian Diebold [Sat, 15 May 2021 21:09:18 +0000 (23:09 +0200)]
Fix another panic

3 years agoImprove debug printing without TLS
Florian Diebold [Sat, 15 May 2021 20:26:55 +0000 (22:26 +0200)]
Improve debug printing without TLS

3 years agoFix panic
Florian Diebold [Sat, 15 May 2021 19:30:40 +0000 (21:30 +0200)]
Fix panic

3 years agoFix HIR expecting errors to unify with anything
Florian Diebold [Sat, 15 May 2021 18:28:07 +0000 (20:28 +0200)]
Fix HIR expecting errors to unify with anything

3 years agoFix compilation of hir and ide crates
Florian Diebold [Sat, 15 May 2021 18:18:54 +0000 (20:18 +0200)]
Fix compilation of hir and ide crates

3 years agoFix if/else coercion
Florian Diebold [Sat, 15 May 2021 17:35:12 +0000 (19:35 +0200)]
Fix if/else coercion

3 years agoMake diverging type variables work again
Florian Diebold [Sat, 15 May 2021 17:28:58 +0000 (19:28 +0200)]
Make diverging type variables work again

Chalk doesn't know about the `diverging` flag, so we need to instead
propagate it before fully resolving the variables.

3 years agoFix handling of diverging branches in match coercion
Florian Diebold [Sat, 15 May 2021 15:01:27 +0000 (17:01 +0200)]
Fix handling of diverging branches in match coercion

Fixes #7626.

3 years agoFix coercion of two closures to a function pointer
Florian Diebold [Sat, 15 May 2021 14:00:24 +0000 (16:00 +0200)]
Fix coercion of two closures to a function pointer

Fixes #8604.

3 years agoUpdate tests with expected changes
Florian Diebold [Thu, 13 May 2021 18:31:06 +0000 (20:31 +0200)]
Update tests with expected changes

3 years agoMake type resolver a proper folder, make it resolve consts as well
Florian Diebold [Thu, 13 May 2021 17:44:29 +0000 (19:44 +0200)]
Make type resolver a proper folder, make it resolve consts as well

3 years agoFix fallback to bound vars in `unify`
Florian Diebold [Sun, 9 May 2021 18:06:24 +0000 (20:06 +0200)]
Fix fallback to bound vars in `unify`

3 years agoBetter Debug impl for InternedWrapper
Florian Diebold [Sun, 9 May 2021 18:05:43 +0000 (20:05 +0200)]
Better Debug impl for InternedWrapper

3 years agoTemporary fix for unknown expectations
Florian Diebold [Sun, 2 May 2021 14:32:42 +0000 (16:32 +0200)]
Temporary fix for unknown expectations

3 years agoFix warnings & format
Florian Diebold [Sun, 2 May 2021 14:20:37 +0000 (16:20 +0200)]
Fix warnings & format

3 years agoRewrite coercion using the new unification
Florian Diebold [Sat, 1 May 2021 19:53:10 +0000 (21:53 +0200)]
Rewrite coercion using the new unification

3 years agoRemove our unification code, use Chalk's instead
Florian Diebold [Sun, 11 Apr 2021 09:20:45 +0000 (11:20 +0200)]
Remove our unification code, use Chalk's instead

3 years agoTest `fill_match_arms` for lazy computation.
Dawer [Fri, 21 May 2021 06:27:41 +0000 (11:27 +0500)]
Test `fill_match_arms` for lazy computation.

This also adds `ide_assists::tests::check_assist_unresolved` function.

3 years agoMerge #8902
bors[bot] [Thu, 20 May 2021 21:23:20 +0000 (21:23 +0000)]
Merge #8902

8902: fix: Fix code completion not inserting borrow text when client supports InsertAndReplace r=Veykril a=Veykril

bors r+

Co-authored-by: Lukas Tobias Wirth <lukastw97@gmail.com>
3 years agoFix code completion not inserting borrow text when client supports InsertAndReplace
Lukas Tobias Wirth [Thu, 20 May 2021 21:22:21 +0000 (23:22 +0200)]
Fix code completion not inserting borrow text when client supports InsertAndReplace

3 years agofix: `fill_match_arms` hangs on a tuple of large enums
Dawer [Thu, 20 May 2021 18:50:27 +0000 (23:50 +0500)]
fix: `fill_match_arms` hangs on a tuple of large enums

3 years agoCompute missing arms lazily.
Dawer [Thu, 20 May 2021 12:58:18 +0000 (17:58 +0500)]
Compute missing arms lazily.

3 years agoMerge #8900
bors[bot] [Thu, 20 May 2021 18:41:26 +0000 (18:41 +0000)]
Merge #8900

8900: internal: support `#[register_attr]` and `#[register_tool]` r=jonas-schievink a=jonas-schievink

Relatively straightforward since these are crate-local.

bors r+

Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
3 years agoSupport `#[register_attr]` and `#[register_tool]`
Jonas Schievink [Thu, 20 May 2021 18:40:02 +0000 (20:40 +0200)]
Support `#[register_attr]` and `#[register_tool]`

3 years agoRename `ignore_attrs_on` to `skip_attrs`
Jonas Schievink [Thu, 20 May 2021 18:18:53 +0000 (20:18 +0200)]
Rename `ignore_attrs_on` to `skip_attrs`

3 years agoMerge #8899
bors[bot] [Thu, 20 May 2021 18:09:12 +0000 (18:09 +0000)]
Merge #8899

8899: minor: Simplify r=jonas-schievink a=jonas-schievink

bors r+

Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
3 years agoSimplify
Jonas Schievink [Thu, 20 May 2021 18:08:39 +0000 (20:08 +0200)]
Simplify

3 years agoMerge #8898
bors[bot] [Thu, 20 May 2021 17:57:06 +0000 (17:57 +0000)]
Merge #8898

8898: internal: resolve derive helpers r=jonas-schievink a=jonas-schievink

bors r+

Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
3 years agoRefactor name resolution to resolve derive helpers
Jonas Schievink [Thu, 20 May 2021 17:56:04 +0000 (19:56 +0200)]
Refactor name resolution to resolve derive helpers

3 years agoMerge #8897
bors[bot] [Thu, 20 May 2021 16:05:54 +0000 (16:05 +0000)]
Merge #8897

8897: minor: Don't compare ast::Visibility by stringifying r=Veykril a=Veykril

bors r+

Co-authored-by: Lukas Tobias Wirth <lukastw97@gmail.com>
3 years agoDon't compare ast::Visibility by stringifying
Lukas Tobias Wirth [Thu, 20 May 2021 15:27:51 +0000 (17:27 +0200)]
Don't compare ast::Visibility by stringifying

3 years agoMerge #8893
bors[bot] [Thu, 20 May 2021 13:32:45 +0000 (13:32 +0000)]
Merge #8893

8893: Update outdated auto-import documentation r=Veykril a=Veykril

bors r+

Co-authored-by: Lukas Tobias Wirth <lukastw97@gmail.com>
3 years agoUpdate outdated auto-import documentation
Lukas Tobias Wirth [Thu, 20 May 2021 13:29:21 +0000 (15:29 +0200)]
Update outdated auto-import documentation

3 years agoRename `unexpanded_macros` to `unresolved_macros`
Jonas Schievink [Thu, 20 May 2021 11:12:29 +0000 (13:12 +0200)]
Rename `unexpanded_macros` to `unresolved_macros`

3 years agoMerge #8873
bors[bot] [Thu, 20 May 2021 08:27:16 +0000 (08:27 +0000)]
Merge #8873

8873: Implement import-granularity guessing  r=matklad a=Veykril

This renames our `MergeBehavior` to `ImportGranularity` as rustfmt has it as the purpose of them are basically the same. `ImportGranularity::Preserve` currently has no specific purpose for us as we don't have an organize imports assist yet, so it currently acts the same as `ImportGranularity::Item`.

We now try to guess the import style on a per file basis and fall back to the user granularity setting if the file has no specific style yet or where it is ambiguous. This can be turned off by setting `import.enforceGranularity` to `true`.

Closes https://github.com/rust-analyzer/rust-analyzer/issues/8870

Co-authored-by: Lukas Tobias Wirth <lukastw97@gmail.com>
3 years agoCheck for differing attributes in granularity guessing
Lukas Tobias Wirth [Thu, 20 May 2021 08:25:04 +0000 (10:25 +0200)]
Check for differing attributes in granularity guessing

3 years agoMerge #8889
bors[bot] [Wed, 19 May 2021 21:35:50 +0000 (21:35 +0000)]
Merge #8889

8889: internal: Track in-scope derive helpers during nameres r=jonas-schievink a=jonas-schievink

...without using them yet

bors r+

Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
3 years agoTrack in-scope derive helpers during nameres
Jonas Schievink [Wed, 19 May 2021 21:35:09 +0000 (23:35 +0200)]
Track in-scope derive helpers during nameres

3 years agoMerge #8888
bors[bot] [Wed, 19 May 2021 20:10:00 +0000 (20:10 +0000)]
Merge #8888

8888: fix: fix unresolved attribute fallback again r=jonas-schievink a=jonas-schievink

`ModItem`s are per-file, so we have to track the file if we store them in the crate-level `DefCollector`.

Fixes the remaining issue in https://github.com/rust-analyzer/rust-analyzer/pull/8882#issuecomment-844379170

bors r+

Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
3 years agoFix unresolved attribute fallback again
Jonas Schievink [Wed, 19 May 2021 20:08:34 +0000 (22:08 +0200)]
Fix unresolved attribute fallback again

3 years agoMerge #8885 #8887
bors[bot] [Wed, 19 May 2021 19:07:05 +0000 (19:07 +0000)]
Merge #8885 #8887

8885: internal: greatly simplify eager macro representation r=jonas-schievink a=jonas-schievink

- Share structures with lazy macros, make both use `MacroCallLoc`.
- Remove `intern_eager_expansion`, `EagerCallLoc`, `EagerMacroId`, and *many* matches on `MacroCallId`.
- Make a lot of FIXMEs obsolete since the code no longer distinguishes between eager and lazy macros.
- Add `EagerCallInfo`, which is `Some` for calls to eager macros and holds the argument or expansion result and the included file.

8887: fix: fix derive collection after unresolved attribute fallback r=jonas-schievink a=jonas-schievink

Fixes https://github.com/rust-analyzer/rust-analyzer/pull/8882#issuecomment-844379170

bors r+

Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
3 years agoFix derive collection after unresolved attribute fallback
Jonas Schievink [Wed, 19 May 2021 19:05:58 +0000 (21:05 +0200)]
Fix derive collection after unresolved attribute fallback

3 years agoMerge #8884
bors[bot] [Wed, 19 May 2021 18:30:36 +0000 (18:30 +0000)]
Merge #8884

8884: fix: add_explicit_type produces invalid code on `@` patterns r=Veykril a=iDawer

In
```rust
let name @ () = ();
```
 an explicit type should be inserted after the pattern, not just after the name.
`let` statement defined as `LetStmt = Attr* 'let' Pat (':' Type)? '=' initializer:Expr ';'`

Co-authored-by: Dawer <7803845+iDawer@users.noreply.github.com>
3 years agoadd_explicit_type respects `@` patterns
Dawer [Wed, 19 May 2021 18:12:09 +0000 (23:12 +0500)]
add_explicit_type respects `@` patterns

3 years agoClarify field name
Jonas Schievink [Wed, 19 May 2021 18:23:26 +0000 (20:23 +0200)]
Clarify field name

3 years agoSimplify eager macro representation
Jonas Schievink [Wed, 19 May 2021 18:19:08 +0000 (20:19 +0200)]
Simplify eager macro representation

3 years agoMerge #8875
bors[bot] [Wed, 19 May 2021 17:46:38 +0000 (17:46 +0000)]
Merge #8875

8875: fix: false positive "Missing match arm" when an or-pattern has mismatched types r=flodiebold a=iDawer

![Screenshot_20210519_114510](https://user-images.githubusercontent.com/7803845/118768935-19e12c00-b86f-11eb-90c4-1eed3f2bf57f.jpg)
`InferenceResult` now records pattern type mismatches.

Co-authored-by: Dawer <7803845+iDawer@users.noreply.github.com>
3 years agoMerge #8882
bors[bot] [Wed, 19 May 2021 17:06:49 +0000 (17:06 +0000)]
Merge #8882

8882: internal: resolve attributes in name resolution (minimal version) r=jonas-schievink a=jonas-schievink

Closes https://github.com/rust-analyzer/rust-analyzer/pull/7049

This should not have any observable effect, since we don't attempt to expand attribute macros yet, and I have implemented a fallback that treats items with unresolved attributes as if the attribute wasn't there.

Derive helpers are not yet resolved. `#![register_{attr,tool}]` are not yet supported.

Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
3 years agoRewrite `resolve_imports` to use an iterator
Jonas Schievink [Wed, 19 May 2021 17:05:03 +0000 (19:05 +0200)]
Rewrite `resolve_imports` to use an iterator

This allows reusing the original vector's allocation

3 years agoRestructure nameres loop to be a bit clearer
Jonas Schievink [Wed, 19 May 2021 16:56:00 +0000 (18:56 +0200)]
Restructure nameres loop to be a bit clearer

3 years agoReplace ImportGranularity::Guess with guessing boolean flag
Lukas Tobias Wirth [Tue, 18 May 2021 18:21:47 +0000 (20:21 +0200)]
Replace ImportGranularity::Guess with guessing boolean flag

3 years agointernal: resolve attributes in name resolution
Jonas Schievink [Wed, 19 May 2021 13:17:57 +0000 (15:17 +0200)]
internal: resolve attributes in name resolution

3 years agoMerge #8877
bors[bot] [Wed, 19 May 2021 12:31:44 +0000 (12:31 +0000)]
Merge #8877

8877: feat: allow clients to feature detect symbol filtering r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
3 years agoMerge #8880
bors[bot] [Wed, 19 May 2021 12:21:21 +0000 (12:21 +0000)]
Merge #8880

8880: fix: prepare_rename failing for modules r=Veykril a=Veykril

bors r+

Co-authored-by: Lukas Tobias Wirth <lukastw97@gmail.com>
3 years agoFix prepare_rename failing for modules
Lukas Tobias Wirth [Wed, 19 May 2021 12:19:44 +0000 (14:19 +0200)]
Fix prepare_rename failing for modules

3 years agofeat: allow clients to feature detect symbol filtering
Aleksey Kladov [Wed, 19 May 2021 10:28:58 +0000 (13:28 +0300)]
feat: allow clients to feature detect symbol filtering

3 years agoCheck patterns for type match recursively.
Dawer [Wed, 19 May 2021 05:57:10 +0000 (10:57 +0500)]
Check patterns for type match recursively.

3 years agointernal: Record mismatches of pattern types.
Dawer [Wed, 19 May 2021 04:23:16 +0000 (09:23 +0500)]
internal: Record mismatches of pattern types.

3 years agoMerge #7698
bors[bot] [Tue, 18 May 2021 19:20:51 +0000 (19:20 +0000)]
Merge #7698

7698: Add new LSP extension for workspace symbol lookup r=matklad a=alcroito

As well as all symbol types (functions, modules).

Remove outdated documentation regarding symbol lookup filtering.

Closes #4881

Co-authored-by: alcroito <placinta@gmail.com>
3 years agoMerge #8871
bors[bot] [Tue, 18 May 2021 19:02:32 +0000 (19:02 +0000)]
Merge #8871

8871: internal: Simplify `DefCollector::resolve_macros` r=jonas-schievink a=jonas-schievink

bors r+

Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
3 years agoAdd ImportGranularity::Guess
Lukas Tobias Wirth [Tue, 18 May 2021 18:21:47 +0000 (20:21 +0200)]
Add ImportGranularity::Guess

3 years agoImplement import-granularity guessing
Lukas Tobias Wirth [Tue, 18 May 2021 18:10:39 +0000 (20:10 +0200)]
Implement import-granularity guessing

3 years agoMergeBehavior -> ImportGranularity
Lukas Tobias Wirth [Tue, 18 May 2021 17:49:15 +0000 (19:49 +0200)]
MergeBehavior -> ImportGranularity

3 years agoSimplify `DefCollector::resolve_macros`
Jonas Schievink [Tue, 18 May 2021 15:51:02 +0000 (17:51 +0200)]
Simplify `DefCollector::resolve_macros`

3 years agoMerge #8345
bors[bot] [Tue, 18 May 2021 02:02:34 +0000 (02:02 +0000)]
Merge #8345

8345: Add pub mod option for UnlinkedFile r=rainy-me a=rainy-me

close #8228

This is a draft that changes `Diagnostic` to contain multiple fixes. Pre analysis is in https://github.com/rust-analyzer/rust-analyzer/issues/8228#issuecomment-812887085 Because this solution is straightforward so I decided to type it out for discussion.

Currently the `check_fix` is not able to test the situation when multiple fixes available. <del>Also because `Insert 'mod x;'` and  `Insert 'pub mod x;'` are so similar, I don't know how to test them correctly and want some suggestions.</del>. I added
 `check_fixes` to allow checking mutiple possible fixes.

In additional, instead of append after possible existing `mod y`, I think it's possible to Insert `pub mod x;` after `pub mod y`. Should I implement this too?

Co-authored-by: rainy-me <github@rainy.me>
3 years agoAdd pub mod option for UnlinkedFile
rainy-me [Mon, 17 May 2021 23:11:07 +0000 (08:11 +0900)]
Add pub mod option for UnlinkedFile

3 years agoAdd new LSP extension for workspace symbol lookup
alcroito [Tue, 23 Feb 2021 12:03:31 +0000 (14:03 +0200)]
Add new LSP extension for workspace symbol lookup

The new extension allows filtering of workspace symbool lookup
results by search scope or search kind.

Filtering can be configured in 3 different ways:

 - The '#' or '*' markers can be added inline with the symbol lookup
   query.

   The '#' marker means symbols should be looked up in the current
   workspace and any dependencies. If not specified, only current
   workspace is considered.

   The '*' marker means all kinds of symbols should be looked up
   (types, functions, etc). If not specified, only type symbols are
   returned.

 - Each LSP request can take an optional search_scope or search_kind
   argument query parameter.

 - Finally there are 2 global config options that can be set for all
   requests served by the active RA instance.

Add support for setting the global config options to the VSCode
extension.
The extension does not use the per-request way, but it's useful for
other IDEs.

The latest version of VSCode filters out the inline markers, so
currently the only reasonable way to use the new functionality is
via the global config.

3 years agoMerge #8766
bors[bot] [Mon, 17 May 2021 18:45:29 +0000 (18:45 +0000)]
Merge #8766

8766: Extract function assist will add async if required r=Veykril a=JamieCunliffe

The extract function assist will check for an AWAIT_EXPR or AWAIT_KW in the body and if found, will add async to the generated function.

closes #8232

Co-authored-by: Jamie Cunliffe <Jamie.Cunliffe@outlook.com>
3 years agoExtract function assist will add async if required
Jamie Cunliffe [Sat, 24 Apr 2021 17:01:36 +0000 (18:01 +0100)]
Extract function assist will add async if required

The extract function assist will check for an AWAIT_EXPR in the body
and if found, will add async to the generated function.

3 years agointernal: use more evocative test folder name
Aleksey Kladov [Mon, 17 May 2021 15:43:20 +0000 (18:43 +0300)]
internal: use more evocative test folder name

3 years agominor: adjust config name
Aleksey Kladov [Mon, 17 May 2021 15:37:06 +0000 (18:37 +0300)]
minor: adjust config name

3 years agoMerge #8795
bors[bot] [Mon, 17 May 2021 14:41:56 +0000 (14:41 +0000)]
Merge #8795

8795: Allow semantic tokens for strings to be disabled r=matklad a=djrenren

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

Pretty straightforward change, but open to any suggestions if there's a more recommended testing strategy than what I went with.

Co-authored-by: John Renner <john@jrenner.net>
3 years agoMerge #8864
bors[bot] [Mon, 17 May 2021 11:50:09 +0000 (11:50 +0000)]
Merge #8864

8864: Update notify and fst r=kjeremy a=kjeremy

Co-authored-by: kjeremy <kjeremy@gmail.com>
3 years agoUpdate notify and fst
kjeremy [Mon, 17 May 2021 11:49:27 +0000 (07:49 -0400)]
Update notify and fst

3 years agoMerge #8858
bors[bot] [Mon, 17 May 2021 10:16:05 +0000 (10:16 +0000)]
Merge #8858

8858: Ignore macro import from `extern crate self` r=jonas-schievink a=ivan770

Closes #8834

Co-authored-by: ivan770 <leshenko.ivan770@gmail.com>
3 years agoMerge #8863
bors[bot] [Mon, 17 May 2021 09:45:23 +0000 (09:45 +0000)]
Merge #8863

8863: fix: don't add extra whitespace around fields r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>