Skip to content

Commit

Permalink
Sample for quick pick hide API.
Browse files Browse the repository at this point in the history
Signed-off-by: Akos Kitta <kittaakos@typefox.io>
  • Loading branch information
Akos Kitta committed Jul 23, 2019
1 parent dec5333 commit 7f1230c
Show file tree
Hide file tree
Showing 8 changed files with 420 additions and 0 deletions.
3 changes: 3 additions & 0 deletions quick-pick-hide/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
out
node_modules
*.vsix
3 changes: 3 additions & 0 deletions quick-pick-hide/.theia/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"typescript.tsdk": "node_modules/typescript/lib"
}
6 changes: 6 additions & 0 deletions quick-pick-hide/.vscodeignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
.vscode/**
out/**/*.map
src/**
.gitignore
tsconfig.json
tslint.json
323 changes: 323 additions & 0 deletions quick-pick-hide/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

37 changes: 37 additions & 0 deletions quick-pick-hide/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
{
"name": "quick-pick-hide",
"displayName": "Complete Quick Pick API",
"description": "See: https://github.com/theia-ide/theia/pull/5766",
"version": "0.0.1",
"publisher": "vscode-samples",
"engines": {
"vscode": "^1.32.0"
},
"categories": [
"Other"
],
"activationEvents": [
"*"
],
"main": "./out/extension.js",
"contributes": {
"commands": [
{
"command": "quick.pick.hide.api",
"title": "Sample: complete QuickPick hide API"
}
]
},
"scripts": {
"vscode:prepublish": "npm run compile",
"compile": "tsc -p ./",
"lint": "tslint -p ./",
"watch": "tsc -watch -p ./"
},
"devDependencies": {
"@types/node": "10.3.6",
"tslint": "^5.16.0",
"typescript": "^3.5.1",
"@types/vscode": "^1.32.0"
}
}
19 changes: 19 additions & 0 deletions quick-pick-hide/src/extension.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import * as vscode from 'vscode';

export function activate(context: vscode.ExtensionContext) {
const disposable = vscode.commands.registerCommand('quick.pick.hide.api', () => {
const quickOpen = vscode.window.createQuickPick();

quickOpen.items = [
{ label: 'A' }, { label: 'B' }
];

quickOpen.show();

setTimeout(() => {
quickOpen.hide();
}, 2000);
});

context.subscriptions.push(disposable);
}
Loading

0 comments on commit 7f1230c

Please sign in to comment.