about summary refs log tree commit diff
path: root/src/tools/rust-analyzer/editors
diff options
context:
space:
mode:
authorLaurențiu Nicola <lnicola@dend.ro>2022-09-20 17:39:17 +0300
committerLaurențiu Nicola <lnicola@dend.ro>2022-09-20 17:39:17 +0300
commit9dcd19bd2e377448b0cc4749dfaf9e064d83a8c3 (patch)
tree1b60d5154bedb83562752f154ad6378e34d56d17 /src/tools/rust-analyzer/editors
parent8fd6d03e22fba2930ad377b87299de6a37076074 (diff)
parent187bee0bb100111466a3557c20f80defcc0f4db3 (diff)
downloadrust-9dcd19bd2e377448b0cc4749dfaf9e064d83a8c3.tar.gz
rust-9dcd19bd2e377448b0cc4749dfaf9e064d83a8c3.zip
:arrow_up: rust-analyzer
Diffstat (limited to 'src/tools/rust-analyzer/editors')
-rw-r--r--src/tools/rust-analyzer/editors/code/package.json42
-rw-r--r--src/tools/rust-analyzer/editors/code/src/commands.ts24
-rw-r--r--src/tools/rust-analyzer/editors/code/src/main.ts1
3 files changed, 33 insertions, 34 deletions
diff --git a/src/tools/rust-analyzer/editors/code/package.json b/src/tools/rust-analyzer/editors/code/package.json
index 767c5875bf7..94b41c049bc 100644
--- a/src/tools/rust-analyzer/editors/code/package.json
+++ b/src/tools/rust-analyzer/editors/code/package.json
@@ -207,11 +207,6 @@
                 "category": "rust-analyzer"
             },
             {
-                "command": "rust-analyzer.toggleInlayHints",
-                "title": "Toggle inlay hints",
-                "category": "rust-analyzer"
-            },
-            {
                 "command": "rust-analyzer.openDocs",
                 "title": "Open docs under cursor",
                 "category": "rust-analyzer"
@@ -442,6 +437,11 @@
                     "default": true,
                     "type": "boolean"
                 },
+                "rust-analyzer.cargo.extraEnv": {
+                    "markdownDescription": "Extra environment variables that will be set when running cargo, rustc\nor other commands within the workspace. Useful for setting RUSTFLAGS.",
+                    "default": {},
+                    "type": "object"
+                },
                 "rust-analyzer.cargo.features": {
                     "markdownDescription": "List of features to activate.\n\nSet this to `\"all\"` to pass `--all-features` to cargo.",
                     "default": [],
@@ -514,6 +514,11 @@
                         "type": "string"
                     }
                 },
+                "rust-analyzer.checkOnSave.extraEnv": {
+                    "markdownDescription": "Extra environment variables that will be set when running `cargo check`.",
+                    "default": {},
+                    "type": "object"
+                },
                 "rust-analyzer.checkOnSave.features": {
                     "markdownDescription": "List of features to activate. Defaults to\n`#rust-analyzer.cargo.features#`.\n\nSet to `\"all\"` to pass `--all-features` to Cargo.",
                     "default": null,
@@ -803,6 +808,11 @@
                     "default": true,
                     "type": "boolean"
                 },
+                "rust-analyzer.imports.prefer.no.std": {
+                    "markdownDescription": "Prefer to unconditionally use imports of the core and alloc crate, over the std crate.",
+                    "default": false,
+                    "type": "boolean"
+                },
                 "rust-analyzer.imports.prefix": {
                     "markdownDescription": "The path structure for newly inserted paths to use.",
                     "default": "plain",
@@ -963,6 +973,19 @@
                     "default": true,
                     "type": "boolean"
                 },
+                "rust-analyzer.lens.location": {
+                    "markdownDescription": "Where to render annotations.",
+                    "default": "above_name",
+                    "type": "string",
+                    "enum": [
+                        "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."
+                    ]
+                },
                 "rust-analyzer.lens.references.adt.enable": {
                     "markdownDescription": "Whether to show `References` lens for Struct, Enum, and Union.\nOnly applies when `#rust-analyzer.lens.enable#` is set.",
                     "default": false,
@@ -1036,6 +1059,11 @@
                         "string"
                     ]
                 },
+                "rust-analyzer.references.excludeImports": {
+                    "markdownDescription": "Exclude imports from find-all-references.",
+                    "default": false,
+                    "type": "boolean"
+                },
                 "rust-analyzer.runnables.command": {
                     "markdownDescription": "Command to be executed instead of 'cargo' for runnables.",
                     "default": null,
@@ -1634,10 +1662,6 @@
                     "when": "inRustProject"
                 },
                 {
-                    "command": "rust-analyzer.toggleInlayHints",
-                    "when": "inRustProject"
-                },
-                {
                     "command": "rust-analyzer.openDocs",
                     "when": "inRustProject"
                 },
diff --git a/src/tools/rust-analyzer/editors/code/src/commands.ts b/src/tools/rust-analyzer/editors/code/src/commands.ts
index a21b304bbda..b9ad525e361 100644
--- a/src/tools/rust-analyzer/editors/code/src/commands.ts
+++ b/src/tools/rust-analyzer/editors/code/src/commands.ts
@@ -321,30 +321,6 @@ export function serverVersion(ctx: Ctx): Cmd {
     };
 }
 
-export function toggleInlayHints(_ctx: Ctx): Cmd {
-    return async () => {
-        const config = vscode.workspace.getConfiguration("editor.inlayHints", {
-            languageId: "rust",
-        });
-
-        const value = config.get("enabled");
-        let stringValue;
-        if (typeof value === "string") {
-            stringValue = value;
-        } else {
-            stringValue = value ? "on" : "off";
-        }
-        const nextValues: Record<string, string> = {
-            on: "off",
-            off: "on",
-            onUnlessPressed: "offUnlessPressed",
-            offUnlessPressed: "onUnlessPressed",
-        };
-        const nextValue = nextValues[stringValue] ?? "on";
-        await config.update("enabled", nextValue, vscode.ConfigurationTarget.Global);
-    };
-}
-
 // Opens the virtual file that will show the syntax tree
 //
 // The contents of the file come from the `TextDocumentContentProvider`
diff --git a/src/tools/rust-analyzer/editors/code/src/main.ts b/src/tools/rust-analyzer/editors/code/src/main.ts
index e9b62e0cc25..41bde4195e0 100644
--- a/src/tools/rust-analyzer/editors/code/src/main.ts
+++ b/src/tools/rust-analyzer/editors/code/src/main.ts
@@ -180,7 +180,6 @@ async function initCommonContext(context: vscode.ExtensionContext, ctx: Ctx) {
 
     ctx.registerCommand("ssr", commands.ssr);
     ctx.registerCommand("serverVersion", commands.serverVersion);
-    ctx.registerCommand("toggleInlayHints", commands.toggleInlayHints);
 
     // Internal commands which are invoked by the server.
     ctx.registerCommand("runSingle", commands.runSingle);