Commit graph

11233 commits

Author SHA1 Message Date
Aleksey Kladov
5c68dd6b59 Better tests for completion scoring 2020-07-04 09:53:54 +02:00
Aleksey Kladov
aaba2300fb Modernize completion presentation tests 2020-07-04 09:36:53 +02:00
Aleksey Kladov
65768feaff Unify naming 2020-07-04 09:08:51 +02:00
Aleksey Kladov
6518f18f80 Cleanup tests 2020-07-04 09:07:18 +02:00
bors[bot]
212fa29a69
Merge #5197
5197: SSR internal refactorings r=davidlattimore a=davidlattimore

- Extract error code out to a separate module
- Improve error reporting when a test fails
- Refactor matching code
- Update tests so that all paths in search patterns can be resolved

Co-authored-by: David Lattimore <dml@google.com>
2020-07-04 00:13:11 +00:00
David Lattimore
a354e5b5cf SSR: Update tests so that all paths in patterns can be resolved 2020-07-04 08:56:58 +10:00
David Lattimore
69051d2f9d SSR: Refactor matching code.
Mutable state is now stored in the enum Phase.
MatchState, since it now has no mutable state is renamed Matcher.
MatchInputs is merged into Matcher
2020-07-04 08:56:58 +10:00
David Lattimore
4a8679824b SSR: Improve error reporting when a test fails 2020-07-04 08:56:58 +10:00
David Lattimore
a5ef644a16 SSR: Extract error code out to a separate module
This is to make reusing it outside of parsing easier in a subsequent
change.
2020-07-04 08:56:51 +10:00
bors[bot]
fe16e1da69
Merge #5215
5215: Cleanup more completion tests r=matklad a=matklad

bors r+

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2020-07-03 22:02:09 +00:00
Aleksey Kladov
cda1a6c638 Cleanup more completion tests 2020-07-04 00:01:45 +02:00
bors[bot]
f6bff05f2a
Merge #5214
5214: Cleanup presentation tests r=matklad a=matklad



bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2020-07-03 21:16:38 +00:00
Aleksey Kladov
9f9b38bdb4 Cleanup presentation tests 2020-07-03 23:15:44 +02:00
bors[bot]
a095cdb879
Merge #5213
5213: Add AssistKind::Generate r=matklad a=matklad



bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2020-07-03 17:32:44 +00:00
Aleksey Kladov
d09f692300 Add AssistKind::Generate 2020-07-03 19:32:18 +02:00
Aleksey Kladov
66b6a433c6 Unify naming of generating assists 2020-07-03 19:32:18 +02:00
bors[bot]
a434ecef51
Merge #5212
5212: Fix module renaming r=matklad a=matklad



bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2020-07-03 16:55:01 +00:00
Aleksey Kladov
f4a3bc30b8 Fix module renaming 2020-07-03 18:47:26 +02:00
bors[bot]
82bfaef7df
Merge #5203
5203: Fix typo in description of vscode setting r=matklad a=Nashenas88



Co-authored-by: Paul Daniel Faria <nashenas88@users.noreply.github.com>
2020-07-03 16:44:30 +00:00
Aleksey Kladov
4c347a9f65 Compress rename tests 2020-07-03 18:39:36 +02:00
Aleksey Kladov
2656c415c8 Use expect for rename tests 2020-07-03 18:35:43 +02:00
Aleksey Kladov
ee7ab0104d Adhere to code style in rename tests 2020-07-03 18:29:37 +02:00
bors[bot]
7ad7f3ca8c
Merge #5211
5211: Fix inference of indexing argument (partly) r=flodiebold a=flodiebold

We need to add the `T: Index<Arg>` obligation to be resolved later as well, otherwise we can't make inferences about `Arg` later based on the `Index` impls.

This still doesn't fix indexing with integer variables though; there's a further problem with Chalk floundering because of the variable, I think.

Co-authored-by: Florian Diebold <florian.diebold@freiheit.com>
2020-07-03 16:18:34 +00:00
Florian Diebold
57feb323f7 Fix inference of indexing argument (partly)
We need to add the `T: Index<Arg>` obligation to be resolved later as well,
otherwise we can't make inferences about `Arg` later based on the `Index` impls.

This still doesn't fix indexing with integer variables though; there's a further
problem with Chalk floundering because of the variable, I think.
2020-07-03 18:17:06 +02:00
bors[bot]
0f68fed4a0
Merge #5209
5209: Fixes to memory usage stats r=matklad a=jonas-schievink

This brings the unaccounted memory down from 287mb to 250mb, and displays memory used by VFS and "other" allocations.

Co-authored-by: Jonas Schievink <jonas.schievink@ferrous-systems.com>
2020-07-03 15:58:46 +00:00
bors[bot]
dceec6176b
Merge #5210
5210: Fix workspace reloading r=matklad a=matklad



bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2020-07-03 15:19:34 +00:00
Aleksey Kladov
b8ef8539a6 Fix workspace reloading 2020-07-03 17:19:00 +02:00
Jonas Schievink
f01e7e3601 Track VFS and remaining/unaccounted memory 2020-07-03 17:16:01 +02:00
Jonas Schievink
93d0ac7fa0 Fix memory usage accounting for interned queries 2020-07-03 17:12:29 +02:00
bors[bot]
f5a4a4b46e
Merge #5207
5207: ⬆️ salsa r=matklad a=matklad



bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2020-07-03 14:42:33 +00:00
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