Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
6b7eabb7
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,发现更多精彩内容 >>
提交
6b7eabb7
编写于
10月 26, 2020
作者:
J
Johannes Rieken
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
honor language overrides for config.editor.suggest.insertMode-setting
上级
52051132
变更
2
显示空白变更内容
内联
并排
Showing
2 changed file
with
10 addition
and
4 deletion
+10
-4
src/vs/editor/contrib/suggest/suggest.ts
src/vs/editor/contrib/suggest/suggest.ts
+1
-0
src/vs/editor/contrib/suggest/suggestController.ts
src/vs/editor/contrib/suggest/suggestController.ts
+9
-4
未找到文件。
src/vs/editor/contrib/suggest/suggest.ts
浏览文件 @
6b7eabb7
...
@@ -26,6 +26,7 @@ export const Context = {
...
@@ -26,6 +26,7 @@ export const Context = {
MakesTextEdit
:
new
RawContextKey
(
'
suggestionMakesTextEdit
'
,
true
),
MakesTextEdit
:
new
RawContextKey
(
'
suggestionMakesTextEdit
'
,
true
),
AcceptSuggestionsOnEnter
:
new
RawContextKey
<
boolean
>
(
'
acceptSuggestionOnEnter
'
,
true
),
AcceptSuggestionsOnEnter
:
new
RawContextKey
<
boolean
>
(
'
acceptSuggestionOnEnter
'
,
true
),
HasInsertAndReplaceRange
:
new
RawContextKey
(
'
suggestionHasInsertAndReplaceRange
'
,
false
),
HasInsertAndReplaceRange
:
new
RawContextKey
(
'
suggestionHasInsertAndReplaceRange
'
,
false
),
InsertMode
:
new
RawContextKey
<
'
insert
'
|
'
replace
'
>
(
'
suggestionInsertMode
'
,
undefined
),
CanResolve
:
new
RawContextKey
(
'
suggestionCanResolve
'
,
false
),
CanResolve
:
new
RawContextKey
(
'
suggestionCanResolve
'
,
false
),
};
};
...
...
src/vs/editor/contrib/suggest/suggestController.ts
浏览文件 @
6b7eabb7
...
@@ -124,6 +124,11 @@ export class SuggestController implements IEditorContribution {
...
@@ -124,6 +124,11 @@ export class SuggestController implements IEditorContribution {
this
.
editor
=
editor
;
this
.
editor
=
editor
;
this
.
model
=
_instantiationService
.
createInstance
(
SuggestModel
,
this
.
editor
,);
this
.
model
=
_instantiationService
.
createInstance
(
SuggestModel
,
this
.
editor
,);
// context key: update insert/replace mode
const
ctxInsertMode
=
SuggestContext
.
InsertMode
.
bindTo
(
_contextKeyService
);
ctxInsertMode
.
set
(
editor
.
getOption
(
EditorOption
.
suggest
).
insertMode
);
this
.
model
.
onDidTrigger
(()
=>
ctxInsertMode
.
set
(
editor
.
getOption
(
EditorOption
.
suggest
).
insertMode
));
this
.
widget
=
this
.
_toDispose
.
add
(
new
IdleValue
(()
=>
{
this
.
widget
=
this
.
_toDispose
.
add
(
new
IdleValue
(()
=>
{
const
widget
=
this
.
_instantiationService
.
createInstance
(
SuggestWidget
,
this
.
editor
);
const
widget
=
this
.
_instantiationService
.
createInstance
(
SuggestWidget
,
this
.
editor
);
...
@@ -654,13 +659,13 @@ MenuRegistry.appendMenuItem(suggestWidgetStatusbarMenu, {
...
@@ -654,13 +659,13 @@ MenuRegistry.appendMenuItem(suggestWidgetStatusbarMenu, {
command
:
{
id
:
'
acceptSelectedSuggestion
'
,
title
:
nls
.
localize
(
'
accept.insert
'
,
"
Insert
"
)
},
command
:
{
id
:
'
acceptSelectedSuggestion
'
,
title
:
nls
.
localize
(
'
accept.insert
'
,
"
Insert
"
)
},
group
:
'
left
'
,
group
:
'
left
'
,
order
:
1
,
order
:
1
,
when
:
ContextKeyExpr
.
and
(
SuggestContext
.
HasInsertAndReplaceRange
,
ContextKeyExpr
.
equals
(
'
config.editor.suggest.insertMode
'
,
'
insert
'
))
when
:
ContextKeyExpr
.
and
(
SuggestContext
.
HasInsertAndReplaceRange
,
SuggestContext
.
InsertMode
.
isEqualTo
(
'
insert
'
))
});
});
MenuRegistry
.
appendMenuItem
(
suggestWidgetStatusbarMenu
,
{
MenuRegistry
.
appendMenuItem
(
suggestWidgetStatusbarMenu
,
{
command
:
{
id
:
'
acceptSelectedSuggestion
'
,
title
:
nls
.
localize
(
'
accept.replace
'
,
"
Replace
"
)
},
command
:
{
id
:
'
acceptSelectedSuggestion
'
,
title
:
nls
.
localize
(
'
accept.replace
'
,
"
Replace
"
)
},
group
:
'
left
'
,
group
:
'
left
'
,
order
:
1
,
order
:
1
,
when
:
ContextKeyExpr
.
and
(
SuggestContext
.
HasInsertAndReplaceRange
,
ContextKeyExpr
.
equals
(
'
config.editor.suggest.insertMode
'
,
'
replace
'
))
when
:
ContextKeyExpr
.
and
(
SuggestContext
.
HasInsertAndReplaceRange
,
SuggestContext
.
InsertMode
.
isEqualTo
(
'
replace
'
))
});
});
registerEditorCommand
(
new
SuggestCommand
({
registerEditorCommand
(
new
SuggestCommand
({
...
@@ -679,13 +684,13 @@ registerEditorCommand(new SuggestCommand({
...
@@ -679,13 +684,13 @@ registerEditorCommand(new SuggestCommand({
menuId
:
suggestWidgetStatusbarMenu
,
menuId
:
suggestWidgetStatusbarMenu
,
group
:
'
left
'
,
group
:
'
left
'
,
order
:
2
,
order
:
2
,
when
:
ContextKeyExpr
.
and
(
SuggestContext
.
HasInsertAndReplaceRange
,
ContextKeyExpr
.
equals
(
'
config.editor.suggest.insertMode
'
,
'
insert
'
)),
when
:
ContextKeyExpr
.
and
(
SuggestContext
.
HasInsertAndReplaceRange
,
SuggestContext
.
InsertMode
.
isEqualTo
(
'
insert
'
)),
title
:
nls
.
localize
(
'
accept.replace
'
,
"
Replace
"
)
title
:
nls
.
localize
(
'
accept.replace
'
,
"
Replace
"
)
},
{
},
{
menuId
:
suggestWidgetStatusbarMenu
,
menuId
:
suggestWidgetStatusbarMenu
,
group
:
'
left
'
,
group
:
'
left
'
,
order
:
2
,
order
:
2
,
when
:
ContextKeyExpr
.
and
(
SuggestContext
.
HasInsertAndReplaceRange
,
ContextKeyExpr
.
equals
(
'
config.editor.suggest.insertMode
'
,
'
replace
'
)),
when
:
ContextKeyExpr
.
and
(
SuggestContext
.
HasInsertAndReplaceRange
,
SuggestContext
.
InsertMode
.
isEqualTo
(
'
replace
'
)),
title
:
nls
.
localize
(
'
accept.insert
'
,
"
Insert
"
)
title
:
nls
.
localize
(
'
accept.insert
'
,
"
Insert
"
)
}]
}]
}));
}));
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录