Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
7a8040ad
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,发现更多精彩内容 >>
提交
7a8040ad
编写于
7月 02, 2018
作者:
J
Johannes Rieken
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
move snippet-suggest option to new internal model, #42750
上级
1ea92bed
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
27 addition
and
30 deletion
+27
-30
src/vs/editor/common/config/commonEditorConfig.ts
src/vs/editor/common/config/commonEditorConfig.ts
+1
-1
src/vs/editor/common/config/editorOptions.ts
src/vs/editor/common/config/editorOptions.ts
+10
-12
src/vs/editor/contrib/suggest/completionModel.ts
src/vs/editor/contrib/suggest/completionModel.ts
+6
-6
src/vs/editor/contrib/suggest/suggestModel.ts
src/vs/editor/contrib/suggest/suggestModel.ts
+3
-4
src/vs/editor/contrib/suggest/test/completionModel.test.ts
src/vs/editor/contrib/suggest/test/completionModel.test.ts
+6
-6
src/vs/monaco.d.ts
src/vs/monaco.d.ts
+1
-1
未找到文件。
src/vs/editor/common/config/commonEditorConfig.ts
浏览文件 @
7a8040ad
...
@@ -532,7 +532,7 @@ const editorConfiguration: IConfigurationNode = {
...
@@ -532,7 +532,7 @@ const editorConfiguration: IConfigurationNode = {
nls
.
localize
(
'
snippetSuggestions.inline
'
,
"
Show snippets suggestions with other suggestions.
"
),
nls
.
localize
(
'
snippetSuggestions.inline
'
,
"
Show snippets suggestions with other suggestions.
"
),
nls
.
localize
(
'
snippetSuggestions.none
'
,
"
Do not show snippet suggestions.
"
),
nls
.
localize
(
'
snippetSuggestions.none
'
,
"
Do not show snippet suggestions.
"
),
],
],
'
default
'
:
EDITOR_DEFAULTS
.
contribInfo
.
s
nippetSuggestion
s
,
'
default
'
:
EDITOR_DEFAULTS
.
contribInfo
.
s
uggest
.
snippet
s
,
'
description
'
:
nls
.
localize
(
'
snippetSuggestions
'
,
"
Controls whether snippets are shown with other suggestions and how they are sorted.
"
)
'
description
'
:
nls
.
localize
(
'
snippetSuggestions
'
,
"
Controls whether snippets are shown with other suggestions and how they are sorted.
"
)
},
},
'
editor.emptySelectionClipboard
'
:
{
'
editor.emptySelectionClipboard
'
:
{
...
...
src/vs/editor/common/config/editorOptions.ts
浏览文件 @
7a8040ad
...
@@ -843,6 +843,7 @@ export interface InternalEditorHoverOptions {
...
@@ -843,6 +843,7 @@ export interface InternalEditorHoverOptions {
export
interface
InternalSuggestOptions
{
export
interface
InternalSuggestOptions
{
readonly
filterGraceful
:
boolean
;
readonly
filterGraceful
:
boolean
;
readonly
snippets
:
'
top
'
|
'
bottom
'
|
'
inline
'
|
'
none
'
;
}
}
export
interface
EditorWrappingInfo
{
export
interface
EditorWrappingInfo
{
...
@@ -912,7 +913,7 @@ export interface EditorContribOptions {
...
@@ -912,7 +913,7 @@ export interface EditorContribOptions {
readonly
suggestOnTriggerCharacters
:
boolean
;
readonly
suggestOnTriggerCharacters
:
boolean
;
readonly
acceptSuggestionOnEnter
:
'
on
'
|
'
smart
'
|
'
off
'
;
readonly
acceptSuggestionOnEnter
:
'
on
'
|
'
smart
'
|
'
off
'
;
readonly
acceptSuggestionOnCommitCharacter
:
boolean
;
readonly
acceptSuggestionOnCommitCharacter
:
boolean
;
readonly
snippetSuggestions
:
'
top
'
|
'
bottom
'
|
'
inline
'
|
'
none
'
;
//
readonly snippetSuggestions: 'top' | 'bottom' | 'inline' | 'none';
readonly
wordBasedSuggestions
:
boolean
;
readonly
wordBasedSuggestions
:
boolean
;
readonly
suggestSelection
:
'
first
'
|
'
recentlyUsed
'
|
'
recentlyUsedByPrefix
'
;
readonly
suggestSelection
:
'
first
'
|
'
recentlyUsed
'
|
'
recentlyUsedByPrefix
'
;
readonly
suggestFontSize
:
number
;
readonly
suggestFontSize
:
number
;
...
@@ -1245,13 +1246,13 @@ export class InternalEditorOptions {
...
@@ -1245,13 +1246,13 @@ export class InternalEditorOptions {
/**
/**
* @internal
* @internal
*/
*/
private
static
_equalsSuggestOptions
(
a
:
I
SuggestOptions
,
b
:
I
SuggestOptions
):
any
{
private
static
_equalsSuggestOptions
(
a
:
I
nternalSuggestOptions
,
b
:
Internal
SuggestOptions
):
any
{
if
(
a
===
b
)
{
if
(
a
===
b
)
{
return
true
;
return
true
;
}
else
if
(
!
a
||
!
b
)
{
}
else
if
(
!
a
||
!
b
)
{
return
false
;
return
false
;
}
else
{
}
else
{
return
a
.
filterGraceful
===
b
.
filterGraceful
;
return
a
.
filterGraceful
===
b
.
filterGraceful
&&
a
.
snippets
===
b
.
snippets
;
}
}
}
}
...
@@ -1290,7 +1291,6 @@ export class InternalEditorOptions {
...
@@ -1290,7 +1291,6 @@ export class InternalEditorOptions {
&&
a
.
suggestOnTriggerCharacters
===
b
.
suggestOnTriggerCharacters
&&
a
.
suggestOnTriggerCharacters
===
b
.
suggestOnTriggerCharacters
&&
a
.
acceptSuggestionOnEnter
===
b
.
acceptSuggestionOnEnter
&&
a
.
acceptSuggestionOnEnter
===
b
.
acceptSuggestionOnEnter
&&
a
.
acceptSuggestionOnCommitCharacter
===
b
.
acceptSuggestionOnCommitCharacter
&&
a
.
acceptSuggestionOnCommitCharacter
===
b
.
acceptSuggestionOnCommitCharacter
&&
a
.
snippetSuggestions
===
b
.
snippetSuggestions
&&
a
.
wordBasedSuggestions
===
b
.
wordBasedSuggestions
&&
a
.
wordBasedSuggestions
===
b
.
wordBasedSuggestions
&&
a
.
suggestSelection
===
b
.
suggestSelection
&&
a
.
suggestSelection
===
b
.
suggestSelection
&&
a
.
suggestFontSize
===
b
.
suggestFontSize
&&
a
.
suggestFontSize
===
b
.
suggestFontSize
...
@@ -1744,13 +1744,13 @@ export class EditorOptionsValidator {
...
@@ -1744,13 +1744,13 @@ export class EditorOptionsValidator {
};
};
}
}
private
static
_sanitizeSuggestOpts
(
opts
:
I
Suggest
Options
,
defaults
:
InternalSuggestOptions
):
InternalSuggestOptions
{
private
static
_sanitizeSuggestOpts
(
opts
:
I
Editor
Options
,
defaults
:
InternalSuggestOptions
):
InternalSuggestOptions
{
if
(
!
opts
)
{
if
(
!
opts
.
suggest
)
{
return
defaults
;
return
defaults
;
}
}
let
{
filterGraceful
}
=
opts
;
return
{
return
{
filterGraceful
:
_boolean
(
filterGraceful
,
defaults
.
filterGraceful
)
filterGraceful
:
_boolean
(
opts
.
suggest
.
filterGraceful
,
defaults
.
filterGraceful
),
snippets
:
_stringSet
<
'
top
'
|
'
bottom
'
|
'
inline
'
|
'
none
'
>
(
opts
.
snippetSuggestions
,
defaults
.
snippets
,
[
'
top
'
,
'
bottom
'
,
'
inline
'
,
'
none
'
]),
};
};
}
}
...
@@ -1885,12 +1885,11 @@ export class EditorOptionsValidator {
...
@@ -1885,12 +1885,11 @@ export class EditorOptionsValidator {
suggestOnTriggerCharacters
:
_boolean
(
opts
.
suggestOnTriggerCharacters
,
defaults
.
suggestOnTriggerCharacters
),
suggestOnTriggerCharacters
:
_boolean
(
opts
.
suggestOnTriggerCharacters
,
defaults
.
suggestOnTriggerCharacters
),
acceptSuggestionOnEnter
:
_stringSet
<
'
on
'
|
'
smart
'
|
'
off
'
>
(
opts
.
acceptSuggestionOnEnter
,
defaults
.
acceptSuggestionOnEnter
,
[
'
on
'
,
'
smart
'
,
'
off
'
]),
acceptSuggestionOnEnter
:
_stringSet
<
'
on
'
|
'
smart
'
|
'
off
'
>
(
opts
.
acceptSuggestionOnEnter
,
defaults
.
acceptSuggestionOnEnter
,
[
'
on
'
,
'
smart
'
,
'
off
'
]),
acceptSuggestionOnCommitCharacter
:
_boolean
(
opts
.
acceptSuggestionOnCommitCharacter
,
defaults
.
acceptSuggestionOnCommitCharacter
),
acceptSuggestionOnCommitCharacter
:
_boolean
(
opts
.
acceptSuggestionOnCommitCharacter
,
defaults
.
acceptSuggestionOnCommitCharacter
),
snippetSuggestions
:
_stringSet
<
'
top
'
|
'
bottom
'
|
'
inline
'
|
'
none
'
>
(
opts
.
snippetSuggestions
,
defaults
.
snippetSuggestions
,
[
'
top
'
,
'
bottom
'
,
'
inline
'
,
'
none
'
]),
wordBasedSuggestions
:
_boolean
(
opts
.
wordBasedSuggestions
,
defaults
.
wordBasedSuggestions
),
wordBasedSuggestions
:
_boolean
(
opts
.
wordBasedSuggestions
,
defaults
.
wordBasedSuggestions
),
suggestSelection
:
_stringSet
<
'
first
'
|
'
recentlyUsed
'
|
'
recentlyUsedByPrefix
'
>
(
opts
.
suggestSelection
,
defaults
.
suggestSelection
,
[
'
first
'
,
'
recentlyUsed
'
,
'
recentlyUsedByPrefix
'
]),
suggestSelection
:
_stringSet
<
'
first
'
|
'
recentlyUsed
'
|
'
recentlyUsedByPrefix
'
>
(
opts
.
suggestSelection
,
defaults
.
suggestSelection
,
[
'
first
'
,
'
recentlyUsed
'
,
'
recentlyUsedByPrefix
'
]),
suggestFontSize
:
_clampedInt
(
opts
.
suggestFontSize
,
defaults
.
suggestFontSize
,
0
,
1000
),
suggestFontSize
:
_clampedInt
(
opts
.
suggestFontSize
,
defaults
.
suggestFontSize
,
0
,
1000
),
suggestLineHeight
:
_clampedInt
(
opts
.
suggestLineHeight
,
defaults
.
suggestLineHeight
,
0
,
1000
),
suggestLineHeight
:
_clampedInt
(
opts
.
suggestLineHeight
,
defaults
.
suggestLineHeight
,
0
,
1000
),
suggest
:
this
.
_sanitizeSuggestOpts
(
opts
.
suggest
,
defaults
.
suggest
),
suggest
:
this
.
_sanitizeSuggestOpts
(
opts
,
defaults
.
suggest
),
selectionHighlight
:
_boolean
(
opts
.
selectionHighlight
,
defaults
.
selectionHighlight
),
selectionHighlight
:
_boolean
(
opts
.
selectionHighlight
,
defaults
.
selectionHighlight
),
occurrencesHighlight
:
_boolean
(
opts
.
occurrencesHighlight
,
defaults
.
occurrencesHighlight
),
occurrencesHighlight
:
_boolean
(
opts
.
occurrencesHighlight
,
defaults
.
occurrencesHighlight
),
codeLens
:
_boolean
(
opts
.
codeLens
,
defaults
.
codeLens
),
codeLens
:
_boolean
(
opts
.
codeLens
,
defaults
.
codeLens
),
...
@@ -1994,7 +1993,6 @@ export class InternalEditorOptionsFactory {
...
@@ -1994,7 +1993,6 @@ export class InternalEditorOptionsFactory {
suggestOnTriggerCharacters
:
opts
.
contribInfo
.
suggestOnTriggerCharacters
,
suggestOnTriggerCharacters
:
opts
.
contribInfo
.
suggestOnTriggerCharacters
,
acceptSuggestionOnEnter
:
opts
.
contribInfo
.
acceptSuggestionOnEnter
,
acceptSuggestionOnEnter
:
opts
.
contribInfo
.
acceptSuggestionOnEnter
,
acceptSuggestionOnCommitCharacter
:
opts
.
contribInfo
.
acceptSuggestionOnCommitCharacter
,
acceptSuggestionOnCommitCharacter
:
opts
.
contribInfo
.
acceptSuggestionOnCommitCharacter
,
snippetSuggestions
:
opts
.
contribInfo
.
snippetSuggestions
,
wordBasedSuggestions
:
opts
.
contribInfo
.
wordBasedSuggestions
,
wordBasedSuggestions
:
opts
.
contribInfo
.
wordBasedSuggestions
,
suggestSelection
:
opts
.
contribInfo
.
suggestSelection
,
suggestSelection
:
opts
.
contribInfo
.
suggestSelection
,
suggestFontSize
:
opts
.
contribInfo
.
suggestFontSize
,
suggestFontSize
:
opts
.
contribInfo
.
suggestFontSize
,
...
@@ -2466,13 +2464,13 @@ export const EDITOR_DEFAULTS: IValidatedEditorOptions = {
...
@@ -2466,13 +2464,13 @@ export const EDITOR_DEFAULTS: IValidatedEditorOptions = {
suggestOnTriggerCharacters
:
true
,
suggestOnTriggerCharacters
:
true
,
acceptSuggestionOnEnter
:
'
on
'
,
acceptSuggestionOnEnter
:
'
on
'
,
acceptSuggestionOnCommitCharacter
:
true
,
acceptSuggestionOnCommitCharacter
:
true
,
snippetSuggestions
:
'
inline
'
,
wordBasedSuggestions
:
true
,
wordBasedSuggestions
:
true
,
suggestSelection
:
'
recentlyUsed
'
,
suggestSelection
:
'
recentlyUsed
'
,
suggestFontSize
:
0
,
suggestFontSize
:
0
,
suggestLineHeight
:
0
,
suggestLineHeight
:
0
,
suggest
:
{
suggest
:
{
filterGraceful
:
true
,
filterGraceful
:
true
,
snippets
:
'
inline
'
},
},
selectionHighlight
:
true
,
selectionHighlight
:
true
,
occurrencesHighlight
:
true
,
occurrencesHighlight
:
true
,
...
...
src/vs/editor/contrib/suggest/completionModel.ts
浏览文件 @
7a8040ad
...
@@ -8,8 +8,8 @@
...
@@ -8,8 +8,8 @@
import
{
fuzzyScore
,
fuzzyScoreGracefulAggressive
,
anyScore
}
from
'
vs/base/common/filters
'
;
import
{
fuzzyScore
,
fuzzyScoreGracefulAggressive
,
anyScore
}
from
'
vs/base/common/filters
'
;
import
{
isDisposable
}
from
'
vs/base/common/lifecycle
'
;
import
{
isDisposable
}
from
'
vs/base/common/lifecycle
'
;
import
{
ISuggestResult
,
ISuggestSupport
}
from
'
vs/editor/common/modes
'
;
import
{
ISuggestResult
,
ISuggestSupport
}
from
'
vs/editor/common/modes
'
;
import
{
ISuggestionItem
,
SnippetConfig
}
from
'
./suggest
'
;
import
{
ISuggestionItem
}
from
'
./suggest
'
;
import
{
ISuggestOptions
}
from
'
vs/editor/common/config/editorOptions
'
;
import
{
I
nternal
SuggestOptions
}
from
'
vs/editor/common/config/editorOptions
'
;
export
interface
ICompletionItem
extends
ISuggestionItem
{
export
interface
ICompletionItem
extends
ISuggestionItem
{
matches
?:
number
[];
matches
?:
number
[];
...
@@ -49,7 +49,7 @@ export class CompletionModel {
...
@@ -49,7 +49,7 @@ export class CompletionModel {
private
readonly
_items
:
ICompletionItem
[];
private
readonly
_items
:
ICompletionItem
[];
private
readonly
_column
:
number
;
private
readonly
_column
:
number
;
private
readonly
_options
:
ISuggestOptions
;
private
readonly
_options
:
I
nternal
SuggestOptions
;
private
readonly
_snippetCompareFn
=
CompletionModel
.
_compareCompletionItems
;
private
readonly
_snippetCompareFn
=
CompletionModel
.
_compareCompletionItems
;
private
_lineContext
:
LineContext
;
private
_lineContext
:
LineContext
;
...
@@ -58,16 +58,16 @@ export class CompletionModel {
...
@@ -58,16 +58,16 @@ export class CompletionModel {
private
_isIncomplete
:
Set
<
ISuggestSupport
>
;
private
_isIncomplete
:
Set
<
ISuggestSupport
>
;
private
_stats
:
ICompletionStats
;
private
_stats
:
ICompletionStats
;
constructor
(
items
:
ISuggestionItem
[],
column
:
number
,
lineContext
:
LineContext
,
options
:
I
SuggestOptions
=
{
filterGraceful
:
true
},
snippetConfig
?:
SnippetConfig
)
{
constructor
(
items
:
ISuggestionItem
[],
column
:
number
,
lineContext
:
LineContext
,
options
:
I
nternalSuggestOptions
=
{
filterGraceful
:
true
,
snippets
:
'
inline
'
}
)
{
this
.
_items
=
items
;
this
.
_items
=
items
;
this
.
_column
=
column
;
this
.
_column
=
column
;
this
.
_options
=
options
;
this
.
_options
=
options
;
this
.
_refilterKind
=
Refilter
.
All
;
this
.
_refilterKind
=
Refilter
.
All
;
this
.
_lineContext
=
lineContext
;
this
.
_lineContext
=
lineContext
;
if
(
snippetConfig
===
'
top
'
)
{
if
(
options
.
snippets
===
'
top
'
)
{
this
.
_snippetCompareFn
=
CompletionModel
.
_compareCompletionItemsSnippetsUp
;
this
.
_snippetCompareFn
=
CompletionModel
.
_compareCompletionItemsSnippetsUp
;
}
else
if
(
snippetConfig
===
'
bottom
'
)
{
}
else
if
(
options
.
snippets
===
'
bottom
'
)
{
this
.
_snippetCompareFn
=
CompletionModel
.
_compareCompletionItemsSnippetsDown
;
this
.
_snippetCompareFn
=
CompletionModel
.
_compareCompletionItemsSnippetsDown
;
}
}
}
}
...
...
src/vs/editor/contrib/suggest/suggestModel.ts
浏览文件 @
7a8040ad
...
@@ -357,7 +357,7 @@ export class SuggestModel implements IDisposable {
...
@@ -357,7 +357,7 @@ export class SuggestModel implements IDisposable {
}
}
this
.
_requestPromise
=
provideSuggestionItems
(
model
,
this
.
_editor
.
getPosition
(),
this
.
_requestPromise
=
provideSuggestionItems
(
model
,
this
.
_editor
.
getPosition
(),
this
.
_editor
.
getConfiguration
().
contribInfo
.
s
nippetSuggestion
s
,
this
.
_editor
.
getConfiguration
().
contribInfo
.
s
uggest
.
snippet
s
,
onlyFrom
,
onlyFrom
,
suggestCtx
suggestCtx
).
then
(
items
=>
{
).
then
(
items
=>
{
...
@@ -372,7 +372,7 @@ export class SuggestModel implements IDisposable {
...
@@ -372,7 +372,7 @@ export class SuggestModel implements IDisposable {
}
}
if
(
!
isFalsyOrEmpty
(
existingItems
))
{
if
(
!
isFalsyOrEmpty
(
existingItems
))
{
const
cmpFn
=
getSuggestionComparator
(
this
.
_editor
.
getConfiguration
().
contribInfo
.
s
nippetSuggestion
s
);
const
cmpFn
=
getSuggestionComparator
(
this
.
_editor
.
getConfiguration
().
contribInfo
.
s
uggest
.
snippet
s
);
items
=
items
.
concat
(
existingItems
).
sort
(
cmpFn
);
items
=
items
.
concat
(
existingItems
).
sort
(
cmpFn
);
}
}
...
@@ -382,8 +382,7 @@ export class SuggestModel implements IDisposable {
...
@@ -382,8 +382,7 @@ export class SuggestModel implements IDisposable {
leadingLineContent
:
ctx
.
leadingLineContent
,
leadingLineContent
:
ctx
.
leadingLineContent
,
characterCountDelta
:
this
.
_context
?
ctx
.
column
-
this
.
_context
.
column
:
0
characterCountDelta
:
this
.
_context
?
ctx
.
column
-
this
.
_context
.
column
:
0
},
},
this
.
_editor
.
getConfiguration
().
contribInfo
.
suggest
,
this
.
_editor
.
getConfiguration
().
contribInfo
.
suggest
this
.
_editor
.
getConfiguration
().
contribInfo
.
snippetSuggestions
);
);
this
.
_onNewContext
(
ctx
);
this
.
_onNewContext
(
ctx
);
...
...
src/vs/editor/contrib/suggest/test/completionModel.test.ts
浏览文件 @
7a8040ad
...
@@ -167,7 +167,7 @@ suite('CompletionModel', function () {
...
@@ -167,7 +167,7 @@ suite('CompletionModel', function () {
],
1
,
{
],
1
,
{
leadingLineContent
:
'
s
'
,
leadingLineContent
:
'
s
'
,
characterCountDelta
:
0
characterCountDelta
:
0
},
undefined
,
'
top
'
);
},
{
snippets
:
'
top
'
,
filterGraceful
:
true
}
);
assert
.
equal
(
model
.
items
.
length
,
2
);
assert
.
equal
(
model
.
items
.
length
,
2
);
const
[
a
,
b
]
=
model
.
items
;
const
[
a
,
b
]
=
model
.
items
;
...
@@ -186,7 +186,7 @@ suite('CompletionModel', function () {
...
@@ -186,7 +186,7 @@ suite('CompletionModel', function () {
],
1
,
{
],
1
,
{
leadingLineContent
:
'
s
'
,
leadingLineContent
:
'
s
'
,
characterCountDelta
:
0
characterCountDelta
:
0
},
undefined
,
'
bottom
'
);
},
{
snippets
:
'
bottom
'
,
filterGraceful
:
true
}
);
assert
.
equal
(
model
.
items
.
length
,
2
);
assert
.
equal
(
model
.
items
.
length
,
2
);
const
[
a
,
b
]
=
model
.
items
;
const
[
a
,
b
]
=
model
.
items
;
...
@@ -204,7 +204,7 @@ suite('CompletionModel', function () {
...
@@ -204,7 +204,7 @@ suite('CompletionModel', function () {
],
1
,
{
],
1
,
{
leadingLineContent
:
'
s
'
,
leadingLineContent
:
'
s
'
,
characterCountDelta
:
0
characterCountDelta
:
0
},
undefined
,
'
inline
'
);
},
{
snippets
:
'
inline
'
,
filterGraceful
:
true
}
);
assert
.
equal
(
model
.
items
.
length
,
2
);
assert
.
equal
(
model
.
items
.
length
,
2
);
const
[
a
,
b
]
=
model
.
items
;
const
[
a
,
b
]
=
model
.
items
;
...
@@ -267,7 +267,7 @@ suite('CompletionModel', function () {
...
@@ -267,7 +267,7 @@ suite('CompletionModel', function () {
],
1
,
{
],
1
,
{
leadingLineContent
:
''
,
leadingLineContent
:
''
,
characterCountDelta
:
0
characterCountDelta
:
0
}
,
undefined
,
'
inline
'
);
});
assert
.
equal
(
model
.
items
.
length
,
5
);
assert
.
equal
(
model
.
items
.
length
,
5
);
...
@@ -294,7 +294,7 @@ suite('CompletionModel', function () {
...
@@ -294,7 +294,7 @@ suite('CompletionModel', function () {
],
1
,
{
],
1
,
{
leadingLineContent
:
''
,
leadingLineContent
:
''
,
characterCountDelta
:
0
characterCountDelta
:
0
}
,
undefined
,
'
inline
'
);
});
// query gets longer, narrow down the narrow-down'ed-set from before
// query gets longer, narrow down the narrow-down'ed-set from before
model
.
lineContext
=
{
leadingLineContent
:
'
rlut
'
,
characterCountDelta
:
4
};
model
.
lineContext
=
{
leadingLineContent
:
'
rlut
'
,
characterCountDelta
:
4
};
...
@@ -316,7 +316,7 @@ suite('CompletionModel', function () {
...
@@ -316,7 +316,7 @@ suite('CompletionModel', function () {
],
1
,
{
],
1
,
{
leadingLineContent
:
''
,
leadingLineContent
:
''
,
characterCountDelta
:
0
characterCountDelta
:
0
}
,
undefined
,
'
inline
'
);
});
model
.
lineContext
=
{
leadingLineContent
:
'
form
'
,
characterCountDelta
:
4
};
model
.
lineContext
=
{
leadingLineContent
:
'
form
'
,
characterCountDelta
:
4
};
assert
.
equal
(
model
.
items
.
length
,
5
);
assert
.
equal
(
model
.
items
.
length
,
5
);
...
...
src/vs/monaco.d.ts
浏览文件 @
7a8040ad
...
@@ -3123,6 +3123,7 @@ declare namespace monaco.editor {
...
@@ -3123,6 +3123,7 @@ declare namespace monaco.editor {
export
interface
InternalSuggestOptions
{
export
interface
InternalSuggestOptions
{
readonly
filterGraceful
:
boolean
;
readonly
filterGraceful
:
boolean
;
readonly
snippets
:
'
top
'
|
'
bottom
'
|
'
inline
'
|
'
none
'
;
}
}
export
interface
EditorWrappingInfo
{
export
interface
EditorWrappingInfo
{
...
@@ -3196,7 +3197,6 @@ declare namespace monaco.editor {
...
@@ -3196,7 +3197,6 @@ declare namespace monaco.editor {
readonly
suggestOnTriggerCharacters
:
boolean
;
readonly
suggestOnTriggerCharacters
:
boolean
;
readonly
acceptSuggestionOnEnter
:
'
on
'
|
'
smart
'
|
'
off
'
;
readonly
acceptSuggestionOnEnter
:
'
on
'
|
'
smart
'
|
'
off
'
;
readonly
acceptSuggestionOnCommitCharacter
:
boolean
;
readonly
acceptSuggestionOnCommitCharacter
:
boolean
;
readonly
snippetSuggestions
:
'
top
'
|
'
bottom
'
|
'
inline
'
|
'
none
'
;
readonly
wordBasedSuggestions
:
boolean
;
readonly
wordBasedSuggestions
:
boolean
;
readonly
suggestSelection
:
'
first
'
|
'
recentlyUsed
'
|
'
recentlyUsedByPrefix
'
;
readonly
suggestSelection
:
'
first
'
|
'
recentlyUsed
'
|
'
recentlyUsedByPrefix
'
;
readonly
suggestFontSize
:
number
;
readonly
suggestFontSize
:
number
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录