From 939305e24beffa6ce01a1965359ce57c9169817f Mon Sep 17 00:00:00 2001 From: Rafal Chlodnicki Date: Thu, 14 Dec 2023 23:58:32 +0100 Subject: [PATCH 1/4] update ra version to 2023-12-11 --- plugin.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugin.py b/plugin.py index 3c56b9b..f389fa4 100644 --- a/plugin.py +++ b/plugin.py @@ -29,7 +29,7 @@ SESSION_NAME = "rust-analyzer" -TAG = "2023-05-15" +TAG = "2023-12-11" """ Update this single git tag to download a newer version. After changing this tag, go through the server settings again to see From 6ea9de03f9c0737e6b47f0ae0cc792bb1beb10d7 Mon Sep 17 00:00:00 2001 From: Rafal Chlodnicki Date: Fri, 15 Dec 2023 09:53:04 +0100 Subject: [PATCH 2/4] update settings and schema --- LSP-rust-analyzer.sublime-settings | 155 ++++++++----- sublime-package.json | 342 +++++++++++++++++++++-------- 2 files changed, 349 insertions(+), 148 deletions(-) diff --git a/LSP-rust-analyzer.sublime-settings b/LSP-rust-analyzer.sublime-settings index 47d0195..25c7694 100644 --- a/LSP-rust-analyzer.sublime-settings +++ b/LSP-rust-analyzer.sublime-settings @@ -1,6 +1,5 @@ { "settings": { - // Settings Not Related to rust-analyzer Server // Whether or not to automatically close terminus panel/tab upon completion. @@ -49,15 +48,17 @@ // Use `RUSTC_WRAPPER=rust-analyzer` when running build scripts to // avoid checking unnecessary things. "rust-analyzer.cargo.buildScripts.useRustcWrapper": true, - // Extra environment variables that will be set when running cargo, - // rustc or other commands within the workspace. Useful for setting RUSTFLAGS. - "rust-analyzer.cargo.extraEnv": {}, + // List of cfg options to enable with the given values. + "rust-analyzer.cargo.cfgs": {}, // Extra arguments that are passed to every cargo invocation. // // ```json // "rust-analyzer.cargo.extraArgs": ["--all-features"], // ``` "rust-analyzer.cargo.extraArgs": [], + // Extra environment variables that will be set when running cargo, + // rustc or other commands within the workspace. Useful for setting RUSTFLAGS. + "rust-analyzer.cargo.extraEnv": {}, // List of features to activate. // Set this to `"all"` to pass `--all-features` to cargo. "rust-analyzer.cargo.features": [], @@ -75,9 +76,9 @@ "rust-analyzer.cargo.sysrootSrc": null, // Compilation target override (target triple). "rust-analyzer.cargo.target": null, - // Unsets `#[cfg(test)]` for the specified crates. + // Unsets the implicit `#[cfg(test)]` for the specified crates. "rust-analyzer.cargo.unsetTest": [ - "core" + "core" ], // Custom cargo runner extension ID. "rust-analyzer.cargoRunner": null, @@ -96,16 +97,19 @@ // `#rust-analyzer.cargo.features#`. // Set to `"all"` to pass `--all-features` to Cargo. "rust-analyzer.check.features": null, + // List of `cargo check` (or other command specified in `check.command`) diagnostics to ignore. + // For example for `cargo check`: `dead_code`, `unused_imports`, `unused_variables`,... + "rust-analyzer.check.ignore": [], // Specifies the working directory for running checks. // - "workspace": run checks for workspaces in the corresponding workspaces' root directories. - // This falls back to "root" if rust-analyzer.cargo.checkOnSave.invocationStrategy is set to once. - // - "root": run checks in the project’s root directory. - // This config only has an effect when rust-analyzer.cargo.buildScripts.overrideCommand is set. + // This falls back to "root" if `#rust-analyzer.cargo.check.invocationStrategy#` is set to `once`. + // - "root": run checks in the project's root directory. + //This config only has an effect when `#rust-analyzer.cargo.check.overrideCommand#` is set. "rust-analyzer.check.invocationLocation": "workspace", - // Specifies the invocation strategy to use when running the checkOnSave command. - // If per_workspace is set, the command will be executed for each workspace. - // If once is set, the command will be executed once. - // This config only has an effect when rust-analyzer.cargo.buildScripts.overrideCommand is set. + // Specifies the invocation strategy to use when running the check command. + // If `per_workspace` is set, the command will be executed for each workspace. + // If `once` is set, the command will be executed once. + // This config only has an effect when `#rust-analyzer.cargo.check.overrideCommand#` is set. "rust-analyzer.check.invocationStrategy": "per_workspace", // Whether to pass `--no-default-features` to Cargo. Defaults to // `#rust-analyzer.cargo.noDefaultFeatures#`. @@ -115,17 +119,22 @@ // should therefore include `--message-format=json` or a similar option // (if your client supports the `colorDiagnosticOutput` experimental // capability, you can use `--message-format=json-diagnostic-rendered-ansi`). + // // If you're changing this because you're using some tool wrapping // Cargo, you might also want to change // `#rust-analyzer.cargo.buildScripts.overrideCommand#`. - // If there are multiple linked projects, this command is invoked for - // each of them, with the working directory being the project root - // (i.e., the folder containing the `Cargo.toml`). + // + // If there are multiple linked projects/workspaces, this command is invoked for + // each of them, with the working directory being the workspace root + // (i.e., the folder containing the `Cargo.toml`). This can be overwritten + // by changing `#rust-analyzer.cargo.check.invocationStrategy#` and + // `#rust-analyzer.cargo.check.invocationLocation#`. + // // An example command would be: + // // ```bash // cargo check --workspace --message-format=json --all-targets // ``` - // . "rust-analyzer.check.overrideCommand": null, // Check for a specific target. Defaults to `#rust-analyzer.cargo.target#`. // @@ -141,6 +150,8 @@ // Whether to add parenthesis and argument snippets when completing function. // possible values: fill_arguments, add_parentheses, none "rust-analyzer.completion.callable.snippets": "fill_arguments", + // Whether to show full function/method signatures in completion docs. + "rust-analyzer.completion.fullFunctionSignatures.enable": false, // Maximum number of completions to return. If `null`, the limit is infinite. // // For a maximum of 5, use: @@ -156,45 +167,45 @@ "rust-analyzer.completion.privateEditable.enable": false, // Custom completion snippets. "rust-analyzer.completion.snippets.custom": { - "Box::pin": { - "postfix": "pinbox", - "requires": "std::boxed::Box", - "body": "Box::pin(${receiver})", - "description": "Put the expression into a pinned `Box`", - "scope": "expr" - }, - "Some": { - "postfix": "some", - "body": "Some(${receiver})", - "description": "Wrap the expression in an `Option::Some`", - "scope": "expr" - }, - "Rc::new": { - "postfix": "rc", - "requires": "std::rc::Rc", - "body": "Rc::new(${receiver})", - "description": "Put the expression into an `Rc`", - "scope": "expr" - }, - "Ok": { - "postfix": "ok", - "body": "Ok(${receiver})", - "description": "Wrap the expression in a `Result::Ok`", - "scope": "expr" - }, - "Err": { - "postfix": "err", - "body": "Err(${receiver})", - "description": "Wrap the expression in a `Result::Err`", - "scope": "expr" - }, - "Arc::new": { - "postfix": "arc", - "requires": "std::sync::Arc", - "body": "Arc::new(${receiver})", - "description": "Put the expression into an `Arc`", - "scope": "expr" - } + "Box::pin": { + "postfix": "pinbox", + "requires": "std::boxed::Box", + "body": "Box::pin(${receiver})", + "description": "Put the expression into a pinned `Box`", + "scope": "expr" + }, + "Some": { + "postfix": "some", + "body": "Some(${receiver})", + "description": "Wrap the expression in an `Option::Some`", + "scope": "expr" + }, + "Rc::new": { + "postfix": "rc", + "requires": "std::rc::Rc", + "body": "Rc::new(${receiver})", + "description": "Put the expression into an `Rc`", + "scope": "expr" + }, + "Ok": { + "postfix": "ok", + "body": "Ok(${receiver})", + "description": "Wrap the expression in a `Result::Ok`", + "scope": "expr" + }, + "Err": { + "postfix": "err", + "body": "Err(${receiver})", + "description": "Wrap the expression in a `Result::Err`", + "scope": "expr" + }, + "Arc::new": { + "postfix": "arc", + "requires": "std::sync::Arc", + "body": "Arc::new(${receiver})", + "description": "Put the expression into an `Arc`", + "scope": "expr" + } }, // List of rust-analyzer diagnostics to disable. "rust-analyzer.diagnostics.disabled": [], @@ -206,7 +217,8 @@ // 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.remapPrefix": {}, - // Whether to use the rustc error code. + // 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, // List of warnings that should be displayed with hint severity. // The warnings will be indicated by faded text or three dots in code @@ -258,8 +270,16 @@ "rust-analyzer.hover.documentation.keywords.enable": true, // Use markdown syntax for links on hover. "rust-analyzer.hover.links.enable": true, + // How to render the align information in a memory layout hover. + "rust-analyzer.hover.memoryLayout.alignment": "hexadecimal", // Whether to show memory layout data on hover. "rust-analyzer.hover.memoryLayout.enable": true, + // How to render the niche information in a memory layout hover. + "rust-analyzer.hover.memoryLayout.niches": false, + // How to render the offset information in a memory layout hover. + "rust-analyzer.hover.memoryLayout.offset": "hexadecimal", + // How to render the size information in a memory layout hover. + "rust-analyzer.hover.memoryLayout.size": "both", // 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, @@ -272,7 +292,9 @@ // Whether to allow import insertion to merge new imports into single path glob imports like `use std::fmt::*;`. "rust-analyzer.imports.merge.glob": true, // Prefer to unconditionally use imports of the core and alloc crate, over the std crate. - "rust-analyzer.imports.prefer.no.std": false, + "rust-analyzer.imports.preferNoStd": false, + // Whether to prefer import paths containing a `prelude` module. + "rust-analyzer.imports.preferPrelude": false, // The path structure for newly inserted paths to use. // possible values: plain, self, crate "rust-analyzer.imports.prefix": "plain", @@ -300,6 +322,8 @@ "rust-analyzer.inlayHints.expressionAdjustmentHints.hideOutsideUnsafe": false, // Whether to show inlay hints as postfix ops (`.*` instead of `*`, etc). "rust-analyzer.inlayHints.expressionAdjustmentHints.mode": "prefix", + // Whether to show implicit drop hints. + "rust-analyzer.inlayHints.implicitDrops.enable": false, // Whether to show inlay type hints for elided lifetimes in function signatures. // possible values: always, never, skip_trivial "rust-analyzer.inlayHints.lifetimeElisionHints.enable": "never", @@ -385,13 +409,20 @@ "rust-analyzer.references.excludeImports": false, // Whether to restart the server automatically when certain settings that require a restart are changed. "rust-analyzer.restartServerOnConfigChange": false, - // Environment variables passed to the runnable launched using `Test` or `Debug` lens or `rust-analyzer.run` command. - "rust-analyzer.runnableEnv": null, // Command to be executed instead of 'cargo' for runnables. "rust-analyzer.runnables.command": null, // Additional arguments to be passed to cargo for runnables such as // tests or binaries. For example, it may be `--release`. "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, // 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. @@ -461,5 +492,7 @@ "rust-analyzer.workspace.symbol.search.scope": "workspace", }, "selector": "source.rust", - "command": ["${storage_path}/LSP-rust-analyzer/rust-analyzer"], + "command": [ + "${storage_path}/LSP-rust-analyzer/rust-analyzer" + ], } diff --git a/sublime-package.json b/sublime-package.json index 6b89430..18d0ec3 100644 --- a/sublime-package.json +++ b/sublime-package.json @@ -72,30 +72,30 @@ "type": "boolean" }, "rust-analyzer.cargo.buildScripts.invocationLocation": { - "default": "workspace", - "enum": [ - "workspace", - "root" - ], - "enumDescriptions": [ - "The command will be executed in the corresponding workspace root.", - "The command will be executed in the project root." - ], - "markdownDescription": "Specifies the working directory for running build scripts.\n- \"workspace\": run build scripts for a workspace in the workspace's root directory.\n This is incompatible with `#rust-analyzer.cargo.buildScripts.invocationStrategy#` set to `once`.\n- \"root\": run build scripts in the project's root directory.\nThis config only has an effect when `#rust-analyzer.cargo.buildScripts.overrideCommand#`\nis set.", - "type": "string" + "default": "workspace", + "enum": [ + "workspace", + "root" + ], + "enumDescriptions": [ + "The command will be executed in the corresponding workspace root.", + "The command will be executed in the project root." + ], + "markdownDescription": "Specifies the working directory for running build scripts.\n- \"workspace\": run build scripts for a workspace in the workspace's root directory.\n This is incompatible with `#rust-analyzer.cargo.buildScripts.invocationStrategy#` set to `once`.\n- \"root\": run build scripts in the project's root directory.\nThis config only has an effect when `#rust-analyzer.cargo.buildScripts.overrideCommand#`\nis set.", + "type": "string" }, "rust-analyzer.cargo.buildScripts.invocationStrategy": { - "default": "per_workspace", - "enum": [ - "per_workspace", - "once" - ], - "enumDescriptions": [ - "The command will be executed for each workspace.", - "The command will be executed once." - ], - "markdownDescription": "Specifies the invocation strategy to use when running the build scripts command.\nIf `per_workspace` is set, the command will be executed for each workspace.\nIf `once` is set, the command will be executed once.\nThis config only has an effect when `#rust-analyzer.cargo.buildScripts.overrideCommand#`\nis set.", - "type": "string" + "default": "per_workspace", + "enum": [ + "per_workspace", + "once" + ], + "enumDescriptions": [ + "The command will be executed for each workspace.", + "The command will be executed once." + ], + "markdownDescription": "Specifies the invocation strategy to use when running the build scripts command.\nIf `per_workspace` is set, the command will be executed for each workspace.\nIf `once` is set, the command will be executed once.\nThis config only has an effect when `#rust-analyzer.cargo.buildScripts.overrideCommand#`\nis set.", + "type": "string" }, "rust-analyzer.cargo.buildScripts.overrideCommand": { "default": null, @@ -113,13 +113,18 @@ "markdownDescription": "Use `RUSTC_WRAPPER=rust-analyzer` when running build scripts to\navoid checking unnecessary things.", "type": "boolean" }, + "rust-analyzer.cargo.cfgs": { + "markdownDescription": "List of cfg options to enable with the given values.", + "default": {}, + "type": "object" + }, "rust-analyzer.cargo.extraArgs": { - "markdownDescription": "Extra arguments that are passed to every cargo invocation.", - "default": [], - "type": "array", - "items": { - "type": "string" - } + "markdownDescription": "Extra arguments that are passed to every cargo invocation.", + "default": [], + "type": "array", + "items": { + "type": "string" + } }, "rust-analyzer.cargo.extraEnv": { "default": {}, @@ -161,12 +166,12 @@ ] }, "rust-analyzer.cargo.sysrootSrc": { - "markdownDescription": "Relative path to the sysroot library sources. If left unset, this will default to\n`{cargo.sysroot}/lib/rustlib/src/rust/library`.\n\nThis option does not take effect until rust-analyzer is restarted.", - "default": null, - "type": [ - "null", - "string" - ] + "markdownDescription": "Relative path to the sysroot library sources. If left unset, this will default to\n`{cargo.sysroot}/lib/rustlib/src/rust/library`.\n\nThis option does not take effect until rust-analyzer is restarted.", + "default": null, + "type": [ + "null", + "string" + ] }, "rust-analyzer.cargo.target": { "default": null, @@ -183,7 +188,7 @@ "items": { "type": "string" }, - "markdownDescription": "Unsets `#[cfg(test)]` for the specified crates.", + "markdownDescription": "Unsets the implicit `#[cfg(test)]` for the specified crates.", "type": "array" }, "rust-analyzer.cargoRunner": { @@ -199,7 +204,7 @@ "default": true, "type": "boolean" }, - "rust-analyzer.check.allTargets": { + "rust-analyzer.check.allTargets": { "default": true, "markdownDescription": "Check all targets and tests (`--all-targets`).", "type": "boolean" @@ -214,7 +219,7 @@ "default": [], "type": "array", "items": { - "type": "string" + "type": "string" } }, "rust-analyzer.check.extraEnv": { @@ -246,6 +251,15 @@ "default": null, "markdownDescription": "List of features to activate. Defaults to\n`#rust-analyzer.cargo.features#`.\n\nSet to `\"all\"` to pass `--all-features` to Cargo." }, + "rust-analyzer.check.ignore": { + "markdownDescription": "List of `cargo check` (or other command specified in `check.command`) diagnostics to ignore.\n\nFor example for `cargo check`: `dead_code`, `unused_imports`, `unused_variables`,...", + "default": [], + "type": "array", + "items": { + "type": "string" + }, + "uniqueItems": true + }, "rust-analyzer.check.invocationLocation": { "default": "workspace", "enum": [ @@ -256,7 +270,7 @@ "Run checks in the project’s root directory.", "Run checks for workspaces in the corresponding workspaces' root directories. This falls back to `root` if rust-analyzer.cargo.checkOnSave.invocationStrategy is set to `once`." ], - "markdownDescription": "Specifies the working directory for running checks. This config only has an effect when rust-analyzer.cargo.buildScripts.overrideCommand is set.", + "markdownDescription": "Specifies the working directory for running checks.\n- \"workspace\": run checks for workspaces in the corresponding workspaces' root directories.\n This falls back to \"root\" if `#rust-analyzer.cargo.check.invocationStrategy#` is set to `once`.\n- \"root\": run checks in the project's root directory.\nThis config only has an effect when `#rust-analyzer.cargo.check.overrideCommand#`\nis set.", "type": "string" }, "rust-analyzer.check.invocationStrategy": { @@ -269,7 +283,7 @@ "The command will be executed once.", "The command will be executed for each workspace." ], - "markdownDescription": "Specifies the invocation strategy to use when running the checkOnSave command. This config only has an effect when rust-analyzer.cargo.buildScripts.overrideCommand is set.", + "markdownDescription": "Specifies the invocation strategy to use when running the check command.\nIf `per_workspace` is set, the command will be executed for each workspace.\nIf `once` is set, the command will be executed once.\nThis config only has an effect when `#rust-analyzer.cargo.check.overrideCommand#`\nis set.", "type": "string" }, "rust-analyzer.check.noDefaultFeatures": { @@ -281,11 +295,11 @@ ] }, "rust-analyzer.check.overrideCommand": { + "markdownDescription": "Override the command rust-analyzer uses instead of `cargo check` for\ndiagnostics on save. The command is required to output json and\nshould therefore include `--message-format=json` or a similar option\n(if your client supports the `colorDiagnosticOutput` experimental\ncapability, you can use `--message-format=json-diagnostic-rendered-ansi`).\n\nIf you're changing this because you're using some tool wrapping\nCargo, you might also want to change\n`#rust-analyzer.cargo.buildScripts.overrideCommand#`.\n\nIf there are multiple linked projects/workspaces, this command is invoked for\neach of them, with the working directory being the workspace root\n(i.e., the folder containing the `Cargo.toml`). This can be overwritten\nby changing `#rust-analyzer.cargo.check.invocationStrategy#` and\n`#rust-analyzer.cargo.check.invocationLocation#`.\n\nAn example command would be:\n\n```bash\ncargo check --workspace --message-format=json --all-targets\n```\n.", "default": null, "items": { "type": "string" }, - "markdownDescription": "Override the command rust-analyzer uses instead of `cargo check` for\ndiagnostics on save. The command is required to output json and\nshould therefore include `--message-format=json` or a similar option\n(if your client supports the `colorDiagnosticOutput` experimental\ncapability, you can use `--message-format=json-diagnostic-rendered-ansi`).\n\nIf you're changing this because you're using some tool wrapping\nCargo, you might also want to change\n`#rust-analyzer.cargo.buildScripts.overrideCommand#`.\n\nIf there are multiple linked projects, this command is invoked for\neach of them, with the working directory being the project root\n(i.e., the folder containing the `Cargo.toml`).\n\nAn example command would be:\n\n```bash\ncargo check --workspace --message-format=json --all-targets\n```\n.", "type": [ "null", "array" @@ -325,12 +339,17 @@ "markdownDescription": "Whether to add parenthesis and argument snippets when completing function.", "type": "string" }, + "rust-analyzer.completion.fullFunctionSignatures.enable": { + "markdownDescription": "Whether to show full function/method signatures in completion docs.", + "default": false, + "type": "boolean" + }, "rust-analyzer.completion.limit": { "default": true, "markdownDescription": "Maximum number of completions to return. If `null`, the limit is infinite.", "type": [ - "null", - "integer" + "null", + "integer" ], "minimum": 0 }, @@ -450,7 +469,7 @@ "type": "object" }, "rust-analyzer.diagnostics.useRustcErrorCode": { - "markdownDescription": "Whether to use the rustc error code.", + "markdownDescription": "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)'", "default": false, "type": "boolean" }, @@ -470,6 +489,24 @@ "markdownDescription": "List of warnings that should be displayed with info severity.\n\nThe warnings will be indicated by a blue squiggly underline in code\nand a blue icon in the `Problems Panel`.", "type": "array" }, + // "rust-analyzer.discoverProjectRunner": { + // "markdownDescription": "Sets the extension responsible for determining which extension the rust-analyzer extension uses to generate `rust-project.json` files. This should should only be used\n if a build system like Buck or Bazel is also in use.", + // "default": null, + // "type": [ + // "null", + // "string" + // ] + // }, + // "rust-analyzer.showRequestFailedErrorNotification": { + // "markdownDescription": "Whether to show error notifications for failing requests.", + // "default": true, + // "type": "boolean" + // }, + // "rust-analyzer.showDependenciesExplorer": { + // "markdownDescription": "Whether to show the dependencies view.", + // "default": true, + // "type": "boolean" + // }, "rust-analyzer.files.excludeDirs": { "default": [], "items": { @@ -497,9 +534,9 @@ "type": "boolean" }, "rust-analyzer.highlightRelated.closureCaptures.enable": { - "markdownDescription": "Enables highlighting of all captures of a closure while the cursor is on the `|` or move keyword of a closure.", - "default": true, - "type": "boolean" + "markdownDescription": "Enables highlighting of all captures of a closure while the cursor is on the `|` or move keyword of a closure.", + "default": true, + "type": "boolean" }, "rust-analyzer.highlightRelated.exitPoints.enable": { "default": true, @@ -561,10 +598,84 @@ "markdownDescription": "Use markdown syntax for links on hover.", "type": "boolean" }, + "rust-analyzer.hover.memoryLayout.alignment": { + "markdownDescription": "How to render the align information in a memory layout hover.", + "default": "hexadecimal", + "anyOf": [ + { + "type": "null" + }, + { + "type": "string", + "enum": [ + "both", + "decimal", + "hexadecimal" + ], + "enumDescriptions": [ + "Render as 12 (0xC)", + "Render as 12", + "Render as 0xC" + ] + } + ] + }, "rust-analyzer.hover.memoryLayout.enable": { - "markdownDescription": "Whether to show memory layout data on hover.", - "default": true, - "type": "boolean" + "markdownDescription": "Whether to show memory layout data on hover.", + "default": true, + "type": "boolean" + }, + "rust-analyzer.hover.memoryLayout.niches": { + "markdownDescription": "How to render the niche information in a memory layout hover.", + "default": false, + "type": [ + "null", + "boolean" + ] + }, + "rust-analyzer.hover.memoryLayout.offset": { + "markdownDescription": "How to render the offset information in a memory layout hover.", + "default": "hexadecimal", + "anyOf": [ + { + "type": "null" + }, + { + "type": "string", + "enum": [ + "both", + "decimal", + "hexadecimal" + ], + "enumDescriptions": [ + "Render as 12 (0xC)", + "Render as 12", + "Render as 0xC" + ] + } + ] + }, + "rust-analyzer.hover.memoryLayout.size": { + "markdownDescription": "How to render the size information in a memory layout hover.", + "default": "both", + "anyOf": [ + { + "type": "null" + }, + { + "type": "string", + "enum": [ + "both", + "decimal", + "hexadecimal" + ], + "enumDescriptions": [ + "Render as 12 (0xC)", + "Render as 12", + "Render as 0xC" + ] + } + ] }, "rust-analyzer.imports.granularity.enforce": { "default": false, @@ -598,11 +709,16 @@ "markdownDescription": "Whether to allow import insertion to merge new imports into single path glob imports like `use std::fmt::*;`.", "type": "boolean" }, - "rust-analyzer.imports.prefer.no.std": { + "rust-analyzer.imports.preferNoStd": { "default": false, "markdownDescription": "Prefer to unconditionally use imports of the core and alloc crate, over the std crate.", "type": "boolean" }, + "rust-analyzer.imports.preferPrelude": { + "markdownDescription": "Whether to prefer import paths containing a `prelude` module.", + "default": false, + "type": "boolean" + }, "rust-analyzer.imports.prefix": { "default": "plain", "enum": [ @@ -640,9 +756,9 @@ "type": "integer" }, "rust-analyzer.inlayHints.closureCaptureHints.enable": { - "markdownDescription": "Whether to show inlay hints for closure captures.", - "default": false, - "type": "boolean" + "markdownDescription": "Whether to show inlay hints for closure captures.", + "default": false, + "type": "boolean" }, "rust-analyzer.inlayHints.closureReturnTypeHints.enable": { "default": "never", @@ -660,21 +776,21 @@ "type": "string" }, "rust-analyzer.inlayHints.closureStyle": { - "markdownDescription": "Closure notation in type and chaining inlay hints.", - "default": "impl_fn", - "type": "string", - "enum": [ - "impl_fn", - "rust_analyzer", - "with_id", - "hide" - ], - "markdownEnumDescriptions": [ - "`impl FnMut(i32, u64) -> i8`", - "`|i32, u64| -> i8`", - "`{closure#14352}`, where that id is the unique number of the closure in r-a internals", - "Shows `...` for every closure type" - ] + "markdownDescription": "Closure notation in type and chaining inlay hints.", + "default": "impl_fn", + "type": "string", + "enum": [ + "impl_fn", + "rust_analyzer", + "with_id", + "hide" + ], + "markdownEnumDescriptions": [ + "`impl FnMut(i32, u64) -> i8`", + "`|i32, u64| -> i8`", + "`{closure#14352}`, where that id is the unique number of the closure in r-a internals", + "Shows `...` for every closure type" + ] }, "rust-analyzer.inlayHints.discriminantHints.enable": { "markdownDescription": "Whether to show enum variant discriminant hints.", @@ -728,6 +844,11 @@ "Show prefix or postfix depending on which uses less parenthesis, preferring postfix." ] }, + "rust-analyzer.inlayHints.implicitDrops.enable": { + "markdownDescription": "Whether to show implicit drop hints.", + "default": false, + "type": "boolean" + }, "rust-analyzer.inlayHints.lifetimeElisionHints.enable": { "default": "never", "enum": [ @@ -803,9 +924,9 @@ "type": "boolean" }, "rust-analyzer.interpret.tests": { - "markdownDescription": "Enables the experimental support for interpreting tests.", - "default": false, - "type": "boolean" + "markdownDescription": "Enables the experimental support for interpreting tests.", + "default": false, + "type": "boolean" }, "rust-analyzer.joinLines.joinAssignments": { "default": true, @@ -850,12 +971,12 @@ "rust-analyzer.lens.location": { "default": "above_name", "enum": [ - "above_name", - "above_whole_item" + "above_name", + "above_whole_item" ], "enumDescriptions": [ - "Render annotations above the name of the item.", - "Render annotations above the whole item, including documentation comments and attributes." + "Render annotations above the name of the item.", + "Render annotations above the whole item, including documentation comments and attributes." ], "markdownDescription": "Where to render annotations.", }, @@ -905,9 +1026,9 @@ ] }, "rust-analyzer.lru.query.capacities": { - "markdownDescription": "Sets the LRU capacity of the specified queries.", - "default": {}, - "type": "object" + "markdownDescription": "Sets the LRU capacity of the specified queries.", + "default": {}, + "type": "object" }, "rust-analyzer.notifications.cargoTomlNotFound": { "default": true, @@ -951,7 +1072,7 @@ "markdownDescription": "Whether to restart the server automatically when certain settings that require a restart are changed.", "type": "boolean" }, - "rust-analyzer.runnableEnv": { + "rust-analyzer.runnables.extraEnv": { "anyOf": [ { "type": "null" @@ -959,13 +1080,22 @@ { "items": { "properties": { - "env": { - "description": "Variables in form of { \"key\": \"value\"}", - "type": "object" + "platform": { + "type": [ + "null", + "string", + "array" + ], + "default": null, + "markdownDescription": "Platform(s) filter like \"win32\" or [\"linux\", \"win32\"]. See [process.platform](https://nodejs.org/api/process.html#processplatform) values." }, "mask": { - "description": "Runnable name mask", - "type": "string" + "type": "string", + "description": "Runnable name mask" + }, + "env": { + "type": "object", + "description": "Variables in form of { \"key\": \"value\"}" } }, "type": "object" @@ -980,6 +1110,29 @@ "default": null, "markdownDescription": "Environment variables passed to the runnable launched using `Test` or `Debug` lens or `rust-analyzer.run` command." }, + // "rust-analyzer.runnables.problemMatcher": { + // "type": "array", + // "items": { + // "type": "string" + // }, + // "default": [ + // "$rustc" + // ], + // "markdownDescription": "Problem matchers to use for `rust-analyzer.run` command, eg `[\"$rustc\", \"$rust-panic\"]`." + // }, + // "rust-analyzer.statusBar.clickAction": { + // "type": "string", + // "enum": [ + // "stopServer", + // "openLogs" + // ], + // "enumDescriptions": [ + // "Stop Server", + // "Open Logs" + // ], + // "default": "openLogs", + // "markdownDescription": "Action to run when clicking the extension status bar item." + // }, "rust-analyzer.references.excludeImports": { "default": false, "markdownDescription": "Exclude imports from find-all-references.", @@ -1001,6 +1154,21 @@ "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.rustc.source": { "default": null, "markdownDescription": "Path to the Cargo.toml of the rust compiler workspace, for usage in rustc_private\nprojects, or \"discover\" to try to automatically find it if the `rustc-dev` component\nis installed.\n\nAny project which uses rust-analyzer with the rustcPrivate\ncrates must set `[package.metadata.rust-analyzer] rustc_private=true` to use it.\n\nThis option does not take effect until rust-analyzer is restarted.", @@ -1039,9 +1207,9 @@ "type": "boolean" }, "rust-analyzer.semanticHighlighting.nonStandardTokens": { - "markdownDescription": "Whether the server is allowed to emit non-standard tokens and modifiers.", - "default": true, - "type": "boolean" + "markdownDescription": "Whether the server is allowed to emit non-standard tokens and modifiers.", + "default": true, + "type": "boolean" }, "rust-analyzer.semanticHighlighting.operator.enable": { "default": true, From c356974c3599187bdff85287a790cd2111dd88ab Mon Sep 17 00:00:00 2001 From: Rafal Chlodnicki Date: Fri, 15 Dec 2023 09:55:23 +0100 Subject: [PATCH 3/4] only run on plugin.py changes --- .github/workflows/schema.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/schema.yml b/.github/workflows/schema.yml index 40b696e..62a6a21 100644 --- a/.github/workflows/schema.yml +++ b/.github/workflows/schema.yml @@ -4,6 +4,8 @@ on: pull_request: branches: - main + paths: + - 'plugin.py' permissions: pull-requests: write From a84992c9b2f75c0c2816f47bb3847124bf8be06f Mon Sep 17 00:00:00 2001 From: Rafal Chlodnicki Date: Fri, 15 Dec 2023 09:58:32 +0100 Subject: [PATCH 4/4] formatting --- LSP-rust-analyzer.sublime-settings | 65 ++++++++++++------------------ 1 file changed, 25 insertions(+), 40 deletions(-) diff --git a/LSP-rust-analyzer.sublime-settings b/LSP-rust-analyzer.sublime-settings index 25c7694..2088917 100644 --- a/LSP-rust-analyzer.sublime-settings +++ b/LSP-rust-analyzer.sublime-settings @@ -93,8 +93,7 @@ // Extra environment variables that will be set when running cargo check. // Extends rust-analyzer.cargo.extraEnv. "rust-analyzer.check.extraEnv": {}, - // List of features to activate. Defaults to - // `#rust-analyzer.cargo.features#`. + // List of features to activate. Defaults to `rust-analyzer.cargo.features`. // Set to `"all"` to pass `--all-features` to Cargo. "rust-analyzer.check.features": null, // List of `cargo check` (or other command specified in `check.command`) diagnostics to ignore. @@ -102,17 +101,16 @@ "rust-analyzer.check.ignore": [], // Specifies the working directory for running checks. // - "workspace": run checks for workspaces in the corresponding workspaces' root directories. - // This falls back to "root" if `#rust-analyzer.cargo.check.invocationStrategy#` is set to `once`. + // This falls back to "root" if `rust-analyzer.cargo.check.invocationStrategy` is set to `once`. // - "root": run checks in the project's root directory. - //This config only has an effect when `#rust-analyzer.cargo.check.overrideCommand#` is set. + //This config only has an effect when `rust-analyzer.cargo.check.overrideCommand` is set. "rust-analyzer.check.invocationLocation": "workspace", // Specifies the invocation strategy to use when running the check command. // If `per_workspace` is set, the command will be executed for each workspace. // If `once` is set, the command will be executed once. - // This config only has an effect when `#rust-analyzer.cargo.check.overrideCommand#` is set. + // This config only has an effect when `rust-analyzer.cargo.check.overrideCommand` is set. "rust-analyzer.check.invocationStrategy": "per_workspace", - // Whether to pass `--no-default-features` to Cargo. Defaults to - // `#rust-analyzer.cargo.noDefaultFeatures#`. + // Whether to pass `--no-default-features` to Cargo. Defaults to `rust-analyzer.cargo.noDefaultFeatures`. "rust-analyzer.check.noDefaultFeatures": null, // Override the command rust-analyzer uses instead of `cargo check` for // diagnostics on save. The command is required to output json and @@ -121,14 +119,13 @@ // capability, you can use `--message-format=json-diagnostic-rendered-ansi`). // // If you're changing this because you're using some tool wrapping - // Cargo, you might also want to change - // `#rust-analyzer.cargo.buildScripts.overrideCommand#`. + // Cargo, you might also want to change `rust-analyzer.cargo.buildScripts.overrideCommand`. // // If there are multiple linked projects/workspaces, this command is invoked for // each of them, with the working directory being the workspace root // (i.e., the folder containing the `Cargo.toml`). This can be overwritten - // by changing `#rust-analyzer.cargo.check.invocationStrategy#` and - // `#rust-analyzer.cargo.check.invocationLocation#`. + // by changing `rust-analyzer.cargo.check.invocationStrategy` and + // `rust-analyzer.cargo.check.invocationLocation`. // // An example command would be: // @@ -136,7 +133,7 @@ // cargo check --workspace --message-format=json --all-targets // ``` "rust-analyzer.check.overrideCommand": null, - // Check for a specific target. Defaults to `#rust-analyzer.cargo.target#`. + // Check for a specific target. Defaults to `rust-analyzer.cargo.target`. // // Can be a single target, e.g. `\"x86_64-unknown-linux-gnu\"` or a list of targets, e.g. //`[\"aarch64-apple-darwin\", \"x86_64-apple-darwin\"]` @@ -246,27 +243,21 @@ // Enables highlighting of all break points for a loop or block context while the cursor is on any `async` or `await` // keywords. "rust-analyzer.highlightRelated.yieldPoints.enable": true, - // Whether to show `Debug` action. Only applies when - // `#rust-analyzer.hover.actions.enable#` is set. + // Whether to show `Debug` action. Only applies when `rust-analyzer.hover.actions.enable` is set. "rust-analyzer.hover.actions.debug.enable": true, // Whether to show HoverActions in Rust files. "rust-analyzer.hover.actions.enable": true, - // Whether to show `Go to Type Definition` action. Only applies when - // `#rust-analyzer.hover.actions.enable#` is set. + // Whether to show `Go to Type Definition` action. Only applies when `rust-analyzer.hover.actions.enable` is set. "rust-analyzer.hover.actions.gotoTypeDef.enable": true, - // Whether to show `Implementations` action. Only applies when - // `#rust-analyzer.hover.actions.enable#` is set. + // Whether to show `Implementations` action. Only applies when `rust-analyzer.hover.actions.enable` is set. "rust-analyzer.hover.actions.implementations.enable": true, - // Whether to show `References` action. Only applies when - // `#rust-analyzer.hover.actions.enable#` is set. + // Whether to show `References` action. Only applies when `rust-analyzer.hover.actions.enable` is set. "rust-analyzer.hover.actions.references.enable": false, - // Whether to show `Run` action. Only applies when - // `#rust-analyzer.hover.actions.enable#` is set. + // Whether to show `Run` action. Only applies when `rust-analyzer.hover.actions.enable` is set. "rust-analyzer.hover.actions.run.enable": true, // Whether to show documentation on hover. "rust-analyzer.hover.documentation.enable": true, - // Whether to show keyword hover popups. Only applies when - // `#rust-analyzer.hover.documentation.enable#` is set. + // Whether to show keyword hover popups. Only applies when `rust-analyzer.hover.documentation.enable` is set. "rust-analyzer.hover.documentation.keywords.enable": true, // Use markdown syntax for links on hover. "rust-analyzer.hover.links.enable": true, @@ -341,7 +332,7 @@ // Whether to show inlay type hints for variables. "rust-analyzer.inlayHints.typeHints.enable": true, // Whether to hide inlay type hints for `let` statements that initialize to a closure. - // Only applies to closures with blocks, same as `#rust-analyzer.inlayHints.closureReturnTypeHints.enable#`. + // Only applies to closures with blocks, same as `rust-analyzer.inlayHints.closureReturnTypeHints.enable`. "rust-analyzer.inlayHints.typeHints.hideClosureInitialization": false, // Whether to hide inlay type hints for constructors. "rust-analyzer.inlayHints.typeHints.hideNamedConstructor": false, @@ -355,33 +346,27 @@ "rust-analyzer.joinLines.removeTrailingComma": true, // Join lines unwraps trivial blocks. "rust-analyzer.joinLines.unwrapTrivialBlock": true, - // Whether to show `Debug` lens. Only applies when - // `#rust-analyzer.lens.enable#` is set. + // Whether to show `Debug` lens. Only applies when `rust-analyzer.lens.enable` is set. "rust-analyzer.lens.debug.enable": false, // Whether to show CodeLens in Rust files. "rust-analyzer.lens.enable": true, // Internal config: use custom client-side commands even when the // client doesn't set the corresponding capability. "rust-analyzer.lens.forceCustomCommands": true, - // Whether to show `Implementations` lens. Only applies when - // `#rust-analyzer.lens.enable#` is set. + // Whether to show `Implementations` lens. Only applies when `rust-analyzer.lens.enable` is set. "rust-analyzer.lens.implementations.enable": true, // Where to render annotations. "rust-analyzer.lens.location": "above_name", // Whether to show `References` lens for Struct, Enum, and Union. - // Only applies when `#rust-analyzer.lens.enable#` is set. + // Only applies when `rust-analyzer.lens.enable` is set. "rust-analyzer.lens.references.adt.enable": false, - // Whether to show `References` lens for Enum Variants. - // Only applies when `#rust-analyzer.lens.enable#` is set. + // Whether to show `References` lens for Enum Variants. Only applies when `rust-analyzer.lens.enable` is set. "rust-analyzer.lens.references.enumVariant.enable": false, - // Whether to show `Method References` lens. Only applies when - // `#rust-analyzer.lens.enable#` is set. + // Whether to show `Method References` lens. Only applies when `rust-analyzer.lens.enable` is set. "rust-analyzer.lens.references.method.enable": false, - // Whether to show `References` lens for Trait. - // Only applies when `#rust-analyzer.lens.enable#` is set. + // Whether to show `References` lens for Trait. Only applies when `rust-analyzer.lens.enable` is set. "rust-analyzer.lens.references.trait.enable": false, - // Whether to show `Run` lens. Only applies when - // `#rust-analyzer.lens.enable#` is set. + // Whether to show `Run` lens. Only applies when `rust-analyzer.lens.enable` is set. "rust-analyzer.lens.run.enable": true, // Disable project auto-discovery in favor of explicitly specified set // of projects. @@ -396,9 +381,9 @@ "rust-analyzer.notifications.cargoTomlNotFound": true, // How many worker threads in the main loop. The default `null` means to pick automatically. "rust-analyzer.numThreads": null, - // Expand attribute macros. Requires `#rust-analyzer.procMacro.enable#` to be set. + // Expand attribute macros. Requires `rust-analyzer.procMacro.enable` to be set. "rust-analyzer.procMacro.attributes.enable": true, - // Enable support for procedural macros, implies `#rust-analyzer.cargo.buildScripts.enable#`. + // Enable support for procedural macros, implies `rust-analyzer.cargo.buildScripts.enable`. "rust-analyzer.procMacro.enable": true, // These proc-macros will be ignored when trying to expand them. // This config takes a map of crate names with the exported proc-macro names to ignore as values.