Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
9f53cc4f
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,发现更多精彩内容 >>
提交
9f53cc4f
编写于
8月 08, 2016
作者:
A
Alex Dima
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Editor Action kbOpts are and`ed with _precondition
上级
60276551
变更
7
显示空白变更内容
内联
并排
Showing
7 changed file
with
20 addition
and
13 deletion
+20
-13
src/vs/editor/common/editorCommonExtensions.ts
src/vs/editor/common/editorCommonExtensions.ts
+6
-0
src/vs/editor/contrib/carretOperations/common/carretOperations.ts
...ditor/contrib/carretOperations/common/carretOperations.ts
+1
-2
src/vs/editor/contrib/clipboard/browser/clipboard.ts
src/vs/editor/contrib/clipboard/browser/clipboard.ts
+3
-4
src/vs/editor/contrib/comment/common/comment.ts
src/vs/editor/contrib/comment/common/comment.ts
+4
-5
src/vs/editor/contrib/find/common/findController.ts
src/vs/editor/contrib/find/common/findController.ts
+4
-0
src/vs/editor/contrib/format/common/formatActions.ts
src/vs/editor/contrib/format/common/formatActions.ts
+1
-1
src/vs/workbench/parts/debug/browser/debugActions.ts
src/vs/workbench/parts/debug/browser/debugActions.ts
+1
-1
未找到文件。
src/vs/editor/common/editorCommonExtensions.ts
浏览文件 @
9f53cc4f
...
...
@@ -55,6 +55,9 @@ function analyze() {
// console.warn('MISSING PRECONDITION FOR ' + desc.id + desc.callsite);
// } else {
// let prec = desc._precondition ? desc._precondition.serialize() : 'null';
// if (prec.indexOf('editorTextFocus') >= 0 || prec.indexOf('editorFocus') >= 0) {
// console.warn('BELOW COMMAND WANTS FOCUS!!!');
// }
// if (desc._needsWritableEditor && prec.indexOf('!editorReadonly') === -1) {
// console.warn('BELOW COMMAND DOES NOT PRECONDITION CORRECTLY WRITABLE!');
// }
...
...
@@ -67,6 +70,9 @@ function analyze() {
export
module
CommonEditorRegistry
{
export
function
registerEditorAction
(
desc
:
EditorAction
)
{
if
(
desc
.
kbOpts
&&
desc
.
kbOpts
.
kbExpr
&&
desc
.
_precondition
)
{
desc
.
kbOpts
.
kbExpr
=
KbExpr
.
and
(
desc
.
kbOpts
.
kbExpr
,
desc
.
_precondition
);
}
record
(
desc
);
(
<
EditorContributionRegistry
>
Registry
.
as
(
Extensions
.
EditorCommonContributions
)).
registerEditorAction
(
desc
);
}
...
...
src/vs/editor/contrib/carretOperations/common/carretOperations.ts
浏览文件 @
9f53cc4f
...
...
@@ -8,7 +8,6 @@ import * as nls from 'vs/nls';
import
{
ICommand
,
ICommonCodeEditor
,
EditorContextKeys
}
from
'
vs/editor/common/editorCommon
'
;
import
{
EditorAction
,
CommonEditorRegistry
,
ServicesAccessor
}
from
'
vs/editor/common/editorCommonExtensions
'
;
import
{
MoveCarretCommand
}
from
'
./moveCarretCommand
'
;
import
{
KbExpr
}
from
'
vs/platform/keybinding/common/keybinding
'
;
class
MoveCarretAction
extends
EditorAction
{
...
...
@@ -17,7 +16,7 @@ class MoveCarretAction extends EditorAction {
constructor
(
id
:
string
,
label
:
string
,
alias
:
string
,
left
:
boolean
)
{
super
(
id
,
label
,
alias
,
true
);
this
.
_precondition
=
KbExpr
.
and
(
EditorContextKeys
.
Writable
)
;
this
.
_precondition
=
EditorContextKeys
.
Writable
;
this
.
left
=
left
;
}
...
...
src/vs/editor/contrib/clipboard/browser/clipboard.ts
浏览文件 @
9f53cc4f
...
...
@@ -10,7 +10,6 @@ import * as nls from 'vs/nls';
import
{
KeyCode
,
KeyMod
}
from
'
vs/base/common/keyCodes
'
;
import
*
as
browser
from
'
vs/base/browser/browser
'
;
import
{
ServicesAccessor
}
from
'
vs/platform/instantiation/common/instantiation
'
;
import
{
KbExpr
}
from
'
vs/platform/keybinding/common/keybinding
'
;
import
{
findFocusedEditor
}
from
'
vs/editor/common/config/config
'
;
import
*
as
editorCommon
from
'
vs/editor/common/editorCommon
'
;
import
{
EditorAction
,
CommonEditorRegistry
}
from
'
vs/editor/common/editorCommonExtensions
'
;
...
...
@@ -57,10 +56,10 @@ class ExecCommandCutAction extends ExecCommandAction {
'
cut
'
);
this
.
_precondition
=
KbExpr
.
and
(
EditorContextKeys
.
Writable
)
;
this
.
_precondition
=
EditorContextKeys
.
Writable
;
this
.
kbOpts
=
{
kbExpr
:
KbExpr
.
and
(
EditorContextKeys
.
TextFocus
,
EditorContextKeys
.
Writable
)
,
kbExpr
:
EditorContextKeys
.
TextFocus
,
primary
:
KeyMod
.
CtrlCmd
|
KeyCode
.
KEY_X
,
win
:
{
primary
:
KeyMod
.
CtrlCmd
|
KeyCode
.
KEY_X
,
secondary
:
[
KeyMod
.
Shift
|
KeyCode
.
Delete
]
}
};
...
...
@@ -132,7 +131,7 @@ class ExecCommandPasteAction extends ExecCommandAction {
this
.
_precondition
=
EditorContextKeys
.
Writable
;
this
.
kbOpts
=
{
kbExpr
:
KbExpr
.
and
(
EditorContextKeys
.
TextFocus
,
EditorContextKeys
.
Writable
)
,
kbExpr
:
EditorContextKeys
.
TextFocus
,
primary
:
KeyMod
.
CtrlCmd
|
KeyCode
.
KEY_V
,
win
:
{
primary
:
KeyMod
.
CtrlCmd
|
KeyCode
.
KEY_V
,
secondary
:
[
KeyMod
.
Shift
|
KeyCode
.
Insert
]
}
};
...
...
src/vs/editor/contrib/comment/common/comment.ts
浏览文件 @
9f53cc4f
...
...
@@ -10,7 +10,6 @@ import {ICommand, ICommonCodeEditor, EditorContextKeys} from 'vs/editor/common/e
import
{
EditorAction
,
CommonEditorRegistry
,
ServicesAccessor
}
from
'
vs/editor/common/editorCommonExtensions
'
;
import
{
BlockCommentCommand
}
from
'
./blockCommentCommand
'
;
import
{
LineCommentCommand
,
Type
}
from
'
./lineCommentCommand
'
;
import
{
KbExpr
}
from
'
vs/platform/keybinding/common/keybinding
'
;
abstract
class
CommentLineAction
extends
EditorAction
{
...
...
@@ -53,7 +52,7 @@ class ToggleCommentLineAction extends CommentLineAction {
this
.
_precondition
=
EditorContextKeys
.
Writable
;
this
.
kbOpts
=
{
kbExpr
:
KbExpr
.
and
(
EditorContextKeys
.
TextFocus
,
EditorContextKeys
.
Writable
)
,
kbExpr
:
EditorContextKeys
.
TextFocus
,
primary
:
KeyMod
.
CtrlCmd
|
KeyCode
.
US_SLASH
};
}
...
...
@@ -72,7 +71,7 @@ class AddLineCommentAction extends CommentLineAction {
this
.
_precondition
=
EditorContextKeys
.
Writable
;
this
.
kbOpts
=
{
kbExpr
:
KbExpr
.
and
(
EditorContextKeys
.
TextFocus
,
EditorContextKeys
.
Writable
)
,
kbExpr
:
EditorContextKeys
.
TextFocus
,
primary
:
KeyMod
.
chord
(
KeyMod
.
CtrlCmd
|
KeyCode
.
KEY_K
,
KeyMod
.
CtrlCmd
|
KeyCode
.
KEY_C
)
};
}
...
...
@@ -91,7 +90,7 @@ class RemoveLineCommentAction extends CommentLineAction {
this
.
_precondition
=
EditorContextKeys
.
Writable
;
this
.
kbOpts
=
{
kbExpr
:
KbExpr
.
and
(
EditorContextKeys
.
TextFocus
,
EditorContextKeys
.
Writable
)
,
kbExpr
:
EditorContextKeys
.
TextFocus
,
primary
:
KeyMod
.
chord
(
KeyMod
.
CtrlCmd
|
KeyCode
.
KEY_K
,
KeyMod
.
CtrlCmd
|
KeyCode
.
KEY_U
)
};
}
...
...
@@ -110,7 +109,7 @@ class BlockCommentAction extends EditorAction {
this
.
_precondition
=
EditorContextKeys
.
Writable
;
this
.
kbOpts
=
{
kbExpr
:
KbExpr
.
and
(
EditorContextKeys
.
TextFocus
,
EditorContextKeys
.
Writable
)
,
kbExpr
:
EditorContextKeys
.
TextFocus
,
primary
:
KeyMod
.
Shift
|
KeyMod
.
Alt
|
KeyCode
.
KEY_A
,
linux
:
{
primary
:
KeyMod
.
CtrlCmd
|
KeyMod
.
Shift
|
KeyCode
.
KEY_A
}
};
...
...
src/vs/editor/contrib/find/common/findController.ts
浏览文件 @
9f53cc4f
...
...
@@ -419,6 +419,10 @@ export class StartFindReplaceAction extends EditorAction {
}
public
run
(
accessor
:
ServicesAccessor
,
editor
:
editorCommon
.
ICommonCodeEditor
):
void
{
if
(
editor
.
getConfiguration
().
readOnly
)
{
return
;
}
let
controller
=
CommonFindController
.
getFindController
(
editor
);
controller
.
start
({
forceRevealReplace
:
true
,
...
...
src/vs/editor/contrib/format/common/formatActions.ts
浏览文件 @
9f53cc4f
...
...
@@ -148,7 +148,7 @@ export class FormatAction extends EditorAction {
this
.
_precondition
=
KbExpr
.
and
(
EditorContextKeys
.
Writable
,
ModeContextKeys
.
hasFormattingProvider
);
this
.
kbOpts
=
{
kbExpr
:
KbExpr
.
and
(
EditorContextKeys
.
TextFocus
,
EditorContextKeys
.
Writable
)
,
kbExpr
:
EditorContextKeys
.
TextFocus
,
primary
:
KeyMod
.
Shift
|
KeyMod
.
Alt
|
KeyCode
.
KEY_F
,
linux
:
{
primary
:
KeyMod
.
CtrlCmd
|
KeyMod
.
Shift
|
KeyCode
.
KEY_I
}
};
...
...
src/vs/workbench/parts/debug/browser/debugActions.ts
浏览文件 @
9f53cc4f
...
...
@@ -702,7 +702,7 @@ export class ShowDebugHoverAction extends EditorAction {
this
.
_precondition
=
debug
.
CONTEXT_IN_DEBUG_MODE
;
this
.
kbOpts
=
{
kbExpr
:
KbExpr
.
and
(
debug
.
CONTEXT_IN_DEBUG_MODE
,
EditorContextKeys
.
TextFocus
)
,
kbExpr
:
EditorContextKeys
.
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.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录