rust/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
.gitignore
.vscodeignore vscode client side tests 2020-05-20 22:31:39 +03:00
icon.png
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
README.md
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.