diff --git a/LSP-rust-analyzer.sublime-settings b/LSP-rust-analyzer.sublime-settings index 4f50e04..7332824 100644 --- a/LSP-rust-analyzer.sublime-settings +++ b/LSP-rust-analyzer.sublime-settings @@ -9,6 +9,8 @@ // Rust-Analyzer Server Settings + // Whether to show the test explorer. + "rust-analyzer.testExplorer": false, // Whether to insert #[must_use] when generating as_ methods for enum variants. "rust-analyzer.assist.emitMustUse": false, // Placeholder expression to use for missing expressions in assists. @@ -18,6 +20,8 @@ "rust-analyzer.cachePriming.enable": true, // How many worker threads to handle priming caches. The default `0` means to pick automatically. "rust-analyzer.cachePriming.numThreads": 0, + // Pass `--all-targets` to cargo invocation. + "rust-analyzer.cargo.allTargets": true, // Automatically refresh project info via `cargo metadata` on // `Cargo.toml` or `.cargo/config.toml` changes. "rust-analyzer.cargo.autoreload": true, @@ -52,7 +56,10 @@ // avoid checking unnecessary things. "rust-analyzer.cargo.buildScripts.useRustcWrapper": true, // List of cfg options to enable with the given values. - "rust-analyzer.cargo.cfgs": {}, + "rust-analyzer.cargo.cfgs": { + "debug_assertions": null, + "miri": null + }, // Extra arguments that are passed to every cargo invocation. // // ```json @@ -84,15 +91,18 @@ "rust-analyzer.cargo.sysrootSrc": null, // Compilation target override (target triple). "rust-analyzer.cargo.target": null, - // Unsets the implicit `#[cfg(test)]` for the specified crates. - "rust-analyzer.cargo.unsetTest": [ - "core" - ], // Custom cargo runner extension ID. "rust-analyzer.cargoRunner": null, + // Optional path to a rust-analyzer specific target directory. + // This prevents rust-analyzer's `cargo check` and initial build-script and proc-macro + // building from locking the `Cargo.lock` at the expense of duplicating build artifacts. + // Set to `true` to use a subdirectory of the existing target directory or + // set to a path relative to the workspace to use that path. + "rust-analyzer.cargo.targetDir": null, // Run the check command for diagnostics on save. "rust-analyzer.checkOnSave": true, // Check all targets and tests (`--all-targets`). + // Defaults to `#rust-analyzer.cargo.allTargets#` "rust-analyzer.check.allTargets": true, // Cargo command to use for `cargo check`. "rust-analyzer.check.command": "check", @@ -235,6 +245,8 @@ // Whether to show diagnostics using the original rustc error code. If this is false, all rustc diagnostics // will have the code 'rustc(Click for full compiler diagnostics)' "rust-analyzer.diagnostics.useRustcErrorCode": false, + // Whether to run additional style lints. + "rust-analyzer.diagnostics.styleLints.enable": false, // List of warnings that should be displayed with hint severity. // The warnings will be indicated by faded text or three dots in code // and will not show up in the `Problems Panel`. @@ -289,6 +301,12 @@ "rust-analyzer.hover.memoryLayout.offset": "hexadecimal", // How to render the size information in a memory layout hover. "rust-analyzer.hover.memoryLayout.size": "both", + // How many variants of an enum to display when hovering on. Show none if empty. + "rust-analyzer.hover.show.enumVariants": 5, + // How many fields of a struct, variant or union to display when hovering on. Show none if empty. + "rust-analyzer.hover.show.fields": 5, + // How many associated items of a trait to display when hovering a trait. + "rust-analyzer.hover.show.traitAssocItems": null, // Whether to enforce the import granularity setting for all files. If set to false rust-analyzer will try to keep import // styles consistent per file. "rust-analyzer.imports.granularity.enforce": false, @@ -391,7 +409,8 @@ // Disable project auto-discovery in favor of explicitly specified set // of projects. // Elements must be paths pointing to `Cargo.toml`, - // `rust-project.json`, or JSON objects in `rust-project.json` format. + // `rust-project.json`, `.rs` files (which will be treated as standalone files) or JSON + // objects in `rust-project.json` format. "rust-analyzer.linkedProjects": [], // Number of syntax trees rust-analyzer keeps in memory. Defaults to 128. "rust-analyzer.lru.capacity": null, @@ -425,13 +444,15 @@ "rust-analyzer.runnables.extraArgs": [], // Environment variables passed to the runnable launched using `Test` or `Debug` lens or `rust-analyzer.run` command. "rust-analyzer.runnables.extraEnv": null, - // Optional path to a rust-analyzer specific target directory. - // This prevents rust-analyzer's `cargo check` from locking the `Cargo.lock` - // at the expense of duplicating build artifacts. - // - // Set to `true` to use a subdirectory of the existing target directory or - // set to a path relative to the workspace to use that path. - "rust-analyzer.rust.analyzerTargetDir": null, + // Additional arguments to be passed through Cargo to launched tests, benchmarks, or + // doc-tests. + // Unless the launched target uses a + // [custom test harness](https://doc.rust-lang.org/cargo/reference/cargo-targets.html#the-harness-field), + // they will end up being interpreted as options to + // [`rustc`’s built-in test harness (“libtest”)](https://doc.rust-lang.org/rustc/tests/index.html#cli-arguments). + "rust-analyzer.runnables.extraTestBinaryArgs": [ + "--show-output" + ], // Path to the Cargo.toml of the rust compiler workspace, for usage in rustc_private // projects, or "discover" to try to automatically find it if the `rustc-dev` component // is installed. @@ -504,4 +525,4 @@ "command": [ "${storage_path}/LSP-rust-analyzer/rust-analyzer" ], -} +} \ No newline at end of file diff --git a/plugin.py b/plugin.py index 962308c..9ebb364 100644 --- a/plugin.py +++ b/plugin.py @@ -29,7 +29,7 @@ SESSION_NAME = "rust-analyzer" -TAG = "2024-02-26" +TAG = "2024-04-29" """ Update this single git tag to download a newer version. After changing this tag, go through the server settings again to see diff --git a/sublime-package.json b/sublime-package.json index e5f747d..07681f0 100644 --- a/sublime-package.json +++ b/sublime-package.json @@ -31,6 +31,11 @@ "description": "Whether or not to spawn a panel at the bottom, or a new tab.", "type": "boolean" }, + "rust-analyzer.testExplorer": { + "markdownDescription": "Whether to show the test explorer.", + "default": false, + "type": "boolean" + }, "rust-analyzer.assist.emitMustUse": { "default": false, "description": "Whether to insert #[must_use] when generating as_ methods for enum variants.", @@ -61,6 +66,11 @@ "minimum": 0, "type": "number" }, + "rust-analyzer.cargo.allTargets": { + "markdownDescription": "Pass `--all-targets` to cargo invocation.", + "default": true, + "type": "boolean" + }, "rust-analyzer.cargo.autoreload": { "default": true, "markdownDescription": "Automatically refresh project info via `cargo metadata` on\n`Cargo.toml` or `.cargo/config.toml` changes.", @@ -120,7 +130,10 @@ }, "rust-analyzer.cargo.cfgs": { "markdownDescription": "List of cfg options to enable with the given values.", - "default": {}, + "default": { + "debug_assertions": null, + "miri": null + }, "type": "object" }, "rust-analyzer.cargo.extraArgs": { @@ -191,16 +204,6 @@ "string" ] }, - "rust-analyzer.cargo.unsetTest": { - "default": [ - "core" - ], - "items": { - "type": "string" - }, - "markdownDescription": "Unsets the implicit `#[cfg(test)]` for the specified crates.", - "type": "array" - }, "rust-analyzer.cargoRunner": { "default": null, "description": "Custom cargo runner extension ID.", @@ -209,15 +212,33 @@ "string" ] }, + "rust-analyzer.cargo.targetDir": { + "markdownDescription": "Optional path to a rust-analyzer specific target directory.\nThis prevents rust-analyzer's `cargo check` and initial build-script and proc-macro\nbuilding from locking the `Cargo.lock` at the expense of duplicating build artifacts.\n\nSet to `true` to use a subdirectory of the existing target directory or\nset to a path relative to the workspace to use that path.", + "default": null, + "anyOf": [ + { + "type": "null" + }, + { + "type": "boolean" + }, + { + "type": "string" + } + ] + }, "rust-analyzer.checkOnSave": { "markdownDescription": "Run the check command for diagnostics on save.", "default": true, "type": "boolean" }, "rust-analyzer.check.allTargets": { - "default": true, - "markdownDescription": "Check all targets and tests (`--all-targets`).", - "type": "boolean" + "markdownDescription": "Check all targets and tests (`--all-targets`). Defaults to\n`#rust-analyzer.cargo.allTargets#`.", + "default": null, + "type": [ + "null", + "boolean" + ] }, "rust-analyzer.check.command": { "default": "check", @@ -501,6 +522,11 @@ "markdownDescription": "List of warnings that should be displayed with hint severity.\n\nThe warnings will be indicated by faded text or three dots in code\nand will not show up in the `Problems Panel`.", "type": "array" }, + "rust-analyzer.diagnostics.styleLints.enable": { + "markdownDescription": "Whether to run additional style lints.", + "default": false, + "type": "boolean" + }, "rust-analyzer.diagnostics.warningsAsInfo": { "default": [], "items": { @@ -697,6 +723,33 @@ } ] }, + "rust-analyzer.hover.show.enumVariants": { + "markdownDescription": "How many variants of an enum to display when hovering on. Show none if empty.", + "default": 5, + "type": [ + "null", + "integer" + ], + "minimum": 0 + }, + "rust-analyzer.hover.show.fields": { + "markdownDescription": "How many fields of a struct, variant or union to display when hovering on. Show none if empty.", + "default": 5, + "type": [ + "null", + "integer" + ], + "minimum": 0 + }, + "rust-analyzer.hover.show.traitAssocItems": { + "markdownDescription": "How many associated items of a trait to display when hovering a trait.", + "default": null, + "type": [ + "null", + "integer" + ], + "minimum": 0 + }, "rust-analyzer.imports.granularity.enforce": { "default": false, "markdownDescription": "Whether to enforce the import granularity setting for all files. If set to false rust-analyzer will try to keep import styles consistent per file.", @@ -1035,7 +1088,7 @@ "object" ] }, - "markdownDescription": "Disable project auto-discovery in favor of explicitly specified set\nof projects.\n\nElements must be paths pointing to `Cargo.toml`,\n`rust-project.json`, or JSON objects in `rust-project.json` format.", + "markdownDescription": "Disable project auto-discovery in favor of explicitly specified set\nof projects.\n\nElements must be paths pointing to `Cargo.toml`,\n`rust-project.json`, `.rs` files (which will be treated as standalone files) or JSON\nobjects in `rust-project.json` format.", "type": "array" }, "rust-analyzer.lru.capacity": { @@ -1186,20 +1239,15 @@ "markdownDescription": "Additional arguments to be passed to cargo for runnables such as\ntests or binaries. For example, it may be `--release`.", "type": "array" }, - "rust-analyzer.rust.analyzerTargetDir": { - "markdownDescription": "Optional path to a rust-analyzer specific target directory.\nThis prevents rust-analyzer's `cargo check` from locking the `Cargo.lock`\nat the expense of duplicating build artifacts.\n\nSet to `true` to use a subdirectory of the existing target directory or\nset to a path relative to the workspace to use that path.", - "default": null, - "anyOf": [ - { - "type": "null" - }, - { - "type": "boolean" - }, - { - "type": "string" - } - ] + "rust-analyzer.runnables.extraTestBinaryArgs": { + "markdownDescription": "Additional arguments to be passed through Cargo to launched tests, benchmarks, or\ndoc-tests.\n\nUnless the launched target uses a\n[custom test harness](https://doc.rust-lang.org/cargo/reference/cargo-targets.html#the-harness-field),\nthey will end up being interpreted as options to\n[`rustc`’s built-in test harness (“libtest”)](https://doc.rust-lang.org/rustc/tests/index.html#cli-arguments).", + "default": [ + "--show-output" + ], + "type": "array", + "items": { + "type": "string" + } }, "rust-analyzer.rustc.source": { "default": null, @@ -1404,4 +1452,4 @@ } ] } -} +} \ No newline at end of file