Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
ba6aa48b
V
vscode
项目概览
xxadev
/
vscode
与 Fork 源项目一致
从无法访问的项目Fork
通知
2
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
V
vscode
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
ba6aa48b
编写于
6月 25, 2018
作者:
C
Christof Marti
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Documentation (#49340)
上级
db638418
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
187 addition
and
2 deletion
+187
-2
src/vs/vscode.proposed.d.ts
src/vs/vscode.proposed.d.ts
+185
-0
src/vs/workbench/browser/parts/quickinput/quickInput.ts
src/vs/workbench/browser/parts/quickinput/quickInput.ts
+2
-2
未找到文件。
src/vs/vscode.proposed.d.ts
浏览文件 @
ba6aa48b
...
...
@@ -523,90 +523,275 @@ declare module 'vscode' {
export
namespace
window
{
/**
* A back button for [QuickPick](#QuickPick) and [InputBox](#InputBox).
*
* When a navigation 'back' button is needed this one should be used for consistency.
* It comes with a predefined icon, tooltip and location.
*/
export
const
quickInputBackButton
:
QuickInputButton
;
/**
* Creates a [QuickPick](#QuickPick) to let the user pick an item from a list
* of items of type T.
*
* Note that in many cases the more convenient [window.showQuickPick](#window.showQuickPick)
* is easier to use.
*
* @return A new [QuickPick](#QuickPick).
*/
export
function
createQuickPick
<
T
extends
QuickPickItem
>
():
QuickPick
<
T
>
;
/**
* Creates a [InputBox](#InputBox) to let the user enter some text input.
*
* Note that in many cases the more convenient [window.showInputBox](#window.showInputBox)
* is easier to use.
*
* @return A new [InputBox](#InputBox).
*/
export
function
createInputBox
():
InputBox
;
}
/**
* A light-weight user input UI that is intially not visible. After
* configuring it through its properties the extension can make it
* visible by calling [QuickInput.show](#QuickInput.show).
*
* There are several reasons why this UI might have to be hidden and
* the extension will be notified through [QuickInput.onDidHide](#QuickInput.onDidHide).
* (Examples include: an explict call to [QuickInput.hide](#QuickInput.hide),
* the user pressing Esc, some other input UI opening, etc.)
*
* A user pressing Enter or some other gesture implying acceptance
* of the current state does not automatically hide this UI component.
* It is up to the extension to decide whether to accept the user's input
* and if the UI should indeed be hidden through a call to [QuickInput.hide](#QuickInput.hide).
*
* When the extension no longer needs this input UI, it should
* [QuickInput.dispose](#QuickInput.dispose) it to allow for freeing up
* any resources associated with it.
*
* See [QuickPick](#QuickPick) and [InputBox](#InputBox) for concrete UIs.
*/
export
interface
QuickInput
{
/**
* An optional title.
*/
title
:
string
|
undefined
;
/**
* An optional current step count.
*/
step
:
number
|
undefined
;
/**
* An optional total step count.
*/
totalSteps
:
number
|
undefined
;
/**
* If the UI should allow for user input. Defaults to true.
*
* Change this to false, e.g., while validating user input or
* loading data for the next step in user input.
*/
enabled
:
boolean
;
/**
* If the UI should show a progress indicator. Defaults to false.
*
* Change this to true, e.g., while loading more data or validating
* user input.
*/
busy
:
boolean
;
/**
* If the UI should stay open even when loosing UI focus. Defaults to false.
*/
ignoreFocusOut
:
boolean
;
/**
* Makes the input UI visible in its current configuration. Any other input
* UI will first fire an [QuickInput.onDidHide](#QuickInput.onDidHide) event.
*/
show
():
void
;
/**
* Hides this input UI. This will also fire an [QuickInput.onDidHide](#QuickInput.onDidHide)
* event.
*/
hide
():
void
;
/**
* An event signaling when this input UI is hidden.
*
* There are several reasons why this UI might have to be hidden and
* the extension will be notified through [QuickInput.onDidHide](#QuickInput.onDidHide).
* (Examples include: an explict call to [QuickInput.hide](#QuickInput.hide),
* the user pressing Esc, some other input UI opening, etc.)
*/
onDidHide
:
Event
<
void
>
;
/**
* Dispose of this input UI and any associated resources. If it is still
* visible, it is first hidden. After this call the input UI is no longer
* functional and no additional methods or properties on it should be
* accessed. Instead a new input UI should be created.
*/
dispose
():
void
;
}
/**
* A concrete [QuickInput](#QuickInput) to let the user pick an item from a
* list of items of type T. The items can be filtered through a filter text field and
* there is an option [canSelectMany](#QuickPick.canSelectMany) to allow for
* selecting multiple items.
*
* Note that in many cases the more convenient [window.showQuickPick](#window.showQuickPick)
* is easier to use.
*/
export
interface
QuickPick
<
T
extends
QuickPickItem
>
extends
QuickInput
{
/**
* Current value of the filter text.
*/
value
:
string
;
/**
* Optional placeholder in the filter text.
*/
placeholder
:
string
|
undefined
;
/**
* An event signaling when the value of the filter text has changed.
*/
readonly
onDidChangeValue
:
Event
<
string
>
;
/**
* An event signaling when the user indicated acceptance of the selected item(s).
*/
readonly
onDidAccept
:
Event
<
void
>
;
/**
* Buttons for actions in the UI.
*/
buttons
:
ReadonlyArray
<
QuickInputButton
>
;
/**
* An event signaling when a button was triggered.
*/
readonly
onDidTriggerButton
:
Event
<
QuickInputButton
>
;
/**
* Items to pick from.
*/
items
:
ReadonlyArray
<
T
>
;
/**
* If multiple items can be selected at the same time. Defaults to false.
*/
canSelectMany
:
boolean
;
/**
* If the filter text should also be matched against the description of the items. Defaults to false.
*/
matchOnDescription
:
boolean
;
/**
* If the filter text should also be matched against the detail of the items. Defaults to false.
*/
matchOnDetail
:
boolean
;
/**
* Active items. This can be read and updated by the extension.
*/
activeItems
:
ReadonlyArray
<
T
>
;
/**
* An event signaling when the active items have changed.
*/
readonly
onDidChangeActive
:
Event
<
T
[]
>
;
/**
* Selected items. This can be read and updated by the extension.
*/
selectedItems
:
ReadonlyArray
<
T
>
;
/**
* An event signaling when the selected items have changed.
*/
readonly
onDidChangeSelection
:
Event
<
T
[]
>
;
}
/**
* A concrete [QuickInput](#QuickInput) to let the user input a text value.
*
* Note that in many cases the more convenient [window.showInputBox](#window.showInputBox)
* is easier to use.
*/
export
interface
InputBox
extends
QuickInput
{
/**
* Current input value.
*/
value
:
string
;
/**
* Optional placeholder in the filter text.
*/
placeholder
:
string
|
undefined
;
/**
* If the input value should be hidden. Defaults to false.
*/
password
:
boolean
;
/**
* An event signaling when the value has changed.
*/
readonly
onDidChangeValue
:
Event
<
string
>
;
/**
* An event signaling when the user indicated acceptance of the input value.
*/
readonly
onDidAccept
:
Event
<
void
>
;
/**
* Buttons for actions in the UI.
*/
buttons
:
ReadonlyArray
<
QuickInputButton
>
;
/**
* An event signaling when a button was triggered.
*/
readonly
onDidTriggerButton
:
Event
<
QuickInputButton
>
;
/**
* An optional prompt text providing some ask or explanation to the user.
*/
prompt
:
string
|
undefined
;
/**
* An optional validation message indicating a problem with the current input value.
*/
validationMessage
:
string
|
undefined
;
}
/**
* Button for an action in a [QuickPick](#QuickPick) or [InputBox](#InputBox).
*/
export
interface
QuickInputButton
{
/**
* Icon for the button.
*/
readonly
iconPath
:
string
|
Uri
|
{
light
:
string
|
Uri
;
dark
:
string
|
Uri
}
|
ThemeIcon
;
/**
* An optional tooltip.
*/
readonly
tooltip
?:
string
|
undefined
;
}
...
...
src/vs/workbench/browser/parts/quickinput/quickInput.ts
浏览文件 @
ba6aa48b
...
...
@@ -285,8 +285,8 @@ class QuickPick<T extends IQuickPickItem> extends QuickInput implements IQuickPi
private
_items
:
T
[]
=
[];
private
itemsUpdated
=
false
;
private
_canSelectMany
=
false
;
private
_matchOnDescription
=
tru
e
;
private
_matchOnDetail
=
tru
e
;
private
_matchOnDescription
=
fals
e
;
private
_matchOnDetail
=
fals
e
;
private
_activeItems
:
T
[]
=
[];
private
activeItemsUpdated
=
false
;
private
onDidChangeActiveEmitter
=
new
Emitter
<
T
[]
>
();
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录