Tidy up vscode extension a bit

This commit is contained in:
Lukas Wirth 2024-06-19 09:36:22 +02:00
parent f9bb5476c3
commit ff07caa9de
16 changed files with 143 additions and 171 deletions

View file

@ -24,12 +24,12 @@ import {
isRustEditor,
type RustEditor,
type RustDocument,
unwrapUndefinable,
} from "./util";
import { startDebugSession, makeDebugConfig } from "./debug";
import type { LanguageClient } from "vscode-languageclient/node";
import { LINKED_COMMANDS } from "./client";
import { HOVER_REFERENCE_COMMAND } from "./client";
import type { DependencyId } from "./dependencies_provider";
import { unwrapUndefinable } from "./undefinable";
import { log } from "./util";
export * from "./ast_inspector";
@ -1196,11 +1196,10 @@ export function newDebugConfig(ctx: CtxInit): Cmd {
};
}
export function linkToCommand(_: Ctx): Cmd {
return async (commandId: string) => {
const link = LINKED_COMMANDS.get(commandId);
if (link) {
const { command, arguments: args = [] } = link;
export function hoverRefCommandProxy(_: Ctx): Cmd {
return async () => {
if (HOVER_REFERENCE_COMMAND) {
const { command, arguments: args = [] } = HOVER_REFERENCE_COMMAND;
await vscode.commands.executeCommand(command, ...args);
}
};