Commit Graph

8863 Commits

Author SHA1 Message Date
Aleksey Kladov
b46fd38632 sort imports 2020-04-01 00:16:16 +02:00
bors[bot]
f77fc158fc
Merge #3780 #3787
3780: Simplify r=matklad a=Veetaha

I absolutely love tha fact that removing `.clone()` simplifies the code comparing to other languages where it's actually the contrary (ahem ~~`std::move()`~~)

3787: vscode: add syntax tree inspection hovers and highlights r=matklad a=Veetaha

![inspect-tree](https://user-images.githubusercontent.com/36276403/78029767-c7426900-7369-11ea-9ed6-b8a0f8e05bac.gif)
I implemented the reverse mapping (when you hover in the rust editor), but it seems overcomplicated, so I removed it

Related #3682 

Co-authored-by: veetaha <veetaha2@gmail.com>
Co-authored-by: Veetaha <veetaha2@gmail.com>
2020-03-31 17:40:03 +00:00
bors[bot]
f9f0a96b7f
Merge #3795
3795: Reduce deps r=matklad a=matklad



bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2020-03-31 17:30:18 +00:00
Aleksey Kladov
8d27829781 Reduce deps 2020-03-31 19:29:11 +02:00
veetaha
90cc8cc528 vscode: small refactor 2020-03-31 20:29:07 +03:00
veetaha
f3612b7024 vscode: scroll to the syntax node in rust editor when highlighting 2020-03-31 20:28:10 +03:00
bors[bot]
37a01de42c
Merge #3793
3793: Add integrated test for concat include env r=matklad a=matklad



bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2020-03-31 17:19:37 +00:00
Aleksey Kladov
a4f9d966f0 Add integrated test for concat include env 2020-03-31 19:19:14 +02:00
Veetaha
3b09768ebc
vscode: apply review nits 2020-03-31 19:06:07 +03:00
veetaha
611adc83da Simplify 2020-03-31 19:00:23 +03:00
bors[bot]
47c9ee2355
Merge #3792
3792: Rename cargo_watch -> flycheck r=matklad a=matklad



bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2020-03-31 15:30:23 +00:00
Aleksey Kladov
70730d7655 Rename cargo_watch -> flycheck 2020-03-31 17:29:40 +02:00
veetaha
e86bfc0995 vscode: add docs about syntax tree 2020-03-31 18:26:53 +03:00
bors[bot]
33a9b947a2
Merge #3791
3791: Revert accidental package.json changes r=matklad a=matklad



bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2020-03-31 15:00:50 +00:00
Aleksey Kladov
6343ddd009 Revert accidental package.json changes 2020-03-31 17:00:15 +02:00
bors[bot]
7a546490ec
Merge #3738
3738: Implement ra_proc_macro client logic r=matklad a=edwin0cheng

This PR add the actual client logic for `ra_proc_macro` crate:

1. Define all necessary rpc serialization data structure, which include `ra_tt` related data and some task messages. Although adding `Serialize` and `Deserialize` trait to ra_tt directly seem to be much easier,   we deliberately duplicate the `ra_tt` struct with `#[serde(with = "XXDef")]` for separation of  code responsibility. 
2. Define a simplified version of lsp base protocol for rpc, which basically copy from lsp-server code base. 
3. Implement the actual `IO` for the client side progress spawning and message passing.

Co-authored-by: Edwin Cheng <edwin0cheng@gmail.com>
2020-03-31 14:30:24 +00:00
Edwin Cheng
207903a1c3 Fix rebased 2020-03-31 22:29:27 +08:00
Edwin Cheng
3bc1670feb Redirect stderr to null 2020-03-31 22:20:19 +08:00
Edwin Cheng
6ed030d4b6 Pipe error to stderr 2020-03-31 22:20:19 +08:00
Edwin Cheng
02b849a2a0 Refactor a bit 2020-03-31 22:20:19 +08:00
Edwin Cheng
f461dc48d1 Use a weak ptr to hold the send end of channel 2020-03-31 22:20:19 +08:00
Edwin Cheng
b929d05c74 Add drop for process 2020-03-31 22:20:19 +08:00
Edwin Cheng
e7d1549e13 Unwrap channel send() 2020-03-31 22:20:19 +08:00
Edwin Cheng
7f7a16675d Use jod_thread 2020-03-31 22:20:19 +08:00
Edwin Cheng
39706a5786 Fix formatting 2020-03-31 22:20:19 +08:00
Edwin Cheng
0aacacd4a2 Simple cross-process message protocol 2020-03-31 22:20:18 +08:00
Edwin Cheng
7155d5df89 Remove unused struct 2020-03-31 22:20:18 +08:00
Edwin Cheng
55061b489f Improve shutdown process 2020-03-31 22:20:18 +08:00
Edwin Cheng
1b8a26653f Use matches in is_dylib 2020-03-31 22:20:18 +08:00
Edwin Cheng
3b97220926 Add back doc string for process 2020-03-31 22:20:18 +08:00
Edwin Cheng
fa621f80fa Fix test 2020-03-31 22:20:18 +08:00
Edwin Cheng
503cbd3f4b Implement ra_proc_macro client logic 2020-03-31 22:20:18 +08:00
bors[bot]
fa3c7742af
Merge #3790
3790: Better names for config structs r=matklad a=matklad



bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2020-03-31 14:06:03 +00:00
Aleksey Kladov
569f47e427 Better names for config structs 2020-03-31 16:05:25 +02:00
bors[bot]
6546edc065
Merge #3789
3789: Update node deps r=kjeremy a=kjeremy

Silences warnings on install

Co-authored-by: kjeremy <kjeremy@gmail.com>
2020-03-31 13:57:59 +00:00
veetaha
4fbca1c64d vscode: use ctx.subscriptions instead of local .disposables 2020-03-31 16:57:03 +03:00
Aleksey Kladov
f5b01d6544 WIP: uniformalize external tools config 2020-03-31 15:55:05 +02:00
kjeremy
b3b8d31c5e Update node deps 2020-03-31 09:47:53 -04:00
veetaha
09a760e52e vscode: add syntax tree inspection hovers and highlights 2020-03-31 16:20:59 +03:00
bors[bot]
35675defe7
Merge #3788
3788: Update deps r=kjeremy a=kjeremy



Co-authored-by: kjeremy <kjeremy@gmail.com>
2020-03-31 13:11:50 +00:00
kjeremy
a1c5905d8d Update deps 2020-03-31 09:09:16 -04:00
bors[bot]
30466e068b
Merge #3778
3778: Use more functional programming in ArenaMap::insert r=matklad a=kjeremy

I find this more readable and it flattens out the body a little. Others may disagree.

Co-authored-by: kjeremy <kjeremy@gmail.com>
2020-03-31 13:04:54 +00:00
kjeremy
7ca5ef67e8 Use resize_with 2020-03-31 09:02:12 -04:00
bors[bot]
2cdeb7363a
Merge #3786
3786: When adding match arm, don't let the floating comma r=matklad a=matklad



bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2020-03-31 12:53:51 +00:00
Aleksey Kladov
2fe6e23138 When adding match arm, don't let the floating comma 2020-03-31 14:52:20 +02:00
bors[bot]
d63bb8565e
Merge #3781
3781: Add crate versions when running cargo -p commands. r=matklad a=o0Ignition0o

If someone (unfortunately) creates a project that happens to have the same name as one of its (future) dependencies, there is [a way for them to change the dependency's alias in the Cargo.toml file](https://doc.rust-lang.org/cargo/reference/specifying-dependencies.html#renaming-dependencies-in-cargotoml), to mitigate the name conflict. Unfortunately cargo -p commands don't seem to pick it up, which seems to put rust-analyzer run commands in a tough situation: 

```
> Executing task: cargo test --package config --example default -- tests --nocapture <

error: There are multiple `config` packages in your project, and the specification `config` is ambiguous.
Please re-run this command with `-p <spec>` where `<spec>` is one of the following:
  config:0.1.0
  config:0.9.3
The terminal process terminated with exit code: 101
```

cargo suggests us to be more specific and refer to a package by its name and version, which this PR achieves.

I passed the version as a String because I don't really understand how the ra_db types work, but I would love to switch it to [a fully fledged Version type](https://steveklabnik.github.io/semver/semver/index.html) if you guide me towards that :)



Co-authored-by: o0Ignition0o <jeremy.lempereur@gmail.com>
2020-03-31 12:45:39 +00:00
o0Ignition0o
331d1db317 Add crate versions when running cargo -p commands.
Until now cargo commands with the -p flag would pass the package name only.
It doesn't play super well with the toml Renaming dependencies feature.
This commit specifies the package name and version when a cargo command is run with the -p flag,
to avoid ambiguities.
2020-03-31 14:43:39 +02:00
bors[bot]
a932ccd53d
Merge #3785
3785: Attach doc-comment to declaration if there are newlines in between r=matklad a=ltentrup

This commit changes the parser to attach doc-comments to the corresponding declaration in case there are newlines in between the doc-comment and the declaration.

Implements the changes proposed in #3757 

Co-authored-by: Leander Tentrup <tentrup@react.uni-saarland.de>
2020-03-31 12:36:51 +00:00
Leander Tentrup
77f89a700b Attach doc-comment to declaration if there are newlines in between
This commit changes the parser to attach doc-comments to the corresponding declaration in case there are newlines in between the doc-comment and the declaration.
2020-03-31 14:27:23 +02:00
bors[bot]
668980d865
Merge #3777 #3784
3777: Add basic task support r=matklad a=Timmmm

This adds basic support for running `cargo build`, `cargo run`, etc.

Fixes #1935

I have tested this and it seems to work. There are two things I'm not sure about:

1. The workspace folder handling seems wrong - just get the first workspace folder? Is this just a TODO item? I don't know if it is right to lift `workspaceFolder` up to `activate()` but I couldn't see another way.
2. If you manually add an entry to `tasks.json` like this:

```
    {
      "type": "cargo",
      "command": "build",
      "problemMatcher": [
        "$rustc"
      ],
      "group": "build"
    }
```

then VSCode somehow magically knows to run `cargo build`. The documentation for `resolveTask` *sounds* like I should have to implement that for it to work:

```
 * Resolves a task that has no [`execution`](#Task.execution) set. Tasks are
 * often created from information found in the `tasks.json`-file. Such tasks miss
 * the information on how to execute them and a task provider must fill in
 * the missing information in the `resolveTask`-method.
```

But then it also says this:

```
* This method will not be
 * called for tasks returned from the above `provideTasks` method since those
 * tasks are always fully resolved. A valid default implementation for the
 * `resolveTask` method is to return `undefined`.
```

Either way, it works without implementing it so the only thing I can think is that it is doing some kind of crazy pattern matching of the tasks returned by `provideTasks()` and the ones found in `tasks.json`.

3784: Ignore createProgress request in tests r=matklad a=matklad

closes #3783



bors r+
🤖

Co-authored-by: Tim <tdhutt@gmail.com>
Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2020-03-31 10:41:56 +00:00