How to get file name or path in vscode extension when user right click on file in explorer/context?
问题 My extension creates a context menu in the explorer tree: "contributes": { "commands": [ ... { "command": "myextension.mycommand", "title": "Run my command" } ], "menus": { "explorer/context": [{ "when": "resourceLangId == python", "command": "myextension.mycommand", "group": "MyGroup" }] } } In extension.ts : export function activate(context: vscode.ExtensionContext) { context.subscriptions.push(vscode.commands.registerCommand('myextension.mycommand', () => { //How to get the filename or