Remove use of deprecated rootPath

Fixes https://github.com/microsoft/vscode-extension-samples/issues/357
This commit is contained in:
Alex Ross
2021-07-29 14:58:42 +02:00
parent 0242cd30d8
commit e4ddd8c30c

View File

@ -10,7 +10,8 @@ let rakeTaskProvider: vscode.Disposable | undefined;
let customTaskProvider: vscode.Disposable | undefined;
export function activate(_context: vscode.ExtensionContext): void {
const workspaceRoot = vscode.workspace.rootPath;
const workspaceRoot = (vscode.workspace.workspaceFolders && (vscode.workspace.workspaceFolders.length > 0))
? vscode.workspace.workspaceFolders[0].uri.fsPath : undefined;
if (!workspaceRoot) {
return;
}