diff options
| author | bors <bors@rust-lang.org> | 2024-06-11 16:13:10 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2024-06-11 16:13:10 +0000 |
| commit | a97aef8466688d0d14fea1c311fa8db24173b5e1 (patch) | |
| tree | c77f57d9e5b444fd900fd97a6bcbadf10b945560 /src/tools/rust-analyzer/docs/dev | |
| parent | 5e1ab70dffc12895e984a3a1f87e6794d14c31f0 (diff) | |
| parent | 1e9e86c655884e87e136c867818269b7d7a0dffa (diff) | |
| download | rust-a97aef8466688d0d14fea1c311fa8db24173b5e1.tar.gz rust-a97aef8466688d0d14fea1c311fa8db24173b5e1.zip | |
Auto merge of #16840 - Wilfred:shell_runnable, r=Veykril
Allow rust-project.json to include arbitrary shell commands for runnables
This is a follow-up on #16135, resolving the feedback raised :)
Allow rust-project.json to include shell runnables, of the form:
```
{
"build_info": {
"label": "//project/foo:my-crate",
"target_kind": "bin",
"shell_runnables": [
{
"kind": "run",
"program": "buck2",
"args": ["run", "//project/foo:my-crate"]
},
{
"kind": "test_one",
"program": "test_runner",
"args": ["--name=$$TEST_NAME$$"]
}
]
}
}
```
If these runnable configs are present for the current crate in rust-project.json, offer them as runnables in VS Code.
This PR required some boring changes to APIs that previously only handled cargo situations. I've split out these changes as commits labelled 'refactor', so it's easy to see the interesting changes.
Diffstat (limited to 'src/tools/rust-analyzer/docs/dev')
| -rw-r--r-- | src/tools/rust-analyzer/docs/dev/lsp-extensions.md | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/src/tools/rust-analyzer/docs/dev/lsp-extensions.md b/src/tools/rust-analyzer/docs/dev/lsp-extensions.md index 100662f4ceb..695fec7e8e0 100644 --- a/src/tools/rust-analyzer/docs/dev/lsp-extensions.md +++ b/src/tools/rust-analyzer/docs/dev/lsp-extensions.md @@ -1,5 +1,5 @@ <!--- -lsp/ext.rs hash: a85ec97f07c6a2e3 +lsp/ext.rs hash: 8e6e340f2899b5e9 If you need to change the above hash to make the test pass, please check if you need to adjust this doc as well and ping this issue: @@ -372,7 +372,7 @@ interface Runnable { } ``` -rust-analyzer supports only one `kind`, `"cargo"`. The `args` for `"cargo"` look like this: +rust-analyzer supports two `kind`s of runnables, `"cargo"` and `"shell"`. The `args` for `"cargo"` look like this: ```typescript { @@ -386,6 +386,17 @@ rust-analyzer supports only one `kind`, `"cargo"`. The `args` for `"cargo"` look } ``` +The args for `"shell"` look like this: + +```typescript +{ + kind: string; + program: string; + args: string[]; + cwd: string; +} +``` + ## Test explorer **Experimental Client Capability:** `{ "testExplorer": boolean }` |
