]> git.lizzy.rs Git - rust.git/log
rust.git
4 years agoIDE API
Aleksey Kladov [Mon, 8 Jun 2020 10:52:28 +0000 (12:52 +0200)]
IDE API

4 years agoMerge #4781
bors[bot] [Mon, 8 Jun 2020 09:48:38 +0000 (09:48 +0000)]
Merge #4781

4781: Remove redundancy in syntax highlighting tests r=matklad a=ltentrup

Follow up from #4683. Improves syntax highlighting testing by introducing a function that contains the boilerplate comparison code. Keeps the `ra_fixture` argument in the first position, thus, the editor syntax highlighting injection still works.

Co-authored-by: Leander Tentrup <leander.tentrup@gmail.com>
4 years agoMerge #4770
bors[bot] [Mon, 8 Jun 2020 09:37:37 +0000 (09:37 +0000)]
Merge #4770

4770: Clean up handling of int/float literal types r=matklad a=flodiebold

'Unknown' int/float types actually never exist as such, they get replaced by type variables immediately. So the whole `Uncertain<IntTy>` thing was unnecessary and just led to a bunch of match branches that were never hit.

Co-authored-by: Florian Diebold <flodiebold@gmail.com>
4 years agoMerge #4787
bors[bot] [Mon, 8 Jun 2020 09:05:09 +0000 (09:05 +0000)]
Merge #4787

4787: Fix bug in lexer for format specifier r=matklad a=ltentrup

The `type` and `width` were not correctly distinguished.
Fixes #4696.

Co-authored-by: Leander Tentrup <leander.tentrup@gmail.com>
4 years agoMerge #4788
bors[bot] [Sun, 7 Jun 2020 22:24:40 +0000 (22:24 +0000)]
Merge #4788

4788: Update quote r=kjeremy a=kjeremy

Co-authored-by: Jeremy Kolb <kjeremy@gmail.com>
4 years agoUpdate quote
Jeremy Kolb [Sun, 7 Jun 2020 22:21:38 +0000 (18:21 -0400)]
Update quote

4 years agoMerge #4780
bors[bot] [Sun, 7 Jun 2020 21:27:37 +0000 (21:27 +0000)]
Merge #4780

4780: Fix VSCode settings r=SomeoneToIgnore a=vincentisambart

closes #4779

#4779 was reproducing every time, so doing a bisect I found out the problem to be coming from #4730.
The only change to the extension that #4730 included was changes to editors/code/package.json.
So I tried modifying those changes a bit and got it working.

Co-authored-by: Vincent Isambart <vincent.isambart@gmail.com>
4 years agoFix bug in lexer for format specifier where the `type` and `width` were not correctly...
Leander Tentrup [Sun, 7 Jun 2020 20:57:24 +0000 (22:57 +0200)]
Fix bug in lexer for format specifier where the `type` and `width` were not correctly distinguished

4 years agoRemove redundancy in syntax highlighting tests
Leander Tentrup [Sun, 7 Jun 2020 12:50:02 +0000 (14:50 +0200)]
Remove redundancy in syntax highlighting tests

4 years agoFix VSCode settings
Vincent Isambart [Sun, 7 Jun 2020 03:07:00 +0000 (12:07 +0900)]
Fix VSCode settings

4 years agoMerge #4772
bors[bot] [Sat, 6 Jun 2020 17:55:13 +0000 (17:55 +0000)]
Merge #4772

4772: Document certain invariants r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
4 years agoDocument certain invariants
Aleksey Kladov [Sat, 6 Jun 2020 17:54:41 +0000 (19:54 +0200)]
Document certain invariants

4 years agoDocument import style
Aleksey Kladov [Sat, 6 Jun 2020 17:32:45 +0000 (19:32 +0200)]
Document import style

4 years agoClean up handling of int/float literal types
Florian Diebold [Sat, 6 Jun 2020 15:52:00 +0000 (17:52 +0200)]
Clean up handling of int/float literal types

'Unknown' int/float types actually never exist as such, they get replaced by
type variables immediately. So the whole `Uncertain<IntTy>` thing was
unnecessary and just led to a bunch of match branches that were never hit.

4 years agoMerge #4769
bors[bot] [Sat, 6 Jun 2020 15:05:59 +0000 (15:05 +0000)]
Merge #4769

4769: Fix Run lens. r=matklad a=vsrs

This PR fixes a bug introduced in https://github.com/rust-analyzer/rust-analyzer/pull/4710: second and all subsequent clicks on the Run lens produce invalid commands:

1. `cargo test --package ra_ide --lib -- hover::tests::test_hover_enum_has_impl_action --exact --nocapture`
2. `cargo test --package ra_ide --lib -- hover::tests::test_hover_enum_has_impl_action --exact --nocapture` **`-- hover::tests::test_hover_enum_has_impl_action --exact --nocapture`**
3. `cargo test --package ra_ide --lib -- hover::tests::test_hover_enum_has_impl_action --exact --nocapture` **`-- hover::tests::test_hover_enum_has_impl_action --exact --nocapture -- hover::tests::test_hover_enum_has_impl_action --exact --nocapture`**

Co-authored-by: vsrs <vit@conrlab.com>
4 years agoFix Run lens.
vsrs [Sat, 6 Jun 2020 12:12:17 +0000 (15:12 +0300)]
Fix Run lens.

4 years agoMerge #4765
bors[bot] [Sat, 6 Jun 2020 10:56:59 +0000 (10:56 +0000)]
Merge #4765

4765: Fix type parameter defaults r=matklad a=flodiebold

They should not be applied in expression or pattern contexts, unless there are other explicitly given type args.

(The existing tests about this were actually wrong.)

Co-authored-by: Florian Diebold <florian.diebold@freiheit.com>
4 years agoFix type parameter defaults
Florian Diebold [Fri, 29 May 2020 17:14:04 +0000 (19:14 +0200)]
Fix type parameter defaults

They should not be applied in expression or pattern contexts, unless there are
other explicitly given type args.

4 years agoMerge #4761
bors[bot] [Fri, 5 Jun 2020 16:05:06 +0000 (16:05 +0000)]
Merge #4761

4761: Upgrade Chalk to published version r=matklad a=flodiebold

CC @pksunkara

Co-authored-by: Florian Diebold <florian.diebold@freiheit.com>
4 years agoMerge #4689
bors[bot] [Fri, 5 Jun 2020 15:46:28 +0000 (15:46 +0000)]
Merge #4689

4689: Implement return position impl trait / opaque type support r=matklad a=flodiebold

This is working, but I'm not that happy with how the lowering works. We might need an additional representation between `TypeRef` and `Ty` where names are resolved and `impl Trait` bounds are separated out, but things like inference variables don't exist and `impl Trait` is always represented the same way.

Also note that this doesn't implement correct handling of RPIT *inside* the function (which involves turning the `impl Trait`s into variables and creating obligations for them). That intermediate representation might help there as well.

Co-authored-by: Florian Diebold <flodiebold@gmail.com>
Co-authored-by: Florian Diebold <florian.diebold@freiheit.com>
4 years agoReview fixes
Florian Diebold [Fri, 5 Jun 2020 15:41:58 +0000 (17:41 +0200)]
Review fixes

4 years agoMerge #4760
bors[bot] [Fri, 5 Jun 2020 15:23:22 +0000 (15:23 +0000)]
Merge #4760

4760: Minimize FileLoader interface r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
4 years agoMinimize FileLoader interface
Aleksey Kladov [Fri, 5 Jun 2020 14:45:20 +0000 (16:45 +0200)]
Minimize FileLoader interface

4 years agoMerge #4729 #4748
bors[bot] [Fri, 5 Jun 2020 15:14:35 +0000 (15:14 +0000)]
Merge #4729 #4748

4729: Hover actions r=matklad a=vsrs

This PR adds a `hoverActions` LSP extension and a `Go to Implementations` action as an example:
![hover_actions_impl](https://user-images.githubusercontent.com/62505555/83335732-6d9de280-a2b7-11ea-8cc3-75253d062fe0.gif)

4748: Add an `ImportMap` and use it to resolve item paths in `find_path` r=matklad a=jonas-schievink

Removes the "go faster" queries I added in https://github.com/rust-analyzer/rust-analyzer/pull/4501 and https://github.com/rust-analyzer/rust-analyzer/pull/4506. I've checked this PR on the rustc code base and the assists are still fast.

This should fix https://github.com/rust-analyzer/rust-analyzer/issues/4515.

Note that this does introduce a change in behavior: We now always refer to items defined in external crates using paths through the external crate. Previously we could also use a local path (if for example the extern crate was reexported locally), as seen in the changed test. If that is undesired I can fix that, but the test didn't say why the previous behavior would be preferable.

Co-authored-by: vsrs <vit@conrlab.com>
Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
Co-authored-by: Jonas Schievink <jonas.schievink@ferrous-systems.com>
4 years agoImplement return position impl trait / opaque type support
Florian Diebold [Wed, 4 Mar 2020 22:00:44 +0000 (23:00 +0100)]
Implement return position impl trait / opaque type support

This is working, but I'm not that happy with how the lowering works. We might
need an additional representation between `TypeRef` and `Ty` where names are
resolved and `impl Trait` bounds are separated out, but things like inference
variables don't exist and `impl Trait` is always represented the same
way.

Also note that this doesn't implement correct handling of RPIT *inside* the
function (which involves turning the `impl Trait`s into variables and creating
obligations for them). That intermediate representation might help there as
well.

4 years agoUpgrade Chalk to published version
Florian Diebold [Fri, 5 Jun 2020 15:06:07 +0000 (17:06 +0200)]
Upgrade Chalk to published version

4 years agoMerge #4758
bors[bot] [Fri, 5 Jun 2020 13:51:35 +0000 (13:51 +0000)]
Merge #4758

4758: Actually test include!(concant!(env!())); r=matklad a=matklad

It triggered index-based goto definition before :-(

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
4 years agoActually test include!(concant!(env!()));
Aleksey Kladov [Fri, 5 Jun 2020 13:49:12 +0000 (15:49 +0200)]
Actually test include!(concant!(env!()));

It triggered index-based goto definition before :-(

4 years agoMerge #4757
bors[bot] [Fri, 5 Jun 2020 13:34:44 +0000 (13:34 +0000)]
Merge #4757

4757: Update inotify r=matklad a=matklad

https://github.com/rust-analyzer/rust-analyzer/issues/4224#issuecomment-639328191

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
4 years agoUpdate inotify
Aleksey Kladov [Fri, 5 Jun 2020 13:33:55 +0000 (15:33 +0200)]
Update inotify

https://github.com/rust-analyzer/rust-analyzer/issues/4224#issuecomment-639328191

4 years agoMerge #4756
bors[bot] [Fri, 5 Jun 2020 13:15:31 +0000 (13:15 +0000)]
Merge #4756

4756: Cleanup resolution of file paths r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
4 years agoCleanup test
Aleksey Kladov [Fri, 5 Jun 2020 13:14:47 +0000 (15:14 +0200)]
Cleanup test

4 years agoMore direct signature for resolve_path
Aleksey Kladov [Fri, 5 Jun 2020 13:07:30 +0000 (15:07 +0200)]
More direct signature for resolve_path

4 years agoRename resolve_relative_path -> resolve_path
Aleksey Kladov [Fri, 5 Jun 2020 12:55:23 +0000 (14:55 +0200)]
Rename resolve_relative_path -> resolve_path

For things like `concant!(env!("OUT_DIR"))`, we need to support abs paths

4 years agoRemove hover actions heavy tests.
vsrs [Fri, 5 Jun 2020 12:26:46 +0000 (15:26 +0300)]
Remove hover actions heavy tests.

4 years agoRemove hover contents marking as trusted.
vsrs [Fri, 5 Jun 2020 12:25:01 +0000 (15:25 +0300)]
Remove hover contents marking as trusted.

Hover contents might be extracted from raw
doc comments and need some validation.

4 years agoClarify when we visit modules multiple times
Jonas Schievink [Fri, 5 Jun 2020 12:24:51 +0000 (14:24 +0200)]
Clarify when we visit modules multiple times

4 years agoMerge #4755
bors[bot] [Fri, 5 Jun 2020 12:01:10 +0000 (12:01 +0000)]
Merge #4755

4755: Inlay Hints: more directly account for self param r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
4 years agoAdd capabilities tests.
vsrs [Wed, 3 Jun 2020 14:35:26 +0000 (17:35 +0300)]
Add capabilities tests.

4 years agoApply suggestions from @kjeremy review
vsrs [Wed, 3 Jun 2020 13:39:32 +0000 (16:39 +0300)]
Apply suggestions from @kjeremy  review

4 years agoAdd enum hover action test.
vsrs [Wed, 3 Jun 2020 12:29:03 +0000 (15:29 +0300)]
Add enum hover action test.

4 years agoRebase on the latest master.
vsrs [Wed, 3 Jun 2020 12:13:26 +0000 (15:13 +0300)]
Rebase on the latest master.

4 years agoCode formatting
vsrs [Wed, 3 Jun 2020 11:44:40 +0000 (14:44 +0300)]
Code formatting

4 years agoAdd hover actions LSP extension documentation.
vsrs [Wed, 3 Jun 2020 11:34:11 +0000 (14:34 +0300)]
Add hover actions LSP extension documentation.

4 years agoAdd hover actions as LSP extension
vsrs [Wed, 3 Jun 2020 11:15:54 +0000 (14:15 +0300)]
Add hover actions as LSP extension

4 years agoInlay Hints: more directly account for self param
Aleksey Kladov [Fri, 5 Jun 2020 11:58:52 +0000 (13:58 +0200)]
Inlay Hints: more directly account for self param

4 years agoimpl Debug for ImportMap
Jonas Schievink [Fri, 5 Jun 2020 11:36:19 +0000 (13:36 +0200)]
impl Debug for ImportMap

4 years agoReorder imports
Jonas Schievink [Fri, 5 Jun 2020 11:15:16 +0000 (13:15 +0200)]
Reorder imports

4 years agoMake `find_path_inner` private again
Jonas Schievink [Fri, 5 Jun 2020 11:11:53 +0000 (13:11 +0200)]
Make `find_path_inner` private again

4 years agoMeasure memory usage of ImportMap
Jonas Schievink [Fri, 5 Jun 2020 11:10:43 +0000 (13:10 +0200)]
Measure memory usage of ImportMap

4 years agodefining_crate -> krate
Jonas Schievink [Fri, 5 Jun 2020 11:05:19 +0000 (13:05 +0200)]
defining_crate -> krate

4 years agoFix wrong comment
Jonas Schievink [Fri, 5 Jun 2020 11:04:35 +0000 (13:04 +0200)]
Fix wrong comment

4 years agoMerge #4750
bors[bot] [Fri, 5 Jun 2020 07:56:11 +0000 (07:56 +0000)]
Merge #4750

4750: introduce_named_lifetime assist wasn't applicable when type parameter r=matklad a=jbalint

followed anonymous lifetime token

(fixes #4684)

Co-authored-by: Jess Balint <jbalint@gmail.com>
4 years agointroduce_named_lifetime assist wasn't applicable when type parameter
Jess Balint [Wed, 3 Jun 2020 22:54:23 +0000 (17:54 -0500)]
introduce_named_lifetime assist wasn't applicable when type parameter
followed anonymous lifetime token

(fixes #4684)

4 years agoMerge #4737
bors[bot] [Thu, 4 Jun 2020 17:51:03 +0000 (17:51 +0000)]
Merge #4737

4737: Parse default unsafe & default const r=matklad a=Avi-D-coder

Closes: #4718 #4264
Co-authored-by: Avi Dessauer <avi.the.coder@gmail.com>
4 years agoUse `ImportMap` in `find_path`, remove old queries
Jonas Schievink [Thu, 4 Jun 2020 17:30:29 +0000 (19:30 +0200)]
Use `ImportMap` in `find_path`, remove old queries

4 years agoAdd an ImportMap
Jonas Schievink [Wed, 20 May 2020 21:51:20 +0000 (23:51 +0200)]
Add an ImportMap

4 years agoMove default const test out of line
Avi Dessauer [Thu, 4 Jun 2020 17:06:26 +0000 (13:06 -0400)]
Move default const test out of line

4 years agoAddress review
Avi Dessauer [Thu, 4 Jun 2020 17:00:21 +0000 (13:00 -0400)]
Address review

4 years agoMerge #4740
bors[bot] [Thu, 4 Jun 2020 13:04:24 +0000 (13:04 +0000)]
Merge #4740

4740: Remove unneeded "./" prefix affecting error messages r=kjeremy a=dtolnay

I noticed this in the error in the commit message of https://github.com/rust-analyzer/rust-analyzer/pull/4739.

Before:

```console
error[E0599]: no method named `initialize_finish` found for struct `lsp_server::Connection` in the current scope
  --> crates/rust-analyzer/./src/bin/main.rs:99:16
   |
99 |     connection.initialize_finish(initialize_id, initialize_result)?;
   |                ^^^^^^^^^^^^^^^^^ method not found in `lsp_server::Connection`
```

After:

```console
error[E0599]: no method named `initialize_finish` found for struct `lsp_server::Connection` in the current scope
  --> crates/rust-analyzer/src/bin/main.rs:99:16
   |
99 |     connection.initialize_finish(initialize_id, initialize_result)?;
   |                ^^^^^^^^^^^^^^^^^ method not found in `lsp_server::Connection`
```

```diff
-   --> crates/rust-analyzer/./src/bin/main.rs:99:16
+   --> crates/rust-analyzer/src/bin/main.rs:99:16
```

Co-authored-by: David Tolnay <dtolnay@gmail.com>
4 years agoMerge #4739
bors[bot] [Thu, 4 Jun 2020 10:45:06 +0000 (10:45 +0000)]
Merge #4739

4739: Declare required lsp-server dependency of rust-analyzer crate r=jonas-schievink a=dtolnay

My codebase already depended on lsp-server and introducing a dependency on rust-analyzer failed at first because it assumes some functions that were first present in lsp-server 0.3.2.

Without this change:

```console
error[E0599]: no method named `initialize_start` found for struct `lsp_server::Connection` in the current scope
  --> crates/rust-analyzer/./src/bin/main.rs:83:57
   |
83 |     let (initialize_id, initialize_params) = connection.initialize_start()?;
   |                                                         ^^^^^^^^^^^^^^^^ method not found in `lsp_server::Connection`

error[E0599]: no method named `initialize_finish` found for struct `lsp_server::Connection` in the current scope
  --> crates/rust-analyzer/./src/bin/main.rs:99:16
   |
99 |     connection.initialize_finish(initialize_id, initialize_result)?;
   |                ^^^^^^^^^^^^^^^^^ method not found in `lsp_server::Connection`
```

Co-authored-by: David Tolnay <dtolnay@gmail.com>
4 years agoMerge #4741
bors[bot] [Thu, 4 Jun 2020 08:09:56 +0000 (08:09 +0000)]
Merge #4741

4741: Fix type inference failure when built with log/kv_unstable r=flodiebold a=dtolnay

This code is broken by an `impl From<kv::Error> for fmt::Error` in the log crate when building in a codebase that has the log/kv_unstable feature enabled.

```console
$ cargo check --manifest-path crates/ra_hir_def/Cargo.toml
    Checking ra_hir_def v0.1.0
    Finished dev [unoptimized] target(s) in 0.75s

$ cargo check --manifest-path crates/ra_hir_def/Cargo.toml --features log/kv_unstable
    Checking ra_hir_def v0.1.0
error[E0282]: type annotations needed for the closure `fn(&str) -> std::result::Result<(), _>`
   --> crates/ra_hir_def/src/path.rs:278:17
    |
278 |                 f.write_str("::")?;
    |                 ^^^^^^^^^^^^^^^^^^ cannot infer type
    |
help: give this closure an explicit return type without `_` placeholders
    |
276 |         let mut add_segment = |s| -> std::result::Result<(), _> {
    |                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
```

https://github.com/rust-lang/log/issues/397

Co-authored-by: David Tolnay <dtolnay@gmail.com>
4 years agoFix type inference failure when built with log/kv_unstable
David Tolnay [Thu, 4 Jun 2020 02:05:55 +0000 (19:05 -0700)]
Fix type inference failure when built with log/kv_unstable

This code is broken by an `impl From<kv::Error> for fmt::Error` in the
log crate when building in a codebase that has the log/kv_unstable
feature enabled.

    $ cargo check --manifest-path crates/ra_hir_def/Cargo.toml
        Checking ra_hir_def v0.1.0
        Finished dev [unoptimized] target(s) in 0.75s

    $ cargo check --manifest-path crates/ra_hir_def/Cargo.toml --features log/kv_unstable
        Checking ra_hir_def v0.1.0
    error[E0282]: type annotations needed for the closure `fn(&str) -> std::result::Result<(), _>`
       --> crates/ra_hir_def/src/path.rs:278:17
        |
    278 |                 f.write_str("::")?;
        |                 ^^^^^^^^^^^^^^^^^^ cannot infer type
        |
    help: give this closure an explicit return type without `_` placeholders
        |
    276 |         let mut add_segment = |s| -> std::result::Result<(), _> {
        |                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

4 years agoRemove unneeded "./" prefix affecting error messages
David Tolnay [Thu, 4 Jun 2020 01:01:24 +0000 (18:01 -0700)]
Remove unneeded "./" prefix affecting error messages

Before:

    error[E0599]: no method named `initialize_finish` found for struct `lsp_server::Connection` in the current scope
      --> crates/rust-analyzer/./src/bin/main.rs:99:16
       |
    99 |     connection.initialize_finish(initialize_id, initialize_result)?;
       |                ^^^^^^^^^^^^^^^^^ method not found in `lsp_server::Connection`

After:

    error[E0599]: no method named `initialize_finish` found for struct `lsp_server::Connection` in the current scope
      --> crates/rust-analyzer/src/bin/main.rs:99:16
       |
    99 |     connection.initialize_finish(initialize_id, initialize_result)?;
       |                ^^^^^^^^^^^^^^^^^ method not found in `lsp_server::Connection`

4 years agoDeclare required lsp-server dependency of rust-analyzer crate
David Tolnay [Thu, 4 Jun 2020 00:55:06 +0000 (17:55 -0700)]
Declare required lsp-server dependency of rust-analyzer crate

My codebase already depended on lsp-server and introducing a dependency
on rust-analyzer failed at first because it assumes some functions that
were first present in lsp-server 0.3.2.

Without this change:

    error[E0599]: no method named `initialize_start` found for struct `lsp_server::Connection` in the current scope
      --> crates/rust-analyzer/./src/bin/main.rs:83:57
       |
    83 |     let (initialize_id, initialize_params) = connection.initialize_start()?;
       |                                                         ^^^^^^^^^^^^^^^^ method not found in `lsp_server::Connection`

    error[E0599]: no method named `initialize_finish` found for struct `lsp_server::Connection` in the current scope
      --> crates/rust-analyzer/./src/bin/main.rs:99:16
       |
    99 |     connection.initialize_finish(initialize_id, initialize_result)?;
       |                ^^^^^^^^^^^^^^^^^ method not found in `lsp_server::Connection`

4 years agoMerge #4736
bors[bot] [Thu, 4 Jun 2020 00:43:11 +0000 (00:43 +0000)]
Merge #4736

4736: Bugfix r=kjeremy a=Veetaha

Co-authored-by: Veetaha <veetaha2@gmail.com>
4 years agoUpdate tests
Avi Dessauer [Thu, 4 Jun 2020 00:39:57 +0000 (20:39 -0400)]
Update tests

4 years agoParse default unsafe & default const
Avi Dessauer [Wed, 3 Jun 2020 19:21:47 +0000 (15:21 -0400)]
Parse default unsafe & default const

4 years agoBufgix
Veetaha [Wed, 3 Jun 2020 22:48:47 +0000 (01:48 +0300)]
Bufgix

4 years agoMerge #4717
bors[bot] [Wed, 3 Jun 2020 20:31:25 +0000 (20:31 +0000)]
Merge #4717

4717: Implementation of lazy assits r=matklad a=mcrakhman

Co-authored-by: Mikhail Rakhmanov <rakhmanov.m@gmail.com>
4 years agoFix more comments
Mikhail Rakhmanov [Wed, 3 Jun 2020 17:33:57 +0000 (19:33 +0200)]
Fix more comments

4 years agoMerge branch 'master' into compute-lazy-assits
Mikhail Rakhmanov [Wed, 3 Jun 2020 17:26:01 +0000 (19:26 +0200)]
Merge branch 'master' into compute-lazy-assits

# Conflicts:
# crates/rust-analyzer/src/main_loop/handlers.rs
# crates/rust-analyzer/src/to_proto.rs

4 years agoAdd documentation
Mikhail Rakhmanov [Wed, 3 Jun 2020 16:57:50 +0000 (18:57 +0200)]
Add documentation

4 years agoFix review comments
Mikhail Rakhmanov [Wed, 3 Jun 2020 16:39:01 +0000 (18:39 +0200)]
Fix review comments

4 years agoMerge #4734
bors[bot] [Wed, 3 Jun 2020 16:30:57 +0000 (16:30 +0000)]
Merge #4734

4734: Don't store generated docs in the repo r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
4 years agoDon't store generated docs in the repo
Aleksey Kladov [Wed, 3 Jun 2020 16:22:05 +0000 (18:22 +0200)]
Don't store generated docs in the repo

4 years agoMerge #4733
bors[bot] [Wed, 3 Jun 2020 13:54:52 +0000 (13:54 +0000)]
Merge #4733

4733: Cargo update r=kjeremy a=kjeremy

Co-authored-by: kjeremy <kjeremy@gmail.com>
4 years agoCargo update
kjeremy [Wed, 3 Jun 2020 13:43:27 +0000 (09:43 -0400)]
Cargo update

4 years agoMerge #4502
bors[bot] [Wed, 3 Jun 2020 13:39:30 +0000 (13:39 +0000)]
Merge #4502

4502: Mark fixes from diagnostics as quick fixes r=kjeremy a=kjeremy

Populates the diagnostic UI with fixes:

Before:
![quickfix-before](https://user-images.githubusercontent.com/4325700/82165183-0e38df00-9882-11ea-96cf-7dab5faec4d4.PNG)

After:
![image](https://user-images.githubusercontent.com/4325700/82165193-1a24a100-9882-11ea-97d7-be1b64b135e0.png)

Co-authored-by: Jeremy Kolb <kjeremy@gmail.com>
4 years agoMark fixes from diagnostics as quick fixes
Jeremy Kolb [Mon, 18 May 2020 01:03:40 +0000 (21:03 -0400)]
Mark fixes from diagnostics as quick fixes

4 years agoMerge #4730
bors[bot] [Wed, 3 Jun 2020 13:18:12 +0000 (13:18 +0000)]
Merge #4730

4730: Document rust-project.json r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
4 years agoDocument rust-project.json
Aleksey Kladov [Wed, 3 Jun 2020 12:48:38 +0000 (14:48 +0200)]
Document rust-project.json

4 years agoMerge #4678
bors[bot] [Wed, 3 Jun 2020 11:27:10 +0000 (11:27 +0000)]
Merge #4678

4678: Unsquish parameter types in tooltips for macro-generated functions r=aloucks a=aloucks

Note the missing whitespace between `:` and the parameter type.

Before:
![image](https://user-images.githubusercontent.com/221559/83364680-faf13d80-a370-11ea-96b7-a041969a4954.png)

After:
![image](https://user-images.githubusercontent.com/221559/83364685-03e20f00-a371-11ea-9668-4e6ebcb81947.png)

Co-authored-by: Aaron Loucks <aloucks@cofront.net>
4 years agoUse split1 when formatting function signature params
Aaron Loucks [Wed, 3 Jun 2020 11:26:15 +0000 (07:26 -0400)]
Use split1 when formatting function signature params

4 years agoMerge #4660
bors[bot] [Wed, 3 Jun 2020 11:05:52 +0000 (11:05 +0000)]
Merge #4660

4660: Enable hover and autocomplete docs on macro generated items r=aloucks a=aloucks

Enable hover and autocomplete docs on macro generated items. This de-sugars doc comments into `doc` attributes in some cases, but not all. Comments and `doc` attributes are then merged together.

This PR is essentially a partial implementation of what's being suggested #3182, but it's not all the way there yet. ~I still need to add unit tests~, but I wanted to first get feedback on whether or not this was an acceptable path forward.

Fixes #4564
Fixes #3984
Fixes #3180
Related #3182

![macro_item_docs](https://user-images.githubusercontent.com/221559/83336760-15012200-a284-11ea-8d0d-b6a615850044.gif)

Co-authored-by: Aaron Loucks <aloucks@cofront.net>
4 years agoUpdate generated feature docs
Aaron Loucks [Wed, 3 Jun 2020 10:55:27 +0000 (06:55 -0400)]
Update generated feature docs

4 years agoConsolidate documentation expansion and merging
Aaron Loucks [Wed, 3 Jun 2020 10:14:56 +0000 (06:14 -0400)]
Consolidate documentation expansion and merging

Removes the duplicated `expand_doc_attrs` and `merge_doc_comments_and_attrs`
functions from `ra_ide` and exposes the same functionality via
`ra_hir::Documentation::from_ast`.

4 years agoAdd basic hover and completion doc tests for macro generated items
Aaron Loucks [Sun, 31 May 2020 15:33:48 +0000 (11:33 -0400)]
Add basic hover and completion doc tests for macro generated items

4 years agoEnable hover and autocomplete docs on macro generated items
Aaron Loucks [Sat, 30 May 2020 18:21:06 +0000 (14:21 -0400)]
Enable hover and autocomplete docs on macro generated items

4 years agoMerge #4727
bors[bot] [Wed, 3 Jun 2020 10:40:12 +0000 (10:40 +0000)]
Merge #4727

4727: Drop test for old format r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
4 years agoDrop test for old format
Aleksey Kladov [Wed, 3 Jun 2020 10:39:11 +0000 (12:39 +0200)]
Drop test for old format

4 years agoMerge #4726
bors[bot] [Wed, 3 Jun 2020 10:26:38 +0000 (10:26 +0000)]
Merge #4726

4726: Groundwork for specifying the set of projects via config r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
4 years agoGroundwork for specifying the set of projects via config
Aleksey Kladov [Wed, 3 Jun 2020 10:22:01 +0000 (12:22 +0200)]
Groundwork for specifying the set of projects via config

4 years agoRename ProjectRoot -> ProjectManifest
Aleksey Kladov [Wed, 3 Jun 2020 10:05:50 +0000 (12:05 +0200)]
Rename ProjectRoot -> ProjectManifest

4 years agoMove project discovery
Aleksey Kladov [Wed, 3 Jun 2020 09:44:51 +0000 (11:44 +0200)]
Move project discovery

4 years agoMerge #4724
bors[bot] [Wed, 3 Jun 2020 09:20:30 +0000 (09:20 +0000)]
Merge #4724

4724: Rename WorldState -> GlobalState r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
4 years agoRename WorldState -> GlobalState
Aleksey Kladov [Wed, 3 Jun 2020 09:16:08 +0000 (11:16 +0200)]
Rename WorldState -> GlobalState

4 years agoMerge #4723
bors[bot] [Wed, 3 Jun 2020 09:08:20 +0000 (09:08 +0000)]
Merge #4723

4723: Derive local roots from Workspaces r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
4 years agoDrop no-project test
Aleksey Kladov [Wed, 3 Jun 2020 09:07:04 +0000 (11:07 +0200)]
Drop no-project test

Eventually, we should support "just open random rust file" use case,
we don't really do this now, so let's avoid spending time on it until
we fix it properly.

4 years agoDerive local roots from Workspaces
Aleksey Kladov [Wed, 3 Jun 2020 08:52:35 +0000 (10:52 +0200)]
Derive local roots from Workspaces