Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
62e0f34a
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,发现更多精彩内容 >>
提交
62e0f34a
编写于
6月 18, 2018
作者:
J
Johannes Rieken
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
add CompletionItem#preselect, #35551
上级
5bde5c11
变更
6
显示空白变更内容
内联
并排
Showing
6 changed file
with
19 addition
and
9 deletion
+19
-9
src/vs/editor/common/modes.ts
src/vs/editor/common/modes.ts
+1
-1
src/vs/editor/contrib/suggest/suggestMemory.ts
src/vs/editor/contrib/suggest/suggestMemory.ts
+1
-1
src/vs/editor/contrib/suggest/test/suggestMemory.test.ts
src/vs/editor/contrib/suggest/test/suggestMemory.test.ts
+6
-6
src/vs/vscode.d.ts
src/vs/vscode.d.ts
+7
-0
src/vs/workbench/api/node/extHostLanguageFeatures.ts
src/vs/workbench/api/node/extHostLanguageFeatures.ts
+1
-0
src/vs/workbench/api/node/extHostTypes.ts
src/vs/workbench/api/node/extHostTypes.ts
+3
-1
未找到文件。
src/vs/editor/common/modes.ts
浏览文件 @
62e0f34a
...
...
@@ -293,7 +293,7 @@ export interface ISuggestion {
documentation
?:
string
|
IMarkdownString
;
filterText
?:
string
;
sortText
?:
string
;
autoS
elect
?:
boolean
;
pres
elect
?:
boolean
;
noAutoAccept
?:
boolean
;
commitCharacters
?:
string
[];
overwriteBefore
?:
number
;
...
...
src/vs/editor/contrib/suggest/suggestMemory.ts
浏览文件 @
62e0f34a
...
...
@@ -24,7 +24,7 @@ export abstract class Memory {
// stop when leaving the group of top matches
break
;
}
if
(
suggestion
.
autoS
elect
)
{
if
(
suggestion
.
pres
elect
)
{
// stop when seeing an auto-select-item
return
i
;
}
...
...
src/vs/editor/contrib/suggest/test/suggestMemory.test.ts
浏览文件 @
62e0f34a
...
...
@@ -45,9 +45,9 @@ suite('SuggestMemories', function () {
let
item2
=
createSuggestItem
(
'
bazz
'
,
0
);
let
item3
=
createSuggestItem
(
'
bazz
'
,
0
);
let
item4
=
createSuggestItem
(
'
bazz
'
,
0
);
item1
.
suggestion
.
autoS
elect
=
false
;
item2
.
suggestion
.
autoS
elect
=
true
;
item3
.
suggestion
.
autoS
elect
=
true
;
item1
.
suggestion
.
pres
elect
=
false
;
item2
.
suggestion
.
pres
elect
=
true
;
item3
.
suggestion
.
pres
elect
=
true
;
assert
.
equal
(
mem
.
select
(
buffer
,
pos
,
[
item1
,
item2
,
item3
,
item4
]),
1
);
});
...
...
@@ -57,9 +57,9 @@ suite('SuggestMemories', function () {
let
item2
=
createSuggestItem
(
'
bazz
'
,
0
);
let
item3
=
createSuggestItem
(
'
bazz
'
,
0
);
let
item4
=
createSuggestItem
(
'
bazz
'
,
0
);
item1
.
suggestion
.
autoS
elect
=
false
;
item2
.
suggestion
.
autoS
elect
=
true
;
item3
.
suggestion
.
autoS
elect
=
true
;
item1
.
suggestion
.
pres
elect
=
false
;
item2
.
suggestion
.
pres
elect
=
true
;
item3
.
suggestion
.
pres
elect
=
true
;
let
items
=
[
item1
,
item2
,
item3
,
item4
];
...
...
src/vs/vscode.d.ts
浏览文件 @
62e0f34a
...
...
@@ -3105,6 +3105,13 @@ declare module 'vscode' {
*/
filterText
?:
string
;
/**
* Select this item when showing. *Note* that only one completion item can be selected and
* that the editor decides which item that is. The rule is that the *first* item of those
* that match best is selected.
*/
preselect
?:
boolean
;
/**
* A string or snippet that should be inserted in a document when selecting
* this completion. When `falsy` the [label](#CompletionItem.label)
...
...
src/vs/workbench/api/node/extHostLanguageFeatures.ts
浏览文件 @
62e0f34a
...
...
@@ -662,6 +662,7 @@ class SuggestAdapter {
documentation
:
item
.
documentation
,
filterText
:
item
.
filterText
,
sortText
:
item
.
sortText
,
preselect
:
item
.
preselect
,
//
insertText
:
undefined
,
additionalTextEdits
:
item
.
additionalTextEdits
&&
item
.
additionalTextEdits
.
map
(
typeConvert
.
TextEdit
.
from
),
...
...
src/vs/workbench/api/node/extHostTypes.ts
浏览文件 @
62e0f34a
...
...
@@ -1073,7 +1073,7 @@ export enum CompletionItemKind {
TypeParameter
=
24
}
export
class
CompletionItem
{
export
class
CompletionItem
implements
vscode
.
CompletionItem
{
label
:
string
;
kind
:
CompletionItemKind
;
...
...
@@ -1081,6 +1081,7 @@ export class CompletionItem {
documentation
:
string
|
MarkdownString
;
sortText
:
string
;
filterText
:
string
;
preselect
:
boolean
;
insertText
:
string
|
SnippetString
;
range
:
Range
;
textEdit
:
TextEdit
;
...
...
@@ -1100,6 +1101,7 @@ export class CompletionItem {
documentation
:
this
.
documentation
,
sortText
:
this
.
sortText
,
filterText
:
this
.
filterText
,
preselect
:
this
.
preselect
,
insertText
:
this
.
insertText
,
textEdit
:
this
.
textEdit
};
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录