Commit graph

11303 commits

Author SHA1 Message Date
Aleksey Kladov
b6ac5952cf ⬆️ salsa 2020-07-03 16:41:58 +02:00
bors[bot]
88a602f305
Merge #5205
5205: Refactor attribut completion tests r=matklad a=matklad



bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2020-07-03 14:06:13 +00:00
Aleksey Kladov
314efae29d Refactor attribut completion tests 2020-07-03 15:59:37 +02:00
Aleksey Kladov
f1671f460b Compress attribute completion tests 2020-07-03 15:38:53 +02:00
bors[bot]
8489145583
Merge #5202
5202: Runnable env r=matklad a=vsrs

This PR adds on option to specify (in the settings.json) environment variables passed to the runnable.
The simplest way for all runnables in a bunch:
```jsonc
    "rust-analyzer.runnableEnv": {
        "RUN_SLOW_TESTS": "1"
    }
```

Or it is possible to specify vars more granularly:
```jsonc
    "rust-analyzer.runnableEnv": [
        {
            // "mask": null, // null mask means that this rule will be applied for all runnables
            env: {
                 "APP_ID": "1",
                 "APP_DATA": "asdf"
            }
        },
        {
            "mask": "test_name",
            "env": {
                 "APP_ID": "2", // overwrites only APP_ID
            }
        }
    ]
```

You can use any valid RegExp as a mask. Also note that a full runnable name is something like *run bin_or_example_name*, *test some::mod::test_name* or *test-mod some::mod*, so it is possible to distinguish binaries, single tests, and test modules with this masks: `"^run"`, `"^test "` (the trailing space matters!), and `"^test-mod"` respectively.

Fixes #4450

I suppose this info should be somewhere in the docs, but unsure where is the best place.

Co-authored-by: vsrs <vit@conrlab.com>
2020-07-03 13:17:36 +00:00
Paul Daniel Faria
bc11d46230 Fix typo in description of vscode setting 2020-07-03 09:12:20 -04:00
vsrs
188d24024c
Fix tag level 2020-07-03 16:07:28 +03:00
vsrs
8b2a44dc3f
remove --- 2020-07-03 16:03:01 +03:00
vsrs
fd94a10be1
Add docs 2020-07-03 16:01:13 +03:00
bors[bot]
f51b0cfdd6
Merge #5116
5116: Categorize assists r=matklad a=kjeremy

Categorize assists so that editors can use them. Follows the LSP spec pretty close (and some things may need adjustments) but this populates the Refactor menu in vscode and pushes quickfixes through again.

This is a prerequisite to filtering out assists that the client doesn't care about.

Fixes #4147

Co-authored-by: Jeremy Kolb <kjeremy@gmail.com>
Co-authored-by: kjeremy <kjeremy@gmail.com>
2020-07-03 12:44:09 +00:00
vsrs
bebbfa1a29 Fix workspaceRoot 2020-07-03 14:56:30 +03:00
bors[bot]
ef6a6d75d5
Merge #5201
5201: Add function to test completion edit r=matklad a=matklad



bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2020-07-03 11:24:28 +00:00
vsrs
611fad275f code linting 2020-07-03 14:23:51 +03:00
vsrs
271abb7bc4 Add tests 2020-07-03 14:23:51 +03:00
vsrs
7b79d24ad5 Add runnable env support. 2020-07-03 14:23:51 +03:00
Aleksey Kladov
503de8e229 Add function to test completion edit 2020-07-03 13:21:48 +02:00
bors[bot]
57576ac420
Merge #5200
5200: Refactor keyword completion tests r=matklad a=matklad



bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2020-07-03 10:57:36 +00:00
Aleksey Kladov
e2b04621f9 Refactor keyword completion tests 2020-07-03 12:51:18 +02:00
bors[bot]
81bb3d9c1a
Merge #5199
5199: Cleanup record completion tests r=matklad a=matklad



bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2020-07-03 09:49:12 +00:00
Aleksey Kladov
0e23175a07 Cleanup record completion tests 2020-07-03 11:48:48 +02:00
kjeremy
4c9347ecc3 Don't categorize things we don't care about 2020-07-02 18:01:22 -04:00
kjeremy
36cc81ac71 Move AssistKind into AssistId 2020-07-02 17:48:35 -04:00
kjeremy
1d58e16824 Recategorize a few 2020-07-02 17:14:15 -04:00
Jeremy Kolb
5b9257561f Pass CodeActionKind through our middleware to populate menus 2020-07-02 17:13:03 -04:00
Jeremy Kolb
b98c16a034 Categorize assists 2020-07-02 17:13:02 -04:00
bors[bot]
4cb8bf03c5
Merge #5192
5192: Implement rust-analyzer feature configuration to tests. r=matklad a=daxpedda

Fixes #3198.

I'm unsure if it is desired this way, maybe we want to make a seperate configuration?

Co-authored-by: daxpedda <daxpedda@gmail.com>
2020-07-02 15:48:54 +00:00
bors[bot]
c80b6876d5
Merge #5193
5193: Move cargo metadata off the main loop r=matklad a=matklad



bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2020-07-02 15:40:30 +00:00
Aleksey Kladov
6c7578bd7a Move cargo metadata off the main loop 2020-07-02 17:39:51 +02:00
daxpedda
eb75a644a1
Implement rust-analyzer feature configuration to tests. 2020-07-02 16:13:24 +02:00
bors[bot]
83f3cdca4f
Merge #5191
5191: Minor r=matklad a=matklad



bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2020-07-02 14:10:13 +00:00
Aleksey Kladov
6a694ad047 Minor 2020-07-02 16:06:00 +02:00
bors[bot]
1a3a7f4237
Merge #5188
5188: Implement StatusBar r=matklad a=matklad



Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2020-07-02 14:02:52 +00:00
bors[bot]
e75b4fc85e
Merge #5189
5189: Record and suggest assoc. items of traits via ImportMap r=matklad a=jonas-schievink

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

Co-authored-by: Jonas Schievink <jonas.schievink@ferrous-systems.com>
2020-07-02 13:55:14 +00:00
Jonas Schievink
6ee73cd334 Use SmolStr 2020-07-02 15:42:37 +02:00
Aleksey Kladov
4f26a3734e Indicate when project needs a reload 2020-07-02 15:34:12 +02:00
Aleksey Kladov
3ef7676076 Implement StatusBar 2020-07-02 15:32:14 +02:00
Jonas Schievink
361b399b6d Fix tests 2020-07-02 13:34:08 +02:00
Jonas Schievink
31f5b48817 Record and suggest trait items via ImportMap 2020-07-02 12:43:52 +02:00
bors[bot]
57ed622ec4
Merge #5089 #5161 #5184 #5185 #5186
5089: Disable auto-complete on comments r=matklad a=BGluth

Resolves #4907 by disabling any auto-completion on comments.

As flodiebold [pointed out](https://github.com/rust-analyzer/rust-analyzer/issues/4907#issuecomment-648439979), in the future we may want to support some form of auto-completion within doc comments, but for now it was suggested to just disable auto-completion on them entirely.

The implementation involves adding a new field `is_comment` to `CompletionContext` and checking if the immediate token we auto-completed on is a comment. I couldn't see a case where we need to check any of the ancestors, but let me know if this is not sufficient. I also wasn't sure if it was necessary to add a new field to this struct, but I decided it's probably the best option if we want to potentially do auto-completion on doc comments in the future.

Finally, the three tests I added should I think ideally not filter results by `CompletionKind::Keyword`, but if I want to get unfiltered results, I need access to a non-public function [get_all_completion_items](9a4d02faf9/crates/ra_ide/src/completion/test_utils.rs (L32-L39)) which I don't know if I should make public just for this.



5161: SSR: Add initial support for placeholder constraints r=matklad a=davidlattimore



5184: Always install required nightly extension if current one is not nightly r=matklad a=Veetaha

This is weird, but having switched back to stable by uninstalling the extension appears that vscode doesn't destroy the `PersistentState` and thus changing to `nightly` channel doesn't work because the last check for nightly extension was less than 1 hour ago. The simple solution is to skip this check if we know that the current extension version is not nightly.

5185: Force showing extension activation error pop-up notification r=matklad a=Veetaha

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

5186: fix: correct pd/ppd/tfn/tmod completion doc r=matklad a=fannheyward

a33eefa3b2/crates/ra_ide/src/completion/complete_snippet.rs (L23-L24)

Co-authored-by: BGluth <gluthb@gmail.com>
Co-authored-by: David Lattimore <dml@google.com>
Co-authored-by: Veetaha <veetaha2@gmail.com>
Co-authored-by: Heyward Fann <fannheyward@gmail.com>
2020-07-02 09:12:46 +00:00
bors[bot]
e5f8fb3e91
Merge #5180
5180: Disable optimizations for tracing-attributes r=matklad a=lnicola



Co-authored-by: Laurențiu Nicola <lnicola@dend.ro>
2020-07-02 09:05:34 +00:00
Aleksey Kladov
4310e0ebf9 Disable npm audit
At the moment it fails with unfixable minor vuln in a dev-dependency
2020-07-02 10:50:50 +02:00
Heyward Fann
f1986be8fd fix: correct pd/ppd/tfn/tmod completion doc
a33eefa3b2/crates/ra_ide/src/completion/complete_snippet.rs (L23)
2020-07-02 11:06:00 +08:00
Veetaha
6a6ce616aa Force showing extension activation error pop-up notification 2020-07-02 05:19:02 +03:00
Veetaha
69b6f6def5 Always install required nightly extension if current one is not nightly 2020-07-02 05:05:29 +03:00
David Lattimore
83588a1c45 SSR: Use T! instead of SyntaxKind::* where possible 2020-07-02 09:19:58 +10:00
BGluth
cc77bdf59a Auto-completion no longer occurs on comments 2020-07-01 15:20:07 -06:00
BGluth
0bbd6428ad Added tests for no auto-completion on comments 2020-07-01 15:16:47 -06:00
bors[bot]
a33eefa3b2
Merge #5149
5149: Implement Chalk variable kinds r=flodiebold a=flodiebold

This means we need to keep track of the kinds (general/int/float) of variables in `Canonical`, which requires some more ceremony. (It also exposes some places where we're not really dealing with canonicalization correctly -- another thing to be cleaned up when we switch to using Chalk's types directly.)

Should fix the last remaining issue of #2534.

Co-authored-by: Florian Diebold <florian.diebold@freiheit.com>
2020-07-01 18:41:06 +00:00
Florian Diebold
d5d485ef92 Implement Chalk variable kinds
This means we need to keep track of the kinds (general/int/float) of variables
in `Canonical`, which requires some more ceremony. (It also exposes some places
where we're not really dealing with canonicalization correctly -- another thing
to be cleaned up when we switch to using Chalk's types directly.)

Should fix the last remaining issue of #2534.
2020-07-01 20:40:38 +02:00
Laurențiu Nicola
ddcd98f604 Disable optimizations for tracing-attributes 2020-07-01 20:51:09 +03:00