Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
cb0af822
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,发现更多精彩内容 >>
提交
cb0af822
编写于
11月 15, 2018
作者:
P
pkoushik
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix-62365 : Added useGlobalStorageForSuggestions Setting
上级
aa4ef3a4
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
28 addition
and
9 deletion
+28
-9
src/vs/editor/common/config/commonEditorConfig.ts
src/vs/editor/common/config/commonEditorConfig.ts
+5
-0
src/vs/editor/common/config/editorOptions.ts
src/vs/editor/common/config/editorOptions.ts
+11
-2
src/vs/editor/contrib/suggest/suggestMemory.ts
src/vs/editor/contrib/suggest/suggestMemory.ts
+4
-4
src/vs/editor/contrib/suggest/test/completionModel.test.ts
src/vs/editor/contrib/suggest/test/completionModel.test.ts
+3
-3
src/vs/monaco.d.ts
src/vs/monaco.d.ts
+5
-0
未找到文件。
src/vs/editor/common/config/commonEditorConfig.ts
浏览文件 @
cb0af822
...
...
@@ -639,6 +639,11 @@ const editorConfiguration: IConfigurationNode = {
default
:
false
,
description
:
nls
.
localize
(
'
suggest.localityBonus
'
,
"
Controls whether sorting favours words that appear close to the cursor.
"
)
},
'
editor.suggest.useGlobalStorageForSuggestions
'
:
{
type
:
'
boolean
'
,
default
:
false
,
description
:
nls
.
localize
(
'
suggest.useGlobalStorageForSuggestions
'
,
"
Controls whether global storage is used for remembering suggestions.
"
)
},
'
editor.suggest.snippetsPreventQuickSuggestions
'
:
{
type
:
'
boolean
'
,
default
:
true
,
...
...
src/vs/editor/common/config/editorOptions.ts
浏览文件 @
cb0af822
...
...
@@ -194,6 +194,11 @@ export interface ISuggestOptions {
* Favours words that appear close to the cursor.
*/
localityBonus
?:
boolean
;
/**
* Enable using global storage for remembering suggestions.
*/
useGlobalStorageForSuggestions
?:
boolean
;
}
/**
...
...
@@ -900,6 +905,7 @@ export interface InternalSuggestOptions {
readonly
snippets
:
'
top
'
|
'
bottom
'
|
'
inline
'
|
'
none
'
;
readonly
snippetsPreventQuickSuggestions
:
boolean
;
readonly
localityBonus
:
boolean
;
readonly
useGlobalStorageForSuggestions
:
boolean
;
}
export
interface
InternalParameterHintOptions
{
...
...
@@ -1346,7 +1352,8 @@ export class InternalEditorOptions {
return
a
.
filterGraceful
===
b
.
filterGraceful
&&
a
.
snippets
===
b
.
snippets
&&
a
.
snippetsPreventQuickSuggestions
===
b
.
snippetsPreventQuickSuggestions
&&
a
.
localityBonus
===
b
.
localityBonus
;
&&
a
.
localityBonus
===
b
.
localityBonus
&&
a
.
useGlobalStorageForSuggestions
===
b
.
useGlobalStorageForSuggestions
;
}
}
...
...
@@ -1877,6 +1884,7 @@ export class EditorOptionsValidator {
snippets
:
_stringSet
<
'
top
'
|
'
bottom
'
|
'
inline
'
|
'
none
'
>
(
opts
.
snippetSuggestions
,
defaults
.
snippets
,
[
'
top
'
,
'
bottom
'
,
'
inline
'
,
'
none
'
]),
snippetsPreventQuickSuggestions
:
_boolean
(
suggestOpts
.
snippetsPreventQuickSuggestions
,
defaults
.
filterGraceful
),
localityBonus
:
_boolean
(
suggestOpts
.
localityBonus
,
defaults
.
localityBonus
),
useGlobalStorageForSuggestions
:
_boolean
(
suggestOpts
.
useGlobalStorageForSuggestions
,
defaults
.
useGlobalStorageForSuggestions
)
};
}
...
...
@@ -2625,7 +2633,8 @@ export const EDITOR_DEFAULTS: IValidatedEditorOptions = {
filterGraceful
:
true
,
snippets
:
'
inline
'
,
snippetsPreventQuickSuggestions
:
true
,
localityBonus
:
false
localityBonus
:
false
,
useGlobalStorageForSuggestions
:
false
},
selectionHighlight
:
true
,
occurrencesHighlight
:
true
,
...
...
src/vs/editor/contrib/suggest/suggestMemory.ts
浏览文件 @
cb0af822
...
...
@@ -206,12 +206,12 @@ export class SuggestMemories extends Disposable {
)
{
super
();
this
.
_setMode
(
editor
.
getConfiguration
().
contribInfo
.
suggestSelection
);
this
.
_register
(
editor
.
onDidChangeConfiguration
(
e
=>
e
.
contribInfo
&&
this
.
_setMode
(
editor
.
getConfiguration
().
contribInfo
.
suggestSelection
)));
this
.
_setMode
(
editor
.
getConfiguration
().
contribInfo
.
suggestSelection
,
editor
.
getConfiguration
().
contribInfo
.
suggest
.
useGlobalStorageForSuggestions
);
this
.
_register
(
editor
.
onDidChangeConfiguration
(
e
=>
e
.
contribInfo
&&
this
.
_setMode
(
editor
.
getConfiguration
().
contribInfo
.
suggestSelection
,
editor
.
getConfiguration
().
contribInfo
.
suggest
.
useGlobalStorageForSuggestions
)));
this
.
_register
(
_storageService
.
onWillSaveState
(()
=>
this
.
_saveState
()));
}
private
_setMode
(
mode
:
MemMode
):
void
{
private
_setMode
(
mode
:
MemMode
,
useGlobalStorageForSuggestions
:
boolean
):
void
{
if
(
this
.
_mode
===
mode
)
{
return
;
}
...
...
@@ -219,7 +219,7 @@ export class SuggestMemories extends Disposable {
this
.
_strategy
=
mode
===
'
recentlyUsedByPrefix
'
?
new
PrefixMemory
()
:
mode
===
'
recentlyUsed
'
?
new
LRUMemory
()
:
new
NoMemory
();
try
{
const
raw
=
this
.
_storageService
.
get
(
`
${
this
.
_storagePrefix
}
/
${
this
.
_mode
}
`
,
StorageScope
.
WORKSPACE
);
const
raw
=
useGlobalStorageForSuggestions
?
this
.
_storageService
.
get
(
`
${
this
.
_storagePrefix
}
/
${
this
.
_mode
}
`
,
StorageScope
.
GLOBAL
)
:
this
.
_storageService
.
get
(
`
${
this
.
_storagePrefix
}
/
${
this
.
_mode
}
`
,
StorageScope
.
WORKSPACE
);
if
(
raw
)
{
this
.
_strategy
.
fromJSON
(
JSON
.
parse
(
raw
));
}
...
...
src/vs/editor/contrib/suggest/test/completionModel.test.ts
浏览文件 @
cb0af822
...
...
@@ -165,7 +165,7 @@ suite('CompletionModel', function () {
],
1
,
{
leadingLineContent
:
'
s
'
,
characterCountDelta
:
0
},
WordDistance
.
None
,
{
snippets
:
'
top
'
,
snippetsPreventQuickSuggestions
:
true
,
filterGraceful
:
true
,
localityBonus
:
false
});
},
WordDistance
.
None
,
{
snippets
:
'
top
'
,
snippetsPreventQuickSuggestions
:
true
,
filterGraceful
:
true
,
localityBonus
:
false
,
useGlobalStorageForSuggestions
:
false
});
assert
.
equal
(
model
.
items
.
length
,
2
);
const
[
a
,
b
]
=
model
.
items
;
...
...
@@ -184,7 +184,7 @@ suite('CompletionModel', function () {
],
1
,
{
leadingLineContent
:
'
s
'
,
characterCountDelta
:
0
},
WordDistance
.
None
,
{
snippets
:
'
bottom
'
,
snippetsPreventQuickSuggestions
:
true
,
filterGraceful
:
true
,
localityBonus
:
false
});
},
WordDistance
.
None
,
{
snippets
:
'
bottom
'
,
snippetsPreventQuickSuggestions
:
true
,
filterGraceful
:
true
,
localityBonus
:
false
,
useGlobalStorageForSuggestions
:
false
});
assert
.
equal
(
model
.
items
.
length
,
2
);
const
[
a
,
b
]
=
model
.
items
;
...
...
@@ -202,7 +202,7 @@ suite('CompletionModel', function () {
],
1
,
{
leadingLineContent
:
'
s
'
,
characterCountDelta
:
0
},
WordDistance
.
None
,
{
snippets
:
'
inline
'
,
snippetsPreventQuickSuggestions
:
true
,
filterGraceful
:
true
,
localityBonus
:
false
});
},
WordDistance
.
None
,
{
snippets
:
'
inline
'
,
snippetsPreventQuickSuggestions
:
true
,
filterGraceful
:
true
,
localityBonus
:
false
,
useGlobalStorageForSuggestions
:
false
});
assert
.
equal
(
model
.
items
.
length
,
2
);
const
[
a
,
b
]
=
model
.
items
;
...
...
src/vs/monaco.d.ts
浏览文件 @
cb0af822
...
...
@@ -2558,6 +2558,10 @@ declare namespace monaco.editor {
* Favours words that appear close to the cursor.
*/
localityBonus
?:
boolean
;
/**
* Enable using global storage for remembering suggestions.
*/
useGlobalStorageForSuggestions
?:
boolean
;
}
/**
...
...
@@ -3193,6 +3197,7 @@ declare namespace monaco.editor {
readonly
snippets
:
'
top
'
|
'
bottom
'
|
'
inline
'
|
'
none
'
;
readonly
snippetsPreventQuickSuggestions
:
boolean
;
readonly
localityBonus
:
boolean
;
readonly
useGlobalStorageForSuggestions
:
boolean
;
}
export
interface
InternalParameterHintOptions
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录