如何在创建扩展时获取 VS Code 中当前活动文件的确切路径
How to get the exact path of the currently active file in VS Code while creating an extension
我正在创建一个 VSCode 扩展。
我想获取当前在编辑器中打开的文件的确切路径!
如何获取!
vscode.window.activeTextEditor.document.uri.fsPath
如果你想要 Windows 平台上的 posix 版本(你必须处理 :
)
vscode.window.activeTextEditor.document.uri.path
我正在创建一个 VSCode 扩展。
我想获取当前在编辑器中打开的文件的确切路径!
如何获取!
vscode.window.activeTextEditor.document.uri.fsPath
如果你想要 Windows 平台上的 posix 版本(你必须处理 :
)
vscode.window.activeTextEditor.document.uri.path