]> git.lizzy.rs Git - rust.git/log
rust.git
2 years ago- Break out functionality related to rendering struct completions into `crates/ide_co...
Morgan Thomas [Sat, 12 Mar 2022 01:17:01 +0000 (17:17 -0800)]
- Break out functionality related to rendering struct completions into `crates/ide_completion/src/render/compound.rs`
- Add support for placeholder completions in tuple structs
- Denote tuple struct completions with `(…)` instead of ` {…}`
- Show struct completions as their type (`Struct { field: Type }`) in the completion menu instead of raw snippet text (`Struct { field: ${1:()} }$0`)

2 years agoMerge #11680
bors[bot] [Fri, 11 Mar 2022 16:17:59 +0000 (16:17 +0000)]
Merge #11680

11680: fix: Show what file paths were expected for unresolved modules r=Veykril a=Veykril

bors r+

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2 years agofix: Show what file paths were expected for unresolved modules
Lukas Wirth [Fri, 11 Mar 2022 15:49:41 +0000 (16:49 +0100)]
fix: Show what file paths were expected for unresolved modules

2 years agoMerge #11676
bors[bot] [Thu, 10 Mar 2022 21:24:11 +0000 (21:24 +0000)]
Merge #11676

11676: internal: Expand into pseudo-derive attribute expansions in completions r=Veykril a=Veykril

With this we now properly handle qualified path completions in derives
bors r+

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2 years agoDon't parse source files to generate macro completion details
Lukas Wirth [Thu, 10 Mar 2022 21:21:58 +0000 (22:21 +0100)]
Don't parse source files to generate macro completion details

2 years agoEnable qualifier completions for derives
Lukas Wirth [Thu, 10 Mar 2022 20:56:19 +0000 (21:56 +0100)]
Enable qualifier completions for derives

2 years agoDon't offer qualified path completions for buitlin derives
Lukas Wirth [Thu, 10 Mar 2022 20:22:13 +0000 (21:22 +0100)]
Don't offer qualified path completions for buitlin derives

2 years agoExpand into pseudo-derive attribute expansions in completions
Lukas Wirth [Thu, 10 Mar 2022 19:53:50 +0000 (20:53 +0100)]
Expand into pseudo-derive attribute expansions in completions

2 years agoMerge #11672
bors[bot] [Thu, 10 Mar 2022 17:24:36 +0000 (17:24 +0000)]
Merge #11672

11672: Add support for new `where` clause location in associated types. r=Veykril a=Dirbaio

A recent Rust nightly changed it: https://github.com/rust-lang/rust/issues/89122

This allows both the old and new location.

Fixes #11651

Co-authored-by: Dario Nieuwenhuis <dirbaio@dirbaio.net>
2 years agoAdd support for new `where` clause location in associated types.
Dario Nieuwenhuis [Thu, 10 Mar 2022 17:10:03 +0000 (18:10 +0100)]
Add support for new `where` clause location in associated types.

A recent Rust nightly changed it: https://github.com/rust-lang/rust/issues/89122

This allows both the old and new location.

2 years agoMerge #11671
bors[bot] [Thu, 10 Mar 2022 16:15:12 +0000 (16:15 +0000)]
Merge #11671

11671: minor: Access parser internals through ide_db for ide crates r=Veykril a=Veykril

bors r+

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2 years agominor: Access parser internals through ide_db for ide crates
Lukas Wirth [Thu, 10 Mar 2022 16:07:11 +0000 (17:07 +0100)]
minor: Access parser internals through ide_db for ide crates

2 years agoMerge #11662
bors[bot] [Thu, 10 Mar 2022 15:49:03 +0000 (15:49 +0000)]
Merge #11662

11662: fix: extract_module selection inside impl r=Veykril a=feniljain

Should close: #11508

From issue:
Concern 1: Seems to be fixed in latest `rust-analyzer` build
Concern 2 and 3: Should be fixed by this PR
Concern 4: Got fixed in #11472

Points to note:

- Here I have seperated use items and other items, this is becuase the new `impl` block which we will be creating cannot contain use items as immediate children. As they are the only one item that can be generated by our assist, so seperating them helps in handling their inclusion in new `impl` block inside new `module`

- There's also a new method added which helps in removing remaning left over indentation after removing `impl` or other `item`

Co-authored-by: vi_mi <fkjainco@gmail.com>
2 years agoMerge #11664
bors[bot] [Wed, 9 Mar 2022 21:45:42 +0000 (21:45 +0000)]
Merge #11664

11664: fix: Properly handle proc-macro crate types for nameres r=Veykril a=Veykril

bors r+

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2 years agoUpdate project_model test outputs
Lukas Wirth [Wed, 9 Mar 2022 21:34:42 +0000 (22:34 +0100)]
Update project_model test outputs

2 years agoSpecific proc-macro crate type for other test fixture where needed
Lukas Wirth [Wed, 9 Mar 2022 21:18:09 +0000 (22:18 +0100)]
Specific proc-macro crate type for other test fixture where needed

2 years agoMerge #11660
bors[bot] [Wed, 9 Mar 2022 17:18:03 +0000 (17:18 +0000)]
Merge #11660

11660: Insert dummy values for const generics in subst r=flodiebold a=HKalbasi

fix #11659

This is a band-aid until proper const generic support.

Co-authored-by: hkalbasi <hamidrezakalbasi@protonmail.com>
2 years agoSpecify proc-macro crate type for proc-macro hir_def test fixtures
Lukas Wirth [Wed, 9 Mar 2022 14:36:05 +0000 (15:36 +0100)]
Specify proc-macro crate type for proc-macro hir_def test fixtures

2 years agofix: Properly handle proc-macro crate types for nameres
Lukas Wirth [Wed, 9 Mar 2022 13:33:39 +0000 (14:33 +0100)]
fix: Properly handle proc-macro crate types for nameres

2 years agoMerge #11663
bors[bot] [Wed, 9 Mar 2022 10:26:34 +0000 (10:26 +0000)]
Merge #11663

11663: Internal: Add hir_def::MacroId, add Macro{Id} to ModuleDef{Id} r=Veykril a=Veykril

With this we can now handle macros like we handle ModuleDefs making them work more like other definitions and allowing us to remove a bunch of special cases. This also enables us to track the modules these macros are defined in, instead of only recording the crate they come from.

Introduces a new class of `MacroId`s (for each of the 3 macro kinds) into `hir_def`. We can't reuse `MacroDefId` as that is defined in `hir_expand` which doesn't know of modules, so now we have two different macro ids, this unfortunately requires some back and forth mapping between the two via database accesses which I hope won't be too expensive.

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2 years agoSimplify
Lukas Wirth [Wed, 9 Mar 2022 10:26:06 +0000 (11:26 +0100)]
Simplify

2 years agoDisable one of the failing SSR test cases
Lukas Wirth [Wed, 9 Mar 2022 01:08:44 +0000 (02:08 +0100)]
Disable one of the failing SSR test cases

2 years agofix symbol index collection not collecting legacy macros
Lukas Wirth [Wed, 9 Mar 2022 00:44:20 +0000 (01:44 +0100)]
fix symbol index collection not collecting legacy macros

2 years agoFix ProcMacroData recording wrong name for derives
Lukas Wirth [Wed, 9 Mar 2022 00:13:38 +0000 (01:13 +0100)]
Fix ProcMacroData recording wrong name for derives

2 years agoAdd data queries for macros
Lukas Wirth [Tue, 8 Mar 2022 23:41:54 +0000 (00:41 +0100)]
Add data queries for macros

2 years agoRemove unnecessary macro_declarations from ItemScope
Lukas Wirth [Tue, 8 Mar 2022 23:19:53 +0000 (00:19 +0100)]
Remove unnecessary macro_declarations from ItemScope

2 years agoOnly store derive<->derive-helper mapping in DefMap
Lukas Wirth [Tue, 8 Mar 2022 23:01:19 +0000 (00:01 +0100)]
Only store derive<->derive-helper mapping in DefMap

2 years agoMove ide crates to new hir::Macro
Lukas Wirth [Tue, 8 Mar 2022 22:52:26 +0000 (23:52 +0100)]
Move ide crates to new hir::Macro

2 years agoMove hir to new MacroId
Lukas Wirth [Tue, 8 Mar 2022 22:51:48 +0000 (23:51 +0100)]
Move hir to new MacroId

2 years agoRename MacroDef to Macro
Lukas Wirth [Tue, 8 Mar 2022 22:51:19 +0000 (23:51 +0100)]
Rename MacroDef to Macro

2 years agoinsert dummy values for const generics in subst
hkalbasi [Tue, 8 Mar 2022 16:21:35 +0000 (19:51 +0330)]
insert dummy values for const generics in subst

2 years agoAdd MacroId to hir_def in attempt to unify Macros with ModuleDefId
Lukas Wirth [Tue, 8 Mar 2022 20:41:19 +0000 (21:41 +0100)]
Add MacroId to hir_def in attempt to unify Macros with ModuleDefId

2 years agofix: extract_module selection inside impl
vi_mi [Tue, 8 Mar 2022 19:54:07 +0000 (01:24 +0530)]
fix: extract_module selection inside impl

2 years agoMerge #11658
bors[bot] [Tue, 8 Mar 2022 10:31:54 +0000 (10:31 +0000)]
Merge #11658

11658: Add back colons around inlay hints r=Veykril a=lnicola

Fixes https://github.com/rust-analyzer/rust-analyzer/issues/2797#issuecomment-1061594139.

I originally thought that other extensions don't include the colons, but the TypeScript one seems to do.

Co-authored-by: Laurențiu Nicola <lnicola@dend.ro>
2 years agoAdd back colons around inlay hints
Laurențiu Nicola [Tue, 8 Mar 2022 10:01:02 +0000 (12:01 +0200)]
Add back colons around inlay hints

2 years agoMerge #11656
bors[bot] [Tue, 8 Mar 2022 06:34:49 +0000 (06:34 +0000)]
Merge #11656

11656: Fix package.json key replacement r=lnicola a=lnicola

CC #11653

bors r+

Co-authored-by: Laurențiu Nicola <lnicola@dend.ro>
2 years agoFix package.json replacement
Laurențiu Nicola [Tue, 8 Mar 2022 06:34:03 +0000 (08:34 +0200)]
Fix package.json replacement

2 years agoMerge #11653
bors[bot] [Tue, 8 Mar 2022 01:33:18 +0000 (01:33 +0000)]
Merge #11653

11653: fix: client distribution string replacement looking for wrong key r=Veykril a=Veykril

cc https://github.com/rust-analyzer/rust-analyzer/pull/11445
bors r+

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2 years agofix: client distribution string replacement looking for wrong key
Lukas Wirth [Tue, 8 Mar 2022 01:32:35 +0000 (02:32 +0100)]
fix: client distribution string replacement looking for wrong key

2 years agoMerge #11647
bors[bot] [Mon, 7 Mar 2022 17:19:43 +0000 (17:19 +0000)]
Merge #11647

11647: Improve inlay hint padding r=lnicola a=lnicola

Co-authored-by: Laurențiu Nicola <lnicola@dend.ro>
2 years agoImprove inlay hint padding
Laurențiu Nicola [Mon, 7 Mar 2022 17:18:36 +0000 (19:18 +0200)]
Improve inlay hint padding

2 years agoMerge #11445
bors[bot] [Mon, 7 Mar 2022 16:49:12 +0000 (16:49 +0000)]
Merge #11445

11445: Upstream inlay hints r=lnicola a=lnicola

Closes https://github.com/rust-analyzer/rust-analyzer/issues/2797
Closes https://github.com/rust-analyzer/rust-analyzer/issues/3394 (since now resolve the hints for the range given only, not for the whole document. We don't actually resolve anything due to [hard requirement](https://github.com/rust-analyzer/rust-analyzer/pull/11445#issuecomment-1035227434) on label being immutable. Any further heavy actions could go to the `resolve` method that's now available via the official Code API for hints)

Based on `@SomeoneToIgnore's` branch, with a couple of updates:

 - I squashed, more or less successfully, the commits on that branch
 - downloading the `.d.ts` no longer works, but you can get it manually from https://raw.githubusercontent.com/microsoft/vscode/release/1.64/src/vscode-dts/vscode.proposed.inlayHints.d.ts
 - you might need to pass `--enable-proposed-api matklad.rust-analyzer`
 - if I'm reading the definition right, `InlayHintKind` needs to be serialized as a number, not string
 - this doesn't work anyway -- the client-side gets the hints, but they don't display

Co-authored-by: Kirill Bulatov <mail4score@gmail.com>
Co-authored-by: Laurențiu Nicola <lnicola@dend.ro>
2 years agoAdd inlayHints cap
Laurențiu Nicola [Mon, 7 Mar 2022 16:48:27 +0000 (18:48 +0200)]
Add inlayHints cap

2 years agoAdd missing parameter
Laurențiu Nicola [Mon, 7 Mar 2022 13:42:20 +0000 (15:42 +0200)]
Add missing parameter

2 years agoFix parameter hint position
Laurențiu Nicola [Mon, 7 Mar 2022 13:24:54 +0000 (15:24 +0200)]
Fix parameter hint position

2 years agoBump esbuild
Laurențiu Nicola [Mon, 7 Mar 2022 13:22:13 +0000 (15:22 +0200)]
Bump esbuild

2 years agoUpdate LSP docs
Laurențiu Nicola [Fri, 4 Mar 2022 06:26:44 +0000 (08:26 +0200)]
Update LSP docs

2 years agoMerge #11645
bors[bot] [Mon, 7 Mar 2022 11:24:52 +0000 (11:24 +0000)]
Merge #11645

11645: Update manual.adoc r=lnicola a=vi

Resolves #11507

Co-authored-by: Vitaly Shukela <vi0oss@gmail.com>
2 years agoUpdate manual.adoc
Vitaly Shukela [Mon, 7 Mar 2022 11:22:07 +0000 (14:22 +0300)]
Update manual.adoc

Resolves #11507

2 years agoMerge #11644
bors[bot] [Mon, 7 Mar 2022 10:05:31 +0000 (10:05 +0000)]
Merge #11644

11644: Emit more detailed highlighting for `%`, `>>`, `<<` r=Veykril a=arzg

These are currently just given `operator`, when `%` can be grouped under `arithmetic`, and `>>` and `<<` can be grouped under `bitwise`.

Co-authored-by: Luna Razzaghipour <aramisnoah@gmail.com>
2 years agoEmit more detailed highlighting for `%`, `>>`, `<<`
Luna Razzaghipour [Mon, 7 Mar 2022 09:16:03 +0000 (20:16 +1100)]
Emit more detailed highlighting for `%`, `>>`, `<<`

2 years agoMerge #11639
bors[bot] [Sun, 6 Mar 2022 18:31:30 +0000 (18:31 +0000)]
Merge #11639

11639: internal: Re-arrange ide_db modules r=Veykril a=Veykril

Thins out the `helpers` module by giving some items more appropriate places to live
bors r+

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2 years agoUpdate tidy ignore list
Lukas Wirth [Sun, 6 Mar 2022 18:11:05 +0000 (19:11 +0100)]
Update tidy ignore list

2 years agointernal: Re-arrange ide_db modules
Lukas Wirth [Sun, 6 Mar 2022 18:01:30 +0000 (19:01 +0100)]
internal: Re-arrange ide_db modules

2 years agoMerge #11637
bors[bot] [Sun, 6 Mar 2022 16:56:29 +0000 (16:56 +0000)]
Merge #11637

11637: minor: Simplify r=Veykril a=Veykril

bors r+

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2 years agominor: Simplify
Lukas Wirth [Sun, 6 Mar 2022 16:56:02 +0000 (17:56 +0100)]
minor: Simplify

2 years agoMerge #11633
bors[bot] [Sun, 6 Mar 2022 12:22:35 +0000 (12:22 +0000)]
Merge #11633

11633: Automatically change text color in logo based on dark mode r=Veykril a=arzg

Currently the black text in the logo in the README just has a white stroke so it’s readable in dark mode. This PR adds automatic detection of whether the user is using system dark mode, and if they are changes the text colour to white and removes the stroke.

Before:

<img width="910" alt="Screen Shot 2022-03-06 at 10 54 35 pm" src="https://user-images.githubusercontent.com/31783266/156921920-7ac88aa4-bab6-44c2-be37-30338a2d9ec9.png">

After (now in Chrome because this doesn’t seem to work in Safari):

<img width="822" alt="Screen Shot 2022-03-06 at 11 10 12 pm" src="https://user-images.githubusercontent.com/31783266/156922615-41fe63e0-7901-4cb1-a229-6d37b6e4369a.png">
<img width="820" alt="Screen Shot 2022-03-06 at 11 10 25 pm" src="https://user-images.githubusercontent.com/31783266/156922619-1bdd5b9c-89ac-4fe1-bf17-1a1ac4ead805.png">

Co-authored-by: Luna Razzaghipour <aramisnoah@gmail.com>
2 years agoAutomatically change text color in logo based on dark mode
Luna Razzaghipour [Sun, 6 Mar 2022 11:53:52 +0000 (22:53 +1100)]
Automatically change text color in logo based on dark mode

2 years agoMerge #11632
bors[bot] [Sun, 6 Mar 2022 08:44:54 +0000 (08:44 +0000)]
Merge #11632

11632: Bring back syntax highlighting in test data r=matklad a=matklad

cc #11597

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2 years agoBring back syntax highlighting in test data
Aleksey Kladov [Sun, 6 Mar 2022 08:42:17 +0000 (08:42 +0000)]
Bring back syntax highlighting in test data

cc #11597

2 years agoMerge #11631
bors[bot] [Sun, 6 Mar 2022 03:19:54 +0000 (03:19 +0000)]
Merge #11631

11631: internal: Refactor syntax_highlighting r=Veykril a=Veykril

bors r+

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2 years agointernal: Simplify and optimize syntax_highlighting
Lukas Wirth [Sun, 6 Mar 2022 02:49:54 +0000 (03:49 +0100)]
internal: Simplify and optimize syntax_highlighting

2 years agoMerge #11630
bors[bot] [Sat, 5 Mar 2022 23:48:54 +0000 (23:48 +0000)]
Merge #11630

11630: fix: Recognize `Self` as a proper keyword r=Veykril a=Veykril

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

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2 years agoAdd a macro case for the keyword highlighting test fixture
Lukas Wirth [Sat, 5 Mar 2022 23:26:15 +0000 (00:26 +0100)]
Add a macro case for the keyword highlighting test fixture

2 years agoFix extern crate self having self unresolved
Lukas Wirth [Sat, 5 Mar 2022 23:17:40 +0000 (00:17 +0100)]
Fix extern crate self having self unresolved

2 years agoHighlight `Self` as a keyword by default
Lukas Wirth [Sat, 5 Mar 2022 23:12:10 +0000 (00:12 +0100)]
Highlight `Self` as a keyword by default

2 years agoSimplify
Lukas Wirth [Sat, 5 Mar 2022 22:53:24 +0000 (23:53 +0100)]
Simplify

2 years agoFix hover for `Self` keyword
Lukas Wirth [Sat, 5 Mar 2022 22:47:44 +0000 (23:47 +0100)]
Fix hover for `Self` keyword

2 years agoMerge #11629
bors[bot] [Sat, 5 Mar 2022 22:34:59 +0000 (22:34 +0000)]
Merge #11629

11629: fix: Fix macro-calls expanding to items in if/while conditions r=Veykril a=Veykril

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

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2 years agoFix highlighting of `Self`
Lukas Wirth [Sat, 5 Mar 2022 22:34:37 +0000 (23:34 +0100)]
Fix highlighting of `Self`

2 years agoFix test fixture
Lukas Wirth [Sat, 5 Mar 2022 21:44:49 +0000 (22:44 +0100)]
Fix test fixture

2 years agofix: Recognize `Self` as a proper keyword
Lukas Wirth [Sat, 5 Mar 2022 22:20:06 +0000 (23:20 +0100)]
fix: Recognize `Self` as a proper keyword

2 years agofix macro-calls always expanding to expressions in LetStmt
Lukas Wirth [Sat, 5 Mar 2022 21:04:06 +0000 (22:04 +0100)]
fix macro-calls always expanding to expressions in LetStmt

2 years agofix: Fix macro-calls expanding to items in if/while conditions
Lukas Wirth [Sat, 5 Mar 2022 20:58:51 +0000 (21:58 +0100)]
fix: Fix macro-calls expanding to items in if/while conditions

2 years agoMerge #11598
bors[bot] [Sat, 5 Mar 2022 11:31:29 +0000 (11:31 +0000)]
Merge #11598

11598: feat: Parse destructuring assignment r=Veykril a=ChayimFriedman2

Part of #11532.

Lowering is not as easy and may not even be feasible right now as it requires generating identifiers: `(a, b) = (b, a)` is desugared into
```rust
{
    let (<gensym_a>, <gensym_b>) = (b, a);
    a = <gensym_a>;
    b = <gensym_b>;
}
```

rustc uses hygiene to implement that, but we don't support hygiene yet.

However, I think parsing was the main problem as lowering will just affect type inference, and while `{unknown}` is not nice it's much better than a syntax error.

I'm still looking for the best way to do lowering, though.

Fixes #11454.

Co-authored-by: Chayim Refael Friedman <chayimfr@gmail.com>
2 years agoMerge #11574
bors[bot] [Sat, 5 Mar 2022 11:20:05 +0000 (11:20 +0000)]
Merge #11574

11574: Small refactor text edit 2nd r=Veykril a=HansAuger

Some more changes to text_edit. Basic idea is to make `Indel` implement `PartialOrd` to take advantage of some sweet sweet iteration, most notably itertool's `merge`.

Co-authored-by: Moritz Vetter <mv@3yourmind.com>
2 years agoMerge #11623
bors[bot] [Sat, 5 Mar 2022 10:32:07 +0000 (10:32 +0000)]
Merge #11623

11623: fix: Add type variable table to InferenceTableSnapshot r=flodiebold a=tysg

Fixes #11601.

I observed that removing the `rollback` line in https://github.com/rust-analyzer/rust-analyzer/commit/6fc3d3aa4cbf637d748c60cfdbb98b5f6a040576 fixes the issue.

Looking at the stacktrace, I believe not restoring `type_variable_table` causes `type_variable_table` and `var_unification_table` to go out of sync, then when `hir_ty::infer::unify::InferenceTable::new_var` tries to extend `type_variable_table` to be the same length as `var_unification_table`, problems will arise.

However, I cannot pinpoint exactly how or where the vector capacity overflow happens, so my understanding might not be correct after all.

Co-authored-by: Tianyi Song <42670338+tysg@users.noreply.github.com>
2 years agoAdd type variable table to InferenceTableSnapshot
Tianyi Song [Sat, 5 Mar 2022 09:59:28 +0000 (17:59 +0800)]
Add type variable table to InferenceTableSnapshot

2 years agoMerge #11622
bors[bot] [Fri, 4 Mar 2022 23:20:29 +0000 (23:20 +0000)]
Merge #11622

11622: show variadic args in hover function signature r=Veykril a=euclio

The current behavior is to ignore the ellipsis.

Co-authored-by: Andy Russell <arussell123@gmail.com>
2 years agoshow variadic args in hover function signature
Andy Russell [Fri, 4 Mar 2022 21:24:13 +0000 (16:24 -0500)]
show variadic args in hover function signature

2 years agoMerge #11595
bors[bot] [Fri, 4 Mar 2022 20:21:43 +0000 (20:21 +0000)]
Merge #11595

11595: fix: lower string literals with actual value instead of default r=lnicola a=tysg

Fixes #11582. Some questions below in the code review section.

Co-authored-by: Tianyi Song <42670338+tysg@users.noreply.github.com>
2 years agoMerge #11620
bors[bot] [Fri, 4 Mar 2022 19:47:39 +0000 (19:47 +0000)]
Merge #11620

11620: feat: Support locals with multiple declaration sites r=Veykril a=Veykril

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

This implements the first approach of https://github.com/rust-analyzer/rust-analyzer/issues/8860#issuecomment-845461773:
> treat every Local as having potentially many sources?

The way this is written does allow changing to a MultiLocal approach instead though, I'll investigate whether that turns out to be better or not.

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2 years agoSimplify
Lukas Wirth [Fri, 4 Mar 2022 19:09:32 +0000 (20:09 +0100)]
Simplify

2 years agoSupport locals with multiple declaration sites
Lukas Wirth [Fri, 4 Mar 2022 18:49:08 +0000 (19:49 +0100)]
Support locals with multiple declaration sites

2 years agoMerge #11140
bors[bot] [Fri, 4 Mar 2022 12:55:07 +0000 (12:55 +0000)]
Merge #11140

11140: Preserve order of generic args r=HKalbasi a=HKalbasi

https://github.com/rust-lang/rust/pull/90207 removed order restriction of generic args, i.e. const generics can now become before of type generics. We need to preserve this order to analyze correctly, and this PR does that.

It also simplifies implementation of const generics a bit IMO.

Implementing default generics the same problem of #7434, we need lower them to body and then evaluate them.

Co-authored-by: hkalbasi <hamidrezakalbasi@protonmail.com>
2 years agoResolve only type params in type ns
hkalbasi [Fri, 4 Mar 2022 09:00:53 +0000 (12:30 +0330)]
Resolve only type params in type ns

2 years agoPreserve order of generic args
hkalbasi [Wed, 29 Dec 2021 13:35:59 +0000 (17:05 +0330)]
Preserve order of generic args

2 years agoFix formatting
Laurențiu Nicola [Fri, 4 Mar 2022 06:15:17 +0000 (08:15 +0200)]
Fix formatting

2 years agoDrop hint conversion
Laurențiu Nicola [Fri, 4 Mar 2022 06:08:14 +0000 (08:08 +0200)]
Drop hint conversion

2 years agoBump vscode
Laurențiu Nicola [Fri, 4 Mar 2022 05:48:39 +0000 (07:48 +0200)]
Bump vscode

2 years agoRemove debugging leftovers
Kirill Bulatov [Sat, 12 Feb 2022 06:33:04 +0000 (08:33 +0200)]
Remove debugging leftovers

2 years agoLoad hints for part of the file only
Kirill Bulatov [Fri, 11 Feb 2022 22:48:01 +0000 (00:48 +0200)]
Load hints for part of the file only

2 years agoClean up the redundant hints code and config
Kirill Bulatov [Fri, 11 Feb 2022 23:03:32 +0000 (01:03 +0200)]
Clean up the redundant hints code and config

2 years agoFixes
Laurențiu Nicola [Thu, 10 Feb 2022 10:16:02 +0000 (12:16 +0200)]
Fixes

2 years agoUpdate inlay hints for upstream
Laurențiu Nicola [Wed, 9 Feb 2022 17:14:18 +0000 (19:14 +0200)]
Update inlay hints for upstream

2 years agoAdd log messages
Laurențiu Nicola [Wed, 9 Feb 2022 17:13:17 +0000 (19:13 +0200)]
Add log messages

2 years agoBump deps
Laurențiu Nicola [Wed, 9 Feb 2022 17:13:04 +0000 (19:13 +0200)]
Bump deps

2 years agoAdd experimental VSCode api
Kirill Bulatov [Tue, 9 Feb 2021 10:39:40 +0000 (12:39 +0200)]
Add experimental VSCode api

2 years agoLower string literals with real val, not default
Tianyi Song [Tue, 1 Mar 2022 07:44:53 +0000 (15:44 +0800)]
Lower string literals with real val, not default

2 years agoMerge #11616
bors[bot] [Thu, 3 Mar 2022 22:25:42 +0000 (22:25 +0000)]
Merge #11616

11616: fix: Fix semantic highlighting breaking for lifetimes in macros r=Veykril a=Veykril

bors r+

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>