-
Notifications
You must be signed in to change notification settings - Fork 68
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add showWorkspaceFolderPick to AzExtUserInput
- Loading branch information
1 parent
2e03187
commit 5852321
Showing
5 changed files
with
84 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
/*--------------------------------------------------------------------------------------------- | ||
* Copyright (c) Microsoft Corporation. All rights reserved. | ||
* Licensed under the MIT License. See License.txt in the project root for license information. | ||
*--------------------------------------------------------------------------------------------*/ | ||
|
||
import { WorkspaceFolder, WorkspaceFolderPickOptions, l10n, window } from "vscode"; | ||
import { UserCancelledError } from "../errors"; | ||
|
||
export async function showWorkspaceFolderPick(options?: WorkspaceFolderPickOptions): Promise<WorkspaceFolder> { | ||
const folder: WorkspaceFolder | undefined = await window.showWorkspaceFolderPick({ | ||
...options, | ||
placeHolder: options?.placeHolder ?? l10n.t('Select a root workspace folder') | ||
}); | ||
|
||
if (!folder) { | ||
throw new UserCancelledError('selectRootWorkspaceFolder'); | ||
} | ||
|
||
return folder; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters