Remove unnecessary openFile command

This commit is contained in:
Lukas Wirth 2022-07-17 17:45:43 +02:00 committed by Bruno Ortiz
parent 76432d39cb
commit 16cba19ff3
4 changed files with 2 additions and 17 deletions

View file

@ -285,10 +285,6 @@
"title": "Clear flycheck diagnostics",
"category": "rust-analyzer"
},
{
"command": "rust-analyzer.openFile",
"title": "Open File"
},
{
"command": "rust-analyzer.revealDependency",
"title": "Reveal File"
@ -1979,4 +1975,4 @@
}
]
}
}
}

View file

@ -267,16 +267,6 @@ export function openCargoToml(ctx: CtxInit): Cmd {
};
}
export function openFile(_ctx: CtxInit): Cmd {
return async (uri: vscode.Uri) => {
try {
await vscode.window.showTextDocument(uri);
} catch (err) {
await vscode.window.showErrorMessage(err.message);
}
};
}
export function revealDependency(ctx: CtxInit): Cmd {
return async (editor: RustEditor) => {
const rootPath = vscode.workspace.workspaceFolders![0].uri.fsPath;

View file

@ -155,7 +155,7 @@ export class DependencyFile extends vscode.TreeItem {
this.id = this.dependencyPath.toLowerCase();
if (!isDir) {
this.command = {
command: "rust-analyzer.openFile",
command: "vscode.open",
title: "Open File",
arguments: [vscode.Uri.file(this.dependencyPath)],
};

View file

@ -192,7 +192,6 @@ function createCommands(): Record<string, CommandFactory> {
showReferences: {enabled: commands.showReferences},
triggerParameterHints: {enabled: commands.triggerParameterHints},
openLogs: {enabled: commands.openLogs},
openFile: {enabled: commands.openFile},
revealDependency: {enabled: commands.revealDependency}
};
}