rust-analyzer/editors/code
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
..
src Merge #5202 2020-07-03 13:17:36 +00:00
tests code linting 2020-07-03 14:23:51 +03:00
.eslintrc.js vscode: remove type assertion 2020-02-24 21:23:56 +02:00
.gitignore add rollup bundler for vscode extension 2019-09-23 23:25:16 +02:00
.vscodeignore vscode client side tests 2020-05-20 22:31:39 +03:00
icon.png Extension icon 2020-01-15 16:07:39 +01:00
package-lock.json Be more strict with @types/node 2020-07-01 08:01:17 +03:00
package.json Add runnable env support. 2020-07-03 14:23:51 +03:00
ra_syntax_tree.tmGrammar.json Fix .rast tmGrammar to account for numbers in identifiers 2020-04-22 02:00:58 +03:00
README.md Minimal viable meta 2020-03-02 14:27:26 +01:00
rollup.config.js Bump @rollup/plugin-commonjs 2020-06-27 22:37:03 +03:00
rust.tmGrammar.json Fix a typo 2020-06-30 17:42:54 +02:00
tsconfig.json vscode client side tests 2020-05-20 22:31:39 +03:00

rust-analyzer

Provides support for rust-analyzer: novel LSP server for the Rust programming language.

See https://rust-analyzer.github.io/ for more information.