How to get file name or path in vscode extension when user right click on file in explorer/context?

前端 未结 1 1314
伪装坚强ぢ
伪装坚强ぢ 2020-12-10 08:19

My extension creates a context menu in the explorer tree:

\"contributes\": {
        \"commands\": [
            ...         


        
相关标签:
1条回答
  • 2020-12-10 08:40

    The callback will receive an argument with a vscode.Uri object:

    vscode.commands.registerCommand('myextension.mycommand', (uri:vscode.Uri) => {
        console.log(uri.fsPath);
    });
    
    0 讨论(0)
提交回复
热议问题