Commit graph

8902 commits

Author SHA1 Message Date
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
Aleksey Kladov
6b2f02fdfd Ignore createProgress request in tests
closes #3783
2020-03-31 12:02:47 +02:00
Tim
3eb45b9922 Pass string instread of WorkspaceFolder 2020-03-31 10:24:01 +01:00
Tim
9ef1e9efc6 Remove unnecessary null check 2020-03-31 09:11:22 +01:00
Tim
a781a58fe2 Throw error if no folder is opened 2020-03-31 09:06:52 +01:00
Tim
6e535915bd Use namespace import 2020-03-31 09:06:46 +01:00
kjeremy
f633f69e36 Do not call reserve since extend will handle it.
`Take` implements `TrustedLen` so we are guaranteed that only one
reserve call will be made.
2020-03-30 17:09:21 -04:00
Tim
768aa4259f Add basic task support
This adds basic support for running `cargo build`, `cargo run`, etc.
2020-03-30 21:23:21 +01:00
kjeremy
c39725212c Use more functional programming in ArenaMap::insert
I find this more readable and it flattens out the body a little.
2020-03-30 16:15:28 -04:00
bors[bot]
6f0d8db529
Merge #3775
3775: Fix typo r=matklad a=matklad



bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2020-03-30 16:51:56 +00:00
Aleksey Kladov
beab6f34ce Fix typo 2020-03-30 18:51:30 +02:00
bors[bot]
159393745e
Merge #3774
3774: Simplify SemanticTokensBuilder build method r=matklad a=kjeremy

This matches the next stable vscode api

Co-authored-by: kjeremy <kjeremy@gmail.com>
2020-03-30 16:38:53 +00:00