I want to print the path of the file the user has right clicked. I tried like below but returns undefined.
let disposable = vscode.commands.registerCommand(
"extension.helloWorld",
function () {
console.log("File path is " + vscode.Uri.fsPath)
})
I tried passing vscode.Uri as shown below however vscode is not defined as function argument.
let disposable = vscode.commands.registerCommand(
"extension.helloWorld",
function (vscode.Uri) {
console.log("File path is " + vscode.Uri.fsPath)
})
Also using arrow function does not work and causes error somehow.