forked from microsoft/vscode-docker
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add tests for 'configure' (Add docker files to workspace) (microsoft#303
) * Add tests for 'configure' * Python * Linux * work * work * Fix casing * clean-up * Remove randomness.ts, fix assert message * Update to 0.1.0-alpha * Revert "Update to 0.1.0-alpha" This reverts commit f175340. * PR comments * fix lint * fix lint * fix build * increase timeout
- Loading branch information
1 parent
c238460
commit ea78dc7
Showing
16 changed files
with
867 additions
and
100 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,4 +5,5 @@ package-lock.json | |
|
||
# Artifacts from running vscode extension tests | ||
.vscode-test | ||
testOutput | ||
.vs |
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 |
---|---|---|
|
@@ -4,3 +4,5 @@ typings/** | |
**/*.map | ||
.gitignore | ||
tsconfig.json | ||
test/** | ||
testOutput/** |
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 |
---|---|---|
@@ -1,42 +1,70 @@ | ||
import vscode = require('vscode'); | ||
import { IAzureQuickPickItem, IAzureUserInput } from 'vscode-azureextensionui'; | ||
import { ext } from "../extensionVariables"; | ||
|
||
export type OS = 'Windows' | 'Linux'; | ||
export type Platform = 'Go' | | ||
'Java' | | ||
'.NET Core Console' | | ||
'ASP.NET Core' | | ||
'Node.js' | | ||
'Python' | | ||
'Other'; | ||
|
||
/** | ||
* Prompts for a port number | ||
* @throws `UserCancelledError` if the user cancels. | ||
*/ | ||
export async function promptForPort(port: number): Promise<string> { | ||
let opt: vscode.InputBoxOptions = { | ||
placeHolder: `${port}`, | ||
prompt: 'What port does your app listen on?', | ||
value: `${port}` | ||
} | ||
|
||
return vscode.window.showInputBox(opt); | ||
return ext.ui.showInputBox(opt); | ||
} | ||
|
||
export async function quickPickPlatform(): Promise<string> { | ||
/** | ||
* Prompts for a platform | ||
* @throws `UserCancelledError` if the user cancels. | ||
*/ | ||
export async function quickPickPlatform(): Promise<Platform> { | ||
let opt: vscode.QuickPickOptions = { | ||
matchOnDescription: true, | ||
matchOnDetail: true, | ||
placeHolder: 'Select Application Platform' | ||
} | ||
|
||
const items: string[] = []; | ||
items.push('Go'); | ||
items.push('Java'); | ||
items.push('.NET Core Console'); | ||
items.push('ASP.NET Core'); | ||
items.push('Node.js'); | ||
items.push('Python'); | ||
items.push('Other'); | ||
const platforms: Platform[] = [ | ||
'Go', | ||
'Java', | ||
'.NET Core Console', | ||
'ASP.NET Core', | ||
'Node.js', | ||
'Python', | ||
'Other' | ||
]; | ||
|
||
return vscode.window.showQuickPick(items, opt); | ||
const items = platforms.map(p => <IAzureQuickPickItem<Platform>>{ label: p, data: p }); | ||
let response = await ext.ui.showQuickPick(items, opt); | ||
return response.data; | ||
} | ||
|
||
export async function quickPickOS(): Promise<string> { | ||
/** | ||
* Prompts for an OS | ||
* @throws `UserCancelledError` if the user cancels. | ||
*/ | ||
export async function quickPickOS(): Promise<OS> { | ||
let opt: vscode.QuickPickOptions = { | ||
matchOnDescription: true, | ||
matchOnDetail: true, | ||
placeHolder: 'Select Operating System' | ||
} | ||
|
||
const items: string[] = ['Windows', 'Linux']; | ||
const OSes: OS[] = ['Windows', 'Linux']; | ||
const items = OSes.map(p => <IAzureQuickPickItem<OS>>{ label: p, data: p }); | ||
|
||
return vscode.window.showQuickPick(items, opt); | ||
let response = await ext.ui.showQuickPick(items, opt); | ||
return response.data; | ||
} |
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
Oops, something went wrong.