diff options
| author | Laurențiu Nicola <lnicola@dend.ro> | 2024-03-10 08:47:38 +0200 |
|---|---|---|
| committer | Laurențiu Nicola <lnicola@dend.ro> | 2024-03-10 08:47:38 +0200 |
| commit | 56493e4cbd6262adae03e73aefb8a9e618a9fc2d (patch) | |
| tree | 404d4a38aff53e1c880c2708478fdcaf0b2f6e61 /src/tools/rust-analyzer/docs | |
| parent | 5bc7b9ac8ace5312e1d2cdc2722715cf58d4f926 (diff) | |
| parent | 574e23ec508064613783cba3d1833a95fd9a5080 (diff) | |
| download | rust-56493e4cbd6262adae03e73aefb8a9e618a9fc2d.tar.gz rust-56493e4cbd6262adae03e73aefb8a9e618a9fc2d.zip | |
Merge commit '574e23ec508064613783cba3d1833a95fd9a5080' into sync-from-ra
Diffstat (limited to 'src/tools/rust-analyzer/docs')
| -rw-r--r-- | src/tools/rust-analyzer/docs/dev/lsp-extensions.md | 126 | ||||
| -rw-r--r-- | src/tools/rust-analyzer/docs/user/generated_config.adoc | 10 |
2 files changed, 135 insertions, 1 deletions
diff --git a/src/tools/rust-analyzer/docs/dev/lsp-extensions.md b/src/tools/rust-analyzer/docs/dev/lsp-extensions.md index f3100ee194e..af5b4e51ef3 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: 8be79cc3b7f10ad7 +lsp/ext.rs hash: 6bc140531b403717 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: @@ -385,6 +385,130 @@ rust-analyzer supports only one `kind`, `"cargo"`. The `args` for `"cargo"` look } ``` +## Test explorer + +**Experimental Client Capability:** `{ "testExplorer": boolean }` + +If this capability is set, the `experimental/discoveredTests` notification will be sent from the +server to the client. + +**Method:** `experimental/discoverTest` + +**Request:** `DiscoverTestParams` + +```typescript +interface DiscoverTestParams { + // The test that we need to resolve its children. If not present, + // the response should return top level tests. + testId?: string | undefined; +} +``` + +**Response:** `DiscoverTestResults` + +```typescript +interface TestItem { + // A unique identifier for the test + id: string; + // The file containing this test + textDocument?: lc.TextDocumentIdentifier | undefined; + // The range in the file containing this test + range?: lc.Range | undefined; + // A human readable name for this test + label: string; + // The kind of this test item. Based on the kind, + // an icon is chosen by the editor. + kind: "package" | "module" | "test"; + // True if this test may have children not available eagerly + canResolveChildren: boolean; + // The id of the parent test in the test tree. If not present, this test + // is a top level test. + parent?: string | undefined; + // The information useful for running the test. The client can use `runTest` + // request for simple execution, but for more complex execution forms + // like debugging, this field is useful. + // Note that this field includes some information about label and location as well, but + // those exist just for keeping things in sync with other methods of running runnables + // (for example using one consistent name in the vscode's launch.json) so for any propose + // other than running tests this field should not be used. + runnable?: Runnable | undefined; +}; + +interface DiscoverTestResults { + // The discovered tests. + tests: TestItem[]; + // For each test which its id is in this list, the response + // contains all tests that are children of this test, and + // client should remove old tests not included in the response. + scope: string[]; +} +``` + +**Method:** `experimental/discoveredTests` + +**Notification:** `DiscoverTestResults` + +This notification is sent from the server to the client when the +server detect changes in the existing tests. The `DiscoverTestResults` is +the same as the one in `experimental/discoverTest` response. + +**Method:** `experimental/runTest` + +**Request:** `RunTestParams` + +```typescript +interface RunTestParams { + // Id of the tests to be run. If a test is included, all of its children are included implicitly. If + // this property is undefined, then the server should simply run all tests. + include?: string[] | undefined; + // An array of test ids the user has marked as excluded from the test included in this run; exclusions + // should apply after inclusions. + // May be omitted if no exclusions were requested. Server should not run excluded tests or + // any children of excluded tests. + exclude?: string[] | undefined; +} +``` + +**Response:** `void` + +**Method:** `experimental/endRunTest` + +**Notification:** + +This notification is sent from the server to the client when the current running +session is finished. The server should not send any run notification +after this. + +**Method:** `experimental/abortRunTest` + +**Notification:** + +This notification is sent from the client to the server when the user is no longer +interested in the test results. The server should clean up its resources and send +a `experimental/endRunTest` when is done. + +**Method:** `experimental/changeTestState` + +**Notification:** `ChangeTestStateParams` + +```typescript +type TestState = { tag: "passed" } + | { + tag: "failed"; + // The standard error of the test, containing the panic message. Clients should + // render it similar to a terminal, and e.g. handle ansi colors. + message: string; + } + | { tag: "started" } + | { tag: "enqueued" } + | { tag: "skipped" }; + +interface ChangeTestStateParams { + testId: string; + state: TestState; +} +``` + ## Open External Documentation This request is sent from the client to the server to obtain web and local URL(s) for documentation related to the symbol under the cursor, if available. diff --git a/src/tools/rust-analyzer/docs/user/generated_config.adoc b/src/tools/rust-analyzer/docs/user/generated_config.adoc index d4ba5af9231..5e782b78311 100644 --- a/src/tools/rust-analyzer/docs/user/generated_config.adoc +++ b/src/tools/rust-analyzer/docs/user/generated_config.adoc @@ -386,6 +386,11 @@ have more false positives than usual. Map of prefixes to be substituted when parsing diagnostic file paths. This should be the reverse mapping of what is passed to `rustc` as `--remap-path-prefix`. -- +[[rust-analyzer.diagnostics.styleLints.enable]]rust-analyzer.diagnostics.styleLints.enable (default: `false`):: ++ +-- +Whether to run additional style lints. +-- [[rust-analyzer.diagnostics.warningsAsHint]]rust-analyzer.diagnostics.warningsAsHint (default: `[]`):: + -- @@ -515,6 +520,11 @@ How to render the offset information in a memory layout hover. -- How to render the size information in a memory layout hover. -- +[[rust-analyzer.hover.show.traitAssocItems]]rust-analyzer.hover.show.traitAssocItems (default: `null`):: ++ +-- +How many associated items of a trait to display when hovering a trait. +-- [[rust-analyzer.imports.granularity.enforce]]rust-analyzer.imports.granularity.enforce (default: `false`):: + -- |
