about summary refs log tree commit diff
path: root/editors/code/src/main.ts
diff options
context:
space:
mode:
authorbruno-ortiz <brunortiz11@gmail.com>2022-02-25 21:37:55 -0300
committerBruno Ortiz <brunortiz11@gmail.com>2023-05-02 10:48:33 -0300
commit795a1cbe89bc2428937aec828963fe64a2c8d4d9 (patch)
tree0e07a8bfd2c0cef3e401bad15755a425528916cb /editors/code/src/main.ts
parentcffc402c058f9d4d0675ed20bd920fa700c361ec (diff)
downloadrust-795a1cbe89bc2428937aec828963fe64a2c8d4d9.tar.gz
rust-795a1cbe89bc2428937aec828963fe64a2c8d4d9.zip
Creating rust dependencies tree view
Diffstat (limited to 'editors/code/src/main.ts')
-rw-r--r--editors/code/src/main.ts102
1 files changed, 53 insertions, 49 deletions
diff --git a/editors/code/src/main.ts b/editors/code/src/main.ts
index 7ae8fa8ca28..62b2e7a2771 100644
--- a/editors/code/src/main.ts
+++ b/editors/code/src/main.ts
@@ -2,10 +2,10 @@ import * as vscode from "vscode";
 import * as lc from "vscode-languageclient/node";
 
 import * as commands from "./commands";
-import { CommandFactory, Ctx, fetchWorkspace } from "./ctx";
+import {CommandFactory, Ctx, fetchWorkspace} from "./ctx";
 import * as diagnostics from "./diagnostics";
-import { activateTaskProvider } from "./tasks";
-import { setContextValue } from "./util";
+import {activateTaskProvider} from "./tasks";
+import {setContextValue} from "./util";
 
 const RUST_PROJECT_CONTEXT_NAME = "inRustProject";
 
@@ -24,11 +24,12 @@ export async function activate(
         vscode.window
             .showWarningMessage(
                 `You have both the rust-analyzer (rust-lang.rust-analyzer) and Rust (rust-lang.rust) ` +
-                    "plugins enabled. These are known to conflict and cause various functions of " +
-                    "both plugins to not work correctly. You should disable one of them.",
+                "plugins enabled. These are known to conflict and cause various functions of " +
+                "both plugins to not work correctly. You should disable one of them.",
                 "Got it"
             )
-            .then(() => {}, console.error);
+            .then(() => {
+            }, console.error);
     }
 
     const ctx = new Ctx(context, createCommands(), fetchWorkspace());
@@ -118,7 +119,7 @@ function createCommands(): Record<string, CommandFactory> {
     return {
         onEnter: {
             enabled: commands.onEnter,
-            disabled: (_) => () => vscode.commands.executeCommand("default:type", { text: "\n" }),
+            disabled: (_) => () => vscode.commands.executeCommand("default:type", {text: "\n"}),
         },
         restartServer: {
             enabled: (ctx) => async () => {
@@ -144,51 +145,54 @@ function createCommands(): Record<string, CommandFactory> {
                     health: "stopped",
                 });
             },
-            disabled: (_) => async () => {},
+            disabled: (_) => async () => {
+            },
         },
 
-        analyzerStatus: { enabled: commands.analyzerStatus },
-        memoryUsage: { enabled: commands.memoryUsage },
-        shuffleCrateGraph: { enabled: commands.shuffleCrateGraph },
-        reloadWorkspace: { enabled: commands.reloadWorkspace },
-        rebuildProcMacros: { enabled: commands.rebuildProcMacros },
-        addProject: { enabled: commands.addProject },
-        matchingBrace: { enabled: commands.matchingBrace },
-        joinLines: { enabled: commands.joinLines },
-        parentModule: { enabled: commands.parentModule },
-        syntaxTree: { enabled: commands.syntaxTree },
-        viewHir: { enabled: commands.viewHir },
-        viewMir: { enabled: commands.viewMir },
+        analyzerStatus: {enabled: commands.analyzerStatus},
+        memoryUsage: {enabled: commands.memoryUsage},
+        shuffleCrateGraph: {enabled: commands.shuffleCrateGraph},
+        reloadWorkspace: {enabled: commands.reloadWorkspace},
+        rebuildProcMacros: {enabled: commands.rebuildProcMacros},
+        addProject: {enabled: commands.addProject},
+        matchingBrace: {enabled: commands.matchingBrace},
+        joinLines: {enabled: commands.joinLines},
+        parentModule: {enabled: commands.parentModule},
+        syntaxTree: {enabled: commands.syntaxTree},
+        viewHir: {enabled: commands.viewHir},
+        viewMir: {enabled: commands.viewMir},
         interpretFunction: { enabled: commands.interpretFunction },
-        viewFileText: { enabled: commands.viewFileText },
-        viewItemTree: { enabled: commands.viewItemTree },
-        viewCrateGraph: { enabled: commands.viewCrateGraph },
-        viewFullCrateGraph: { enabled: commands.viewFullCrateGraph },
-        expandMacro: { enabled: commands.expandMacro },
-        run: { enabled: commands.run },
-        copyRunCommandLine: { enabled: commands.copyRunCommandLine },
-        debug: { enabled: commands.debug },
-        newDebugConfig: { enabled: commands.newDebugConfig },
-        openDocs: { enabled: commands.openDocs },
-        openCargoToml: { enabled: commands.openCargoToml },
-        peekTests: { enabled: commands.peekTests },
-        moveItemUp: { enabled: commands.moveItemUp },
-        moveItemDown: { enabled: commands.moveItemDown },
-        cancelFlycheck: { enabled: commands.cancelFlycheck },
-        clearFlycheck: { enabled: commands.clearFlycheck },
-        runFlycheck: { enabled: commands.runFlycheck },
-        ssr: { enabled: commands.ssr },
-        serverVersion: { enabled: commands.serverVersion },
+        viewFileText: {enabled: commands.viewFileText},
+        viewItemTree: {enabled: commands.viewItemTree},
+        viewCrateGraph: {enabled: commands.viewCrateGraph},
+        viewFullCrateGraph: {enabled: commands.viewFullCrateGraph},
+        expandMacro: {enabled: commands.expandMacro},
+        run: {enabled: commands.run},
+        copyRunCommandLine: {enabled: commands.copyRunCommandLine},
+        debug: {enabled: commands.debug},
+        newDebugConfig: {enabled: commands.newDebugConfig},
+        openDocs: {enabled: commands.openDocs},
+        openCargoToml: {enabled: commands.openCargoToml},
+        peekTests: {enabled: commands.peekTests},
+        moveItemUp: {enabled: commands.moveItemUp},
+        moveItemDown: {enabled: commands.moveItemDown},
+        cancelFlycheck: {enabled: commands.cancelFlycheck},
+        clearFlycheck: {enabled: commands.clearFlycheck},
+        runFlycheck: {enabled: commands.runFlycheck},
+        ssr: {enabled: commands.ssr},
+        serverVersion: {enabled: commands.serverVersion},
         // Internal commands which are invoked by the server.
-        applyActionGroup: { enabled: commands.applyActionGroup },
-        applySnippetWorkspaceEdit: { enabled: commands.applySnippetWorkspaceEditCommand },
-        debugSingle: { enabled: commands.debugSingle },
-        gotoLocation: { enabled: commands.gotoLocation },
-        linkToCommand: { enabled: commands.linkToCommand },
-        resolveCodeAction: { enabled: commands.resolveCodeAction },
-        runSingle: { enabled: commands.runSingle },
-        showReferences: { enabled: commands.showReferences },
-        triggerParameterHints: { enabled: commands.triggerParameterHints },
-        openLogs: { enabled: commands.openLogs },
+        applyActionGroup: {enabled: commands.applyActionGroup},
+        applySnippetWorkspaceEdit: {enabled: commands.applySnippetWorkspaceEditCommand},
+        debugSingle: {enabled: commands.debugSingle},
+        gotoLocation: {enabled: commands.gotoLocation},
+        linkToCommand: {enabled: commands.linkToCommand},
+        resolveCodeAction: {enabled: commands.resolveCodeAction},
+        runSingle: {enabled: commands.runSingle},
+        showReferences: {enabled: commands.showReferences},
+        triggerParameterHints: {enabled: commands.triggerParameterHints},
+        openLogs: {enabled: commands.openLogs},
+        openFile: {enabled: commands.openFile},
+        revealDependency: {enabled: commands.revealDependency}
     };
 }