Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
掘金者说
vscode
提交
d185dd6d
V
vscode
项目概览
掘金者说
/
vscode
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
V
vscode
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
d185dd6d
编写于
8月 04, 2016
作者:
A
Alex Dima
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Share common KbExpr instances
上级
06ea27bf
变更
9
显示空白变更内容
内联
并排
Showing
9 changed file
with
47 addition
and
38 deletion
+47
-38
src/vs/editor/common/config/config.ts
src/vs/editor/common/config/config.ts
+11
-10
src/vs/editor/common/editorCommonExtensions.ts
src/vs/editor/common/editorCommonExtensions.ts
+3
-1
src/vs/editor/contrib/find/common/findController.ts
src/vs/editor/contrib/find/common/findController.ts
+4
-2
src/vs/editor/contrib/parameterHints/browser/parameterHints.ts
...s/editor/contrib/parameterHints/browser/parameterHints.ts
+4
-4
src/vs/editor/contrib/rename/browser/rename.ts
src/vs/editor/contrib/rename/browser/rename.ts
+2
-3
src/vs/editor/contrib/suggest/browser/suggest.ts
src/vs/editor/contrib/suggest/browser/suggest.ts
+9
-9
src/vs/editor/contrib/suggest/browser/tabCompletion.ts
src/vs/editor/contrib/suggest/browser/tabCompletion.ts
+7
-5
src/vs/workbench/browser/parts/editor/editorCommands.ts
src/vs/workbench/browser/parts/editor/editorCommands.ts
+3
-2
src/vs/workbench/parts/debug/browser/debugActions.ts
src/vs/workbench/parts/debug/browser/debugActions.ts
+4
-2
未找到文件。
src/vs/editor/common/config/config.ts
浏览文件 @
d185dd6d
...
...
@@ -16,6 +16,7 @@ import {ICommandHandler} from 'vs/platform/commands/common/commands';
const
H
=
editorCommon
.
Handler
;
const
D
=
editorCommon
.
CommandDescription
;
const
EditorKbExpr
=
editorCommon
.
EditorKbExpr
;
export
function
findFocusedEditor
(
commandId
:
string
,
accessor
:
ServicesAccessor
,
complain
:
boolean
):
editorCommon
.
ICommonCodeEditor
{
let
editor
=
accessor
.
get
(
ICodeEditorService
).
getFocusedCodeEditor
();
...
...
@@ -62,7 +63,7 @@ function registerCoreCommand(handlerId: string, kb: IKeybindings, weight?: numbe
id
:
handlerId
,
handler
:
triggerEditorHandler
.
bind
(
null
,
handlerId
),
weight
:
weight
?
weight
:
KeybindingsRegistry
.
WEIGHT
.
editorCore
(),
when
:
(
when
?
when
:
KbExpr
.
has
(
editorCommon
.
KEYBINDING_CONTEXT_EDITOR_TEXT_FOCUS
)
),
when
:
(
when
?
when
:
EditorKbExpr
.
TextFocus
),
primary
:
kb
.
primary
,
secondary
:
kb
.
secondary
,
win
:
kb
.
win
,
...
...
@@ -281,14 +282,14 @@ registerCoreCommand(H.CursorColumnSelectPageDown, {
registerCoreCommand
(
H
.
Tab
,
{
primary
:
KeyCode
.
Tab
},
KeybindingsRegistry
.
WEIGHT
.
editorCore
(),
KbExpr
.
and
(
KbExpr
.
has
(
editorCommon
.
KEYBINDING_CONTEXT_EDITOR_TEXT_FOCUS
)
,
KbExpr
.
not
(
editorCommon
.
KEYBINDING_CONTEXT_EDITOR_TAB_MOVES_FOCUS
)
EditorKbExpr
.
TextFocus
,
EditorKbExpr
.
TabDoesNotMoveFocus
));
registerCoreCommand
(
H
.
Outdent
,
{
primary
:
KeyMod
.
Shift
|
KeyCode
.
Tab
},
KeybindingsRegistry
.
WEIGHT
.
editorCore
(),
KbExpr
.
and
(
KbExpr
.
has
(
editorCommon
.
KEYBINDING_CONTEXT_EDITOR_TEXT_FOCUS
)
,
KbExpr
.
not
(
editorCommon
.
KEYBINDING_CONTEXT_EDITOR_TAB_MOVES_FOCUS
)
EditorKbExpr
.
TextFocus
,
EditorKbExpr
.
TabDoesNotMoveFocus
));
registerCoreCommand
(
H
.
DeleteLeft
,
{
...
...
@@ -343,15 +344,15 @@ registerCoreCommand(H.CancelSelection, {
primary
:
KeyCode
.
Escape
,
secondary
:
[
KeyMod
.
Shift
|
KeyCode
.
Escape
]
},
KeybindingsRegistry
.
WEIGHT
.
editorCore
(),
KbExpr
.
and
(
KbExpr
.
has
(
editorCommon
.
KEYBINDING_CONTEXT_EDITOR_TEXT_FOCUS
)
,
KbExpr
.
has
(
editorCommon
.
KEYBINDING_CONTEXT_EDITOR_HAS_NON_EMPTY_SELECTION
)
EditorKbExpr
.
TextFocus
,
EditorKbExpr
.
HasNonEmptySelection
));
registerCoreCommand
(
H
.
RemoveSecondaryCursors
,
{
primary
:
KeyCode
.
Escape
,
secondary
:
[
KeyMod
.
Shift
|
KeyCode
.
Escape
]
},
KeybindingsRegistry
.
WEIGHT
.
editorCore
(
1
),
KbExpr
.
and
(
KbExpr
.
has
(
editorCommon
.
KEYBINDING_CONTEXT_EDITOR_TEXT_FOCUS
)
,
KbExpr
.
has
(
editorCommon
.
KEYBINDING_CONTEXT_EDITOR_HAS_MULTIPLE_SELECTIONS
)
EditorKbExpr
.
TextFocus
,
EditorKbExpr
.
HasMultipleSelections
));
registerCoreCommand
(
H
.
CursorTop
,
{
...
...
@@ -418,6 +419,6 @@ KeybindingsRegistry.registerCommandDesc({
id
:
'
editor.action.selectAll
'
,
handler
:
selectAll
,
weight
:
KeybindingsRegistry
.
WEIGHT
.
editorCore
(),
when
:
KbExpr
.
has
(
editorCommon
.
KEYBINDING_CONTEXT_EDITOR_TEXT_FOCUS
)
,
when
:
EditorKbExpr
.
TextFocus
,
primary
:
KeyMod
.
CtrlCmd
|
KeyCode
.
KEY_A
});
src/vs/editor/common/editorCommonExtensions.ts
浏览文件 @
d185dd6d
...
...
@@ -19,6 +19,8 @@ import * as editorCommon from 'vs/editor/common/editorCommon';
import
{
IModelService
}
from
'
vs/editor/common/services/modelService
'
;
import
{
MenuId
,
MenuRegistry
}
from
'
vs/platform/actions/common/actions
'
;
const
EditorKbExpr
=
editorCommon
.
EditorKbExpr
;
export
type
ServicesAccessor
=
ServicesAccessor
;
// --- Keybinding extensions to make it more concise to express keybindings conditions
...
...
@@ -205,7 +207,7 @@ function triggerEditorActionGlobal(actionId: string, accessor: ServicesAccessor,
function
whenRule
(
needsTextFocus
:
boolean
,
needsKey
:
string
):
KbExpr
{
let
base
=
KbExpr
.
has
(
needsTextFocus
?
editorCommon
.
KEYBINDING_CONTEXT_EDITOR_TEXT_FOCUS
:
editorCommon
.
KEYBINDING_CONTEXT_EDITOR_FOCUS
);
let
base
=
(
needsTextFocus
?
EditorKbExpr
.
TextFocus
:
EditorKbExpr
.
Focus
);
if
(
needsKey
)
{
return
KbExpr
.
and
(
base
,
KbExpr
.
has
(
needsKey
));
...
...
src/vs/editor/contrib/find/common/findController.ts
浏览文件 @
d185dd6d
...
...
@@ -7,7 +7,7 @@
import
*
as
nls
from
'
vs/nls
'
;
import
{
KeyCode
,
KeyMod
}
from
'
vs/base/common/keyCodes
'
;
import
{
Disposable
}
from
'
vs/base/common/lifecycle
'
;
import
{
IKeybindingContextKey
,
IKeybindingService
,
IKeybindings
,
KbExpr
}
from
'
vs/platform/keybinding/common/keybinding
'
;
import
{
IKeybindingContextKey
,
IKeybindingService
,
IKeybindings
}
from
'
vs/platform/keybinding/common/keybinding
'
;
import
{
Range
}
from
'
vs/editor/common/core/range
'
;
import
{
Selection
}
from
'
vs/editor/common/core/selection
'
;
import
*
as
strings
from
'
vs/base/common/strings
'
;
...
...
@@ -18,6 +18,8 @@ import {FindReplaceState, FindReplaceStateChangedEvent, INewFindReplaceState} fr
import
{
DocumentHighlightProviderRegistry
}
from
'
vs/editor/common/modes
'
;
import
{
RunOnceScheduler
}
from
'
vs/base/common/async
'
;
const
EditorKbExpr
=
editorCommon
.
EditorKbExpr
;
export
enum
FindStartFocusAction
{
NoFocusChange
,
FocusFindInput
,
...
...
@@ -694,7 +696,7 @@ export class CompatChangeAll extends AbstractSelectHighlightsAction {
this
.
menuOpts
=
{
group
:
'
1_modification
'
,
order
:
1.2
,
kbExpr
:
KbExpr
.
not
(
editorCommon
.
KEYBINDING_CONTEXT_EDITOR_READONLY
)
kbExpr
:
EditorKbExpr
.
Writable
};
}
}
...
...
src/vs/editor/contrib/parameterHints/browser/parameterHints.ts
浏览文件 @
d185dd6d
...
...
@@ -8,7 +8,7 @@ import * as nls from 'vs/nls';
import
{
KeyCode
,
KeyMod
}
from
'
vs/base/common/keyCodes
'
;
import
{
dispose
}
from
'
vs/base/common/lifecycle
'
;
import
{
IInstantiationService
}
from
'
vs/platform/instantiation/common/instantiation
'
;
import
{
ICommonCodeEditor
,
IEditorContribution
,
KEYBINDING_CONTEXT_EDITOR_TEXT_FOCUS
,
EditorKbExpr
}
from
'
vs/editor/common/editorCommon
'
;
import
{
ICommonCodeEditor
,
IEditorContribution
,
EditorKbExpr
}
from
'
vs/editor/common/editorCommon
'
;
import
{
KbExpr
}
from
'
vs/platform/keybinding/common/keybinding
'
;
import
{
KeybindingsRegistry
}
from
'
vs/platform/keybinding/common/keybindingsRegistry
'
;
import
{
withCodeEditorFromCommandHandler
}
from
'
vs/editor/common/config/config
'
;
...
...
@@ -104,7 +104,7 @@ KeybindingsRegistry.registerCommandDesc({
id
:
'
closeParameterHints
'
,
handler
:
handler
(
'
closeParameterHints
'
,
c
=>
c
.
cancel
()),
weight
,
when
:
KbExpr
.
and
(
KbExpr
.
has
(
KEYBINDING_CONTEXT_EDITOR_TEXT_FOCUS
)
,
KbExpr
.
has
(
Context
.
Visible
)),
when
:
KbExpr
.
and
(
EditorKbExpr
.
TextFocus
,
KbExpr
.
has
(
Context
.
Visible
)),
primary
:
KeyCode
.
Escape
,
secondary
:
[
KeyMod
.
Shift
|
KeyCode
.
Escape
]
});
...
...
@@ -113,7 +113,7 @@ KeybindingsRegistry.registerCommandDesc({
id
:
'
showPrevParameterHint
'
,
handler
:
handler
(
'
showPrevParameterHint
'
,
c
=>
c
.
previous
()),
weight
,
when
:
KbExpr
.
and
(
KbExpr
.
has
(
KEYBINDING_CONTEXT_EDITOR_TEXT_FOCUS
)
,
KbExpr
.
has
(
Context
.
Visible
),
KbExpr
.
has
(
Context
.
MultipleSignatures
)),
when
:
KbExpr
.
and
(
EditorKbExpr
.
TextFocus
,
KbExpr
.
has
(
Context
.
Visible
),
KbExpr
.
has
(
Context
.
MultipleSignatures
)),
primary
:
KeyCode
.
UpArrow
,
secondary
:
[
KeyMod
.
Alt
|
KeyCode
.
UpArrow
],
mac
:
{
primary
:
KeyCode
.
UpArrow
,
secondary
:
[
KeyMod
.
Alt
|
KeyCode
.
UpArrow
,
KeyMod
.
WinCtrl
|
KeyCode
.
KEY_P
]
}
...
...
@@ -123,7 +123,7 @@ KeybindingsRegistry.registerCommandDesc({
id
:
'
showNextParameterHint
'
,
handler
:
handler
(
'
showNextParameterHint
'
,
c
=>
c
.
next
()),
weight
,
when
:
KbExpr
.
and
(
KbExpr
.
has
(
KEYBINDING_CONTEXT_EDITOR_TEXT_FOCUS
)
,
KbExpr
.
has
(
Context
.
Visible
),
KbExpr
.
has
(
Context
.
MultipleSignatures
)),
when
:
KbExpr
.
and
(
EditorKbExpr
.
TextFocus
,
KbExpr
.
has
(
Context
.
Visible
),
KbExpr
.
has
(
Context
.
MultipleSignatures
)),
primary
:
KeyCode
.
DownArrow
,
secondary
:
[
KeyMod
.
Alt
|
KeyCode
.
DownArrow
],
mac
:
{
primary
:
KeyCode
.
DownArrow
,
secondary
:
[
KeyMod
.
Alt
|
KeyCode
.
DownArrow
,
KeyMod
.
WinCtrl
|
KeyCode
.
KEY_N
]
}
...
...
src/vs/editor/contrib/rename/browser/rename.ts
浏览文件 @
d185dd6d
...
...
@@ -15,10 +15,9 @@ import {IEventService} from 'vs/platform/event/common/event';
import
{
IKeybindingContextKey
,
IKeybindingService
,
KbExpr
}
from
'
vs/platform/keybinding/common/keybinding
'
;
import
{
IMessageService
}
from
'
vs/platform/message/common/message
'
;
import
{
IProgressService
}
from
'
vs/platform/progress/common/progress
'
;
import
{
IRange
,
ICommonCodeEditor
,
EditorKbExpr
}
from
'
vs/editor/common/editorCommon
'
;
import
{
ServicesAccessor
,
EditorAction
,
CommonEditorRegistry
}
from
'
vs/editor/common/editorCommonExtensions
'
;
import
{
EditorBrowserRegistry
}
from
'
vs/editor/browser/editorBrowserExtensions
'
;
import
{
KEYBINDING_CONTEXT_EDITOR_READONLY
,
ModeContextKeys
,
IEditorContribution
}
from
'
vs/editor/common/editorCommon
'
;
import
{
IRange
,
ICommonCodeEditor
,
EditorKbExpr
,
ModeContextKeys
,
IEditorContribution
}
from
'
vs/editor/common/editorCommon
'
;
import
{
BulkEdit
,
createBulkEdit
}
from
'
vs/editor/common/services/bulkEdit
'
;
import
{
RenameProviderRegistry
}
from
'
vs/editor/common/modes
'
;
import
{
ICodeEditor
}
from
'
vs/editor/browser/editorBrowser
'
;
...
...
@@ -165,7 +164,7 @@ export class RenameAction extends EditorAction {
this
.
menuOpts
=
{
group
:
'
1_modification
'
,
order
:
1.1
,
kbExpr
:
KbExpr
.
and
(
KbExpr
.
has
(
ModeContextKeys
.
hasRenameProvider
),
KbExpr
.
not
(
KEYBINDING_CONTEXT_EDITOR_READONLY
)
)
kbExpr
:
KbExpr
.
and
(
KbExpr
.
has
(
ModeContextKeys
.
hasRenameProvider
),
EditorKbExpr
.
Writable
)
};
}
...
...
src/vs/editor/contrib/suggest/browser/suggest.ts
浏览文件 @
d185dd6d
...
...
@@ -9,7 +9,7 @@ import { KeyCode, KeyMod } from 'vs/base/common/keyCodes';
import
{
IDisposable
,
dispose
}
from
'
vs/base/common/lifecycle
'
;
import
{
IInstantiationService
}
from
'
vs/platform/instantiation/common/instantiation
'
;
import
{
KbExpr
}
from
'
vs/platform/keybinding/common/keybinding
'
;
import
{
ICommonCodeEditor
,
IEditorContribution
,
EditorKbExpr
,
KEYBINDING_CONTEXT_EDITOR_TEXT_FOCUS
}
from
'
vs/editor/common/editorCommon
'
;
import
{
ICommonCodeEditor
,
IEditorContribution
,
EditorKbExpr
}
from
'
vs/editor/common/editorCommon
'
;
import
{
ServicesAccessor
,
EditorAction
,
CommonEditorRegistry
}
from
'
vs/editor/common/editorCommonExtensions
'
;
import
{
ISuggestSupport
,
SuggestRegistry
}
from
'
vs/editor/common/modes
'
;
import
{
ICodeEditor
}
from
'
vs/editor/browser/editorBrowser
'
;
...
...
@@ -214,7 +214,7 @@ KeybindingsRegistry.registerCommandDesc({
id
:
'
acceptSelectedSuggestion
'
,
handler
:
handler
(
'
acceptSelectedSuggestion
'
,
c
=>
c
.
acceptSelectedSuggestion
()),
weight
,
when
:
KbExpr
.
and
(
KbExpr
.
has
(
KEYBINDING_CONTEXT_EDITOR_TEXT_FOCUS
)
,
KbExpr
.
has
(
SuggestContext
.
Visible
)),
when
:
KbExpr
.
and
(
EditorKbExpr
.
TextFocus
,
KbExpr
.
has
(
SuggestContext
.
Visible
)),
primary
:
KeyCode
.
Tab
});
...
...
@@ -222,7 +222,7 @@ KeybindingsRegistry.registerCommandDesc({
id
:
'
acceptSelectedSuggestionOnEnter
'
,
handler
:
handler
(
'
acceptSelectedSuggestionOnEnter
'
,
c
=>
c
.
acceptSelectedSuggestion
()),
weight
,
when
:
KbExpr
.
and
(
KbExpr
.
has
(
KEYBINDING_CONTEXT_EDITOR_TEXT_FOCUS
)
,
KbExpr
.
has
(
SuggestContext
.
Visible
),
KbExpr
.
has
(
'
config.editor.acceptSuggestionOnEnter
'
)),
when
:
KbExpr
.
and
(
EditorKbExpr
.
TextFocus
,
KbExpr
.
has
(
SuggestContext
.
Visible
),
KbExpr
.
has
(
'
config.editor.acceptSuggestionOnEnter
'
)),
primary
:
KeyCode
.
Enter
});
...
...
@@ -230,7 +230,7 @@ KeybindingsRegistry.registerCommandDesc({
id
:
'
hideSuggestWidget
'
,
handler
:
handler
(
'
hideSuggestWidget
'
,
c
=>
c
.
cancelSuggestWidget
()),
weight
,
when
:
KbExpr
.
and
(
KbExpr
.
has
(
KEYBINDING_CONTEXT_EDITOR_TEXT_FOCUS
)
,
KbExpr
.
has
(
SuggestContext
.
Visible
)),
when
:
KbExpr
.
and
(
EditorKbExpr
.
TextFocus
,
KbExpr
.
has
(
SuggestContext
.
Visible
)),
primary
:
KeyCode
.
Escape
,
secondary
:
[
KeyMod
.
Shift
|
KeyCode
.
Escape
]
});
...
...
@@ -239,7 +239,7 @@ KeybindingsRegistry.registerCommandDesc({
id
:
'
selectNextSuggestion
'
,
handler
:
handler
(
'
selectNextSuggestion
'
,
c
=>
c
.
selectNextSuggestion
()),
weight
,
when
:
KbExpr
.
and
(
KbExpr
.
has
(
KEYBINDING_CONTEXT_EDITOR_TEXT_FOCUS
)
,
KbExpr
.
has
(
SuggestContext
.
Visible
),
KbExpr
.
has
(
SuggestContext
.
MultipleSuggestions
)),
when
:
KbExpr
.
and
(
EditorKbExpr
.
TextFocus
,
KbExpr
.
has
(
SuggestContext
.
Visible
),
KbExpr
.
has
(
SuggestContext
.
MultipleSuggestions
)),
primary
:
KeyCode
.
DownArrow
,
secondary
:
[
KeyMod
.
Alt
|
KeyCode
.
DownArrow
],
mac
:
{
primary
:
KeyCode
.
DownArrow
,
secondary
:
[
KeyMod
.
Alt
|
KeyCode
.
DownArrow
,
KeyMod
.
WinCtrl
|
KeyCode
.
KEY_N
]
}
...
...
@@ -249,7 +249,7 @@ KeybindingsRegistry.registerCommandDesc({
id
:
'
selectNextPageSuggestion
'
,
handler
:
handler
(
'
selectNextPageSuggestion
'
,
c
=>
c
.
selectNextPageSuggestion
()),
weight
,
when
:
KbExpr
.
and
(
KbExpr
.
has
(
KEYBINDING_CONTEXT_EDITOR_TEXT_FOCUS
)
,
KbExpr
.
has
(
SuggestContext
.
Visible
),
KbExpr
.
has
(
SuggestContext
.
MultipleSuggestions
)),
when
:
KbExpr
.
and
(
EditorKbExpr
.
TextFocus
,
KbExpr
.
has
(
SuggestContext
.
Visible
),
KbExpr
.
has
(
SuggestContext
.
MultipleSuggestions
)),
primary
:
KeyCode
.
PageDown
,
secondary
:
[
KeyMod
.
Alt
|
KeyCode
.
PageDown
]
});
...
...
@@ -258,7 +258,7 @@ KeybindingsRegistry.registerCommandDesc({
id
:
'
selectPrevSuggestion
'
,
handler
:
handler
(
'
selectPrevSuggestion
'
,
c
=>
c
.
selectPrevSuggestion
()),
weight
,
when
:
KbExpr
.
and
(
KbExpr
.
has
(
KEYBINDING_CONTEXT_EDITOR_TEXT_FOCUS
)
,
KbExpr
.
has
(
SuggestContext
.
Visible
),
KbExpr
.
has
(
SuggestContext
.
MultipleSuggestions
)),
when
:
KbExpr
.
and
(
EditorKbExpr
.
TextFocus
,
KbExpr
.
has
(
SuggestContext
.
Visible
),
KbExpr
.
has
(
SuggestContext
.
MultipleSuggestions
)),
primary
:
KeyCode
.
UpArrow
,
secondary
:
[
KeyMod
.
Alt
|
KeyCode
.
UpArrow
],
mac
:
{
primary
:
KeyCode
.
UpArrow
,
secondary
:
[
KeyMod
.
Alt
|
KeyCode
.
UpArrow
,
KeyMod
.
WinCtrl
|
KeyCode
.
KEY_P
]
}
...
...
@@ -268,7 +268,7 @@ KeybindingsRegistry.registerCommandDesc({
id
:
'
selectPrevPageSuggestion
'
,
handler
:
handler
(
'
selectPrevPageSuggestion
'
,
c
=>
c
.
selectPrevPageSuggestion
()),
weight
,
when
:
KbExpr
.
and
(
KbExpr
.
has
(
KEYBINDING_CONTEXT_EDITOR_TEXT_FOCUS
)
,
KbExpr
.
has
(
SuggestContext
.
Visible
),
KbExpr
.
has
(
SuggestContext
.
MultipleSuggestions
)),
when
:
KbExpr
.
and
(
EditorKbExpr
.
TextFocus
,
KbExpr
.
has
(
SuggestContext
.
Visible
),
KbExpr
.
has
(
SuggestContext
.
MultipleSuggestions
)),
primary
:
KeyCode
.
PageUp
,
secondary
:
[
KeyMod
.
Alt
|
KeyCode
.
PageUp
]
});
...
...
@@ -277,7 +277,7 @@ KeybindingsRegistry.registerCommandDesc({
id
:
'
toggleSuggestionDetails
'
,
handler
:
handler
(
'
toggleSuggestionDetails
'
,
c
=>
c
.
toggleSuggestionDetails
()),
weight
,
when
:
KbExpr
.
and
(
KbExpr
.
has
(
KEYBINDING_CONTEXT_EDITOR_TEXT_FOCUS
)
,
KbExpr
.
has
(
SuggestContext
.
Visible
)),
when
:
KbExpr
.
and
(
EditorKbExpr
.
TextFocus
,
KbExpr
.
has
(
SuggestContext
.
Visible
)),
primary
:
KeyMod
.
CtrlCmd
|
KeyCode
.
Space
,
mac
:
{
primary
:
KeyMod
.
WinCtrl
|
KeyCode
.
Space
}
});
...
...
src/vs/editor/contrib/suggest/browser/tabCompletion.ts
浏览文件 @
d185dd6d
...
...
@@ -12,13 +12,15 @@ import {KeybindingsRegistry} from 'vs/platform/keybinding/common/keybindingsRegi
import
{
ISnippetsRegistry
,
Extensions
,
getNonWhitespacePrefix
,
ISnippet
}
from
'
vs/editor/common/modes/snippetsRegistry
'
;
import
{
Registry
}
from
'
vs/platform/platform
'
;
import
{
IDisposable
}
from
'
vs/base/common/lifecycle
'
;
import
*
as
editor
from
'
vs/editor/common/editorCommon
'
;
import
*
as
editor
Common
from
'
vs/editor/common/editorCommon
'
;
import
{
CommonEditorRegistry
}
from
'
vs/editor/common/editorCommonExtensions
'
;
import
{
CodeSnippet
,
ISnippetController
,
getSnippetController
}
from
'
vs/editor/contrib/snippet/common/snippet
'
;
const
EditorKbExpr
=
editorCommon
.
EditorKbExpr
;
let
snippetsRegistry
=
<
ISnippetsRegistry
>
Registry
.
as
(
Extensions
.
Snippets
);
class
TabCompletionController
implements
editor
.
IEditorContribution
{
class
TabCompletionController
implements
editor
Common
.
IEditorContribution
{
static
Id
=
'
editor.tabCompletionController
'
;
static
ContextKey
=
'
hasSnippetCompletions
'
;
...
...
@@ -28,7 +30,7 @@ class TabCompletionController implements editor.IEditorContribution {
private
_currentSnippets
:
ISnippet
[]
=
[];
constructor
(
editor
:
editor
.
ICommonCodeEditor
,
editor
:
editor
Common
.
ICommonCodeEditor
,
@
IKeybindingService
keybindingService
:
IKeybindingService
)
{
this
.
_snippetController
=
getSnippetController
(
editor
);
...
...
@@ -79,8 +81,8 @@ KeybindingsRegistry.registerCommandDesc({
weight
:
KeybindingsRegistry
.
WEIGHT
.
editorContrib
(),
primary
:
KeyCode
.
Tab
,
when
:
KbExpr
.
and
(
KbExpr
.
has
(
TabCompletionController
.
ContextKey
),
KbExpr
.
has
(
editor
.
KEYBINDING_CONTEXT_EDITOR_TEXT_FOCUS
)
,
KbExpr
.
not
(
editor
.
KEYBINDING_CONTEXT_EDITOR_TAB_MOVES_FOCUS
)
,
EditorKbExpr
.
TextFocus
,
EditorKbExpr
.
TabDoesNotMoveFocus
,
KbExpr
.
has
(
'
config.editor.tabCompletion
'
)),
handler
(
accessor
)
{
const
editor
=
accessor
.
get
(
ICodeEditorService
).
getFocusedCodeEditor
();
...
...
src/vs/workbench/browser/parts/editor/editorCommands.ts
浏览文件 @
d185dd6d
...
...
@@ -12,9 +12,10 @@ import { IEditorGroupService } from 'vs/workbench/services/group/common/groupSer
import
{
IWorkbenchEditorConfiguration
,
ActiveEditorMoveArguments
,
ActiveEditorMovePositioning
,
ActiveEditorMovePositioningBy
,
EditorCommands
}
from
'
vs/workbench/common/editor
'
;
import
{
IWorkbenchEditorService
}
from
'
vs/workbench/services/editor/common/editorService
'
;
import
*
as
editorCommon
from
'
vs/editor/common/editorCommon
'
;
import
{
KbExpr
}
from
'
vs/platform/keybinding/common/keybinding
'
;
import
{
IEditor
,
Position
,
POSITIONS
}
from
'
vs/platform/editor/common/editor
'
;
const
EditorKbExpr
=
editorCommon
.
EditorKbExpr
;
export
function
registerEditorComamnds
()
{
_registerActiveEditorMoveCommand
();
}
...
...
@@ -46,7 +47,7 @@ function _registerActiveEditorMoveCommand() {
KeybindingsRegistry
.
registerCommandDesc
({
id
:
EditorCommands
.
MoveActiveEditor
,
weight
:
KeybindingsRegistry
.
WEIGHT
.
workbenchContrib
(),
when
:
KbExpr
.
has
(
editorCommon
.
KEYBINDING_CONTEXT_EDITOR_TEXT_FOCUS
)
,
when
:
EditorKbExpr
.
TextFocus
,
primary
:
null
,
handler
:
(
accessor
,
args
:
any
)
=>
_moveActiveEditor
(
args
,
accessor
),
description
:
{
...
...
src/vs/workbench/parts/debug/browser/debugActions.ts
浏览文件 @
d185dd6d
...
...
@@ -22,6 +22,8 @@ import {ServicesAccessor, EditorAction} from 'vs/editor/common/editorCommonExten
import
{
KeyMod
,
KeyCode
}
from
'
vs/base/common/keyCodes
'
;
import
IDebugService
=
debug
.
IDebugService
;
const
EditorKbExpr
=
editorCommon
.
EditorKbExpr
;
export
class
AbstractDebugAction
extends
actions
.
Action
{
protected
toDispose
:
lifecycle
.
IDisposable
[];
...
...
@@ -671,7 +673,7 @@ export class SelectionToReplAction extends EditorAction {
);
this
.
menuOpts
=
{
kbExpr
:
KbExpr
.
and
(
KbExpr
.
has
(
editorCommon
.
KEYBINDING_CONTEXT_EDITOR_HAS_NON_EMPTY_SELECTION
)
,
KbExpr
.
has
(
debug
.
CONTEXT_IN_DEBUG_MODE
)),
kbExpr
:
KbExpr
.
and
(
EditorKbExpr
.
HasNonEmptySelection
,
KbExpr
.
has
(
debug
.
CONTEXT_IN_DEBUG_MODE
)),
group
:
'
debug
'
};
}
...
...
@@ -709,7 +711,7 @@ export class ShowDebugHoverAction extends EditorAction {
);
this
.
kbOpts
=
{
kbExpr
:
KbExpr
.
and
(
KbExpr
.
has
(
debug
.
CONTEXT_IN_DEBUG_MODE
),
KbExpr
.
has
(
editorCommon
.
KEYBINDING_CONTEXT_EDITOR_TEXT_FOCUS
)
),
kbExpr
:
KbExpr
.
and
(
KbExpr
.
has
(
debug
.
CONTEXT_IN_DEBUG_MODE
),
EditorKbExpr
.
TextFocus
),
primary
:
KeyMod
.
chord
(
KeyMod
.
CtrlCmd
|
KeyCode
.
KEY_K
,
KeyMod
.
CtrlCmd
|
KeyCode
.
KEY_I
)
};
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录