Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
掘金者说
vscode
提交
6217946d
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,发现更多精彩内容 >>
提交
6217946d
编写于
11月 08, 2017
作者:
A
Alex Dima
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Remove usages of @editorAction (#37212)
上级
0ea9de83
变更
49
隐藏空白更改
内联
并排
Showing
49 changed file
with
239 addition
and
270 deletion
+239
-270
src/vs/editor/browser/view/viewImpl.ts
src/vs/editor/browser/view/viewImpl.ts
+0
-5
src/vs/editor/browser/viewParts/currentLineHighlight/currentLineHighlight.ts
...er/viewParts/currentLineHighlight/currentLineHighlight.ts
+0
-6
src/vs/editor/browser/widget/diffReview.ts
src/vs/editor/browser/widget/diffReview.ts
+4
-5
src/vs/editor/common/editorCommonExtensions.ts
src/vs/editor/common/editorCommonExtensions.ts
+2
-2
src/vs/editor/contrib/bracketMatching/common/bracketMatching.ts
.../editor/contrib/bracketMatching/common/bracketMatching.ts
+2
-3
src/vs/editor/contrib/caretOperations/common/caretOperations.ts
.../editor/contrib/caretOperations/common/caretOperations.ts
+4
-5
src/vs/editor/contrib/caretOperations/common/transpose.ts
src/vs/editor/contrib/caretOperations/common/transpose.ts
+3
-3
src/vs/editor/contrib/clipboard/browser/clipboard.ts
src/vs/editor/contrib/clipboard/browser/clipboard.ts
+14
-16
src/vs/editor/contrib/comment/common/comment.ts
src/vs/editor/contrib/comment/common/comment.ts
+6
-9
src/vs/editor/contrib/contextmenu/browser/contextmenu.ts
src/vs/editor/contrib/contextmenu/browser/contextmenu.ts
+3
-3
src/vs/editor/contrib/find/common/findController.ts
src/vs/editor/contrib/find/common/findController.ts
+12
-12
src/vs/editor/contrib/folding/browser/folding.ts
src/vs/editor/contrib/folding/browser/folding.ts
+8
-13
src/vs/editor/contrib/format/browser/formatActions.ts
src/vs/editor/contrib/format/browser/formatActions.ts
+4
-4
src/vs/editor/contrib/goToDeclaration/browser/goToDeclarationCommands.ts
...ontrib/goToDeclaration/browser/goToDeclarationCommands.ts
+8
-8
src/vs/editor/contrib/gotoError/browser/gotoError.ts
src/vs/editor/contrib/gotoError/browser/gotoError.ts
+4
-5
src/vs/editor/contrib/hover/browser/hover.ts
src/vs/editor/contrib/hover/browser/hover.ts
+3
-3
src/vs/editor/contrib/inPlaceReplace/common/inPlaceReplace.ts
...vs/editor/contrib/inPlaceReplace/common/inPlaceReplace.ts
+5
-6
src/vs/editor/contrib/indentation/common/indentation.ts
src/vs/editor/contrib/indentation/common/indentation.ts
+9
-8
src/vs/editor/contrib/linesOperations/common/linesOperations.ts
.../editor/contrib/linesOperations/common/linesOperations.ts
+20
-27
src/vs/editor/contrib/links/browser/links.ts
src/vs/editor/contrib/links/browser/links.ts
+3
-3
src/vs/editor/contrib/multicursor/common/multicursor.ts
src/vs/editor/contrib/multicursor/common/multicursor.ts
+11
-11
src/vs/editor/contrib/parameterHints/browser/parameterHints.ts
...s/editor/contrib/parameterHints/browser/parameterHints.ts
+3
-2
src/vs/editor/contrib/quickFix/browser/quickFixCommands.ts
src/vs/editor/contrib/quickFix/browser/quickFixCommands.ts
+3
-2
src/vs/editor/contrib/referenceSearch/browser/referenceSearch.ts
...editor/contrib/referenceSearch/browser/referenceSearch.ts
+3
-2
src/vs/editor/contrib/rename/browser/rename.ts
src/vs/editor/contrib/rename/browser/rename.ts
+3
-2
src/vs/editor/contrib/smartSelect/common/smartSelect.ts
src/vs/editor/contrib/smartSelect/common/smartSelect.ts
+4
-5
src/vs/editor/contrib/suggest/browser/suggestController.ts
src/vs/editor/contrib/suggest/browser/suggestController.ts
+3
-2
src/vs/editor/contrib/toggleTabFocusMode/common/toggleTabFocusMode.ts
...r/contrib/toggleTabFocusMode/common/toggleTabFocusMode.ts
+3
-2
src/vs/editor/contrib/wordHighlighter/common/wordHighlighter.ts
.../editor/contrib/wordHighlighter/common/wordHighlighter.ts
+5
-6
src/vs/editor/standalone/browser/accessibilityHelp/accessibilityHelp.ts
...standalone/browser/accessibilityHelp/accessibilityHelp.ts
+3
-3
src/vs/editor/standalone/browser/inspectTokens/inspectTokens.ts
.../editor/standalone/browser/inspectTokens/inspectTokens.ts
+4
-4
src/vs/editor/standalone/browser/quickOpen/gotoLine.ts
src/vs/editor/standalone/browser/quickOpen/gotoLine.ts
+3
-2
src/vs/editor/standalone/browser/quickOpen/quickCommand.ts
src/vs/editor/standalone/browser/quickOpen/quickCommand.ts
+4
-3
src/vs/editor/standalone/browser/quickOpen/quickOutline.ts
src/vs/editor/standalone/browser/quickOpen/quickOutline.ts
+3
-2
src/vs/editor/standalone/browser/toggleHighContrast/toggleHighContrast.ts
...andalone/browser/toggleHighContrast/toggleHighContrast.ts
+3
-3
src/vs/workbench/parts/codeEditor/electron-browser/accessibility.ts
...kbench/parts/codeEditor/electron-browser/accessibility.ts
+3
-3
src/vs/workbench/parts/codeEditor/electron-browser/inspectKeybindings.ts
...h/parts/codeEditor/electron-browser/inspectKeybindings.ts
+3
-3
src/vs/workbench/parts/codeEditor/electron-browser/textMate/inspectTMScopes.ts
...s/codeEditor/electron-browser/textMate/inspectTMScopes.ts
+4
-4
src/vs/workbench/parts/codeEditor/electron-browser/toggleMinimap.ts
...kbench/parts/codeEditor/electron-browser/toggleMinimap.ts
+3
-2
src/vs/workbench/parts/codeEditor/electron-browser/toggleRenderControlCharacter.ts
...deEditor/electron-browser/toggleRenderControlCharacter.ts
+3
-2
src/vs/workbench/parts/codeEditor/electron-browser/toggleRenderWhitespace.ts
...rts/codeEditor/electron-browser/toggleRenderWhitespace.ts
+3
-2
src/vs/workbench/parts/codeEditor/electron-browser/toggleWordWrap.ts
...bench/parts/codeEditor/electron-browser/toggleWordWrap.ts
+3
-3
src/vs/workbench/parts/debug/browser/debugEditorActions.ts
src/vs/workbench/parts/debug/browser/debugEditorActions.ts
+10
-17
src/vs/workbench/parts/debug/electron-browser/repl.ts
src/vs/workbench/parts/debug/electron-browser/repl.ts
+18
-20
src/vs/workbench/parts/emmet/browser/actions/showEmmetCommands.ts
...orkbench/parts/emmet/browser/actions/showEmmetCommands.ts
+4
-4
src/vs/workbench/parts/emmet/electron-browser/actions/expandAbbreviation.ts
...arts/emmet/electron-browser/actions/expandAbbreviation.ts
+4
-4
src/vs/workbench/parts/quickopen/browser/commandsHandler.ts
src/vs/workbench/parts/quickopen/browser/commandsHandler.ts
+3
-3
src/vs/workbench/parts/scm/electron-browser/dirtydiffDecorator.ts
...orkbench/parts/scm/electron-browser/dirtydiffDecorator.ts
+3
-3
src/vs/workbench/parts/snippets/electron-browser/insertSnippet.ts
...orkbench/parts/snippets/electron-browser/insertSnippet.ts
+3
-3
未找到文件。
src/vs/editor/browser/view/viewImpl.ts
浏览文件 @
6217946d
...
...
@@ -90,9 +90,6 @@ export class View extends ViewEventHandler {
private
overflowGuardContainer
:
FastDomNode
<
HTMLElement
>
;
// Actual mutable state
// @ts-ignore unused property
private
_isDisposed
:
boolean
;
private
_renderAnimationFrame
:
IDisposable
;
constructor
(
...
...
@@ -104,7 +101,6 @@ export class View extends ViewEventHandler {
execCoreEditorCommandFunc
:
ExecCoreEditorCommandFunc
)
{
super
();
this
.
_isDisposed
=
false
;
this
.
_cursor
=
cursor
;
this
.
_renderAnimationFrame
=
null
;
this
.
outgoingEvents
=
new
ViewOutgoingEvents
(
model
);
...
...
@@ -345,7 +341,6 @@ export class View extends ViewEventHandler {
// --- end event handlers
public
dispose
():
void
{
this
.
_isDisposed
=
true
;
if
(
this
.
_renderAnimationFrame
!==
null
)
{
this
.
_renderAnimationFrame
.
dispose
();
this
.
_renderAnimationFrame
=
null
;
...
...
src/vs/editor/browser/viewParts/currentLineHighlight/currentLineHighlight.ts
浏览文件 @
6217946d
...
...
@@ -16,8 +16,6 @@ import { editorLineHighlight, editorLineHighlightBorder } from 'vs/editor/common
export
class
CurrentLineHighlightOverlay
extends
DynamicViewOverlay
{
private
_context
:
ViewContext
;
private
_lineHeight
:
number
;
// @ts-ignore unused property
private
_readOnly
:
boolean
;
private
_renderLineHighlight
:
'
none
'
|
'
gutter
'
|
'
line
'
|
'
all
'
;
private
_selectionIsEmpty
:
boolean
;
private
_primaryCursorIsInEditableRange
:
boolean
;
...
...
@@ -29,7 +27,6 @@ export class CurrentLineHighlightOverlay extends DynamicViewOverlay {
super
();
this
.
_context
=
context
;
this
.
_lineHeight
=
this
.
_context
.
configuration
.
editor
.
lineHeight
;
this
.
_readOnly
=
this
.
_context
.
configuration
.
editor
.
readOnly
;
this
.
_renderLineHighlight
=
this
.
_context
.
configuration
.
editor
.
viewInfo
.
renderLineHighlight
;
this
.
_selectionIsEmpty
=
true
;
...
...
@@ -53,9 +50,6 @@ export class CurrentLineHighlightOverlay extends DynamicViewOverlay {
if
(
e
.
lineHeight
)
{
this
.
_lineHeight
=
this
.
_context
.
configuration
.
editor
.
lineHeight
;
}
if
(
e
.
readOnly
)
{
this
.
_readOnly
=
this
.
_context
.
configuration
.
editor
.
readOnly
;
}
if
(
e
.
viewInfo
)
{
this
.
_renderLineHighlight
=
this
.
_context
.
configuration
.
editor
.
viewInfo
.
renderLineHighlight
;
}
...
...
src/vs/editor/browser/widget/diffReview.ts
浏览文件 @
6217946d
...
...
@@ -24,7 +24,7 @@ import { editorLineNumbers } from 'vs/editor/common/view/editorColorRegistry';
import
{
KeyCode
,
KeyMod
}
from
'
vs/base/common/keyCodes
'
;
import
{
ActionBar
}
from
'
vs/base/browser/ui/actionbar/actionbar
'
;
import
{
Action
}
from
'
vs/base/common/actions
'
;
import
{
e
ditorAction
,
EditorAction
,
ServicesAccessor
}
from
'
vs/editor/common/editorCommonExtensions
'
;
import
{
registerE
ditorAction
,
EditorAction
,
ServicesAccessor
}
from
'
vs/editor/common/editorCommonExtensions
'
;
import
{
ContextKeyExpr
}
from
'
vs/platform/contextkey/common/contextkey
'
;
import
{
ICodeEditorService
}
from
'
vs/editor/common/services/codeEditorService
'
;
...
...
@@ -763,8 +763,6 @@ registerThemingParticipant((theme, collector) => {
}
});
@
editorAction
// @ts-ignore @editorAction uses the class
class
DiffReviewNext
extends
EditorAction
{
constructor
()
{
super
({
...
...
@@ -787,8 +785,6 @@ class DiffReviewNext extends EditorAction {
}
}
@
editorAction
// @ts-ignore @editorAction uses the class
class
DiffReviewPrev
extends
EditorAction
{
constructor
()
{
super
({
...
...
@@ -822,3 +818,6 @@ function findFocusedDiffEditor(accessor: ServicesAccessor): DiffEditorWidget {
}
return
null
;
}
registerEditorAction
(
new
DiffReviewNext
());
registerEditorAction
(
new
DiffReviewPrev
());
src/vs/editor/common/editorCommonExtensions.ts
浏览文件 @
6217946d
...
...
@@ -212,8 +212,8 @@ export abstract class EditorAction extends EditorCommand {
// --- Registration of commands and actions
export
function
editorAction
(
ctor
:
{
new
():
EditorAction
;
}
):
void
{
CommonEditorRegistry
.
registerEditorAction
(
new
ctor
()
);
export
function
registerEditorAction
(
editorAction
:
EditorAction
):
void
{
CommonEditorRegistry
.
registerEditorAction
(
editorAction
);
}
export
function
editorCommand
(
ctor
:
{
new
():
EditorCommand
}):
void
{
...
...
src/vs/editor/contrib/bracketMatching/common/bracketMatching.ts
浏览文件 @
6217946d
...
...
@@ -13,14 +13,12 @@ import { Position } from 'vs/editor/common/core/position';
import
{
Selection
}
from
'
vs/editor/common/core/selection
'
;
import
{
RunOnceScheduler
}
from
'
vs/base/common/async
'
;
import
*
as
editorCommon
from
'
vs/editor/common/editorCommon
'
;
import
{
e
ditorAction
,
commonEditorContribution
,
ServicesAccessor
,
EditorAction
}
from
'
vs/editor/common/editorCommonExtensions
'
;
import
{
registerE
ditorAction
,
commonEditorContribution
,
ServicesAccessor
,
EditorAction
}
from
'
vs/editor/common/editorCommonExtensions
'
;
import
{
EditorContextKeys
}
from
'
vs/editor/common/editorContextKeys
'
;
import
{
registerThemingParticipant
}
from
'
vs/platform/theme/common/themeService
'
;
import
{
editorBracketMatchBackground
,
editorBracketMatchBorder
}
from
'
vs/editor/common/view/editorColorRegistry
'
;
import
{
ModelDecorationOptions
}
from
'
vs/editor/common/model/textModelWithDecorations
'
;
@
editorAction
// @ts-ignore @editorAction uses the class
class
SelectBracketAction
extends
EditorAction
{
constructor
()
{
super
({
...
...
@@ -227,6 +225,7 @@ export class BracketMatchingController extends Disposable implements editorCommo
}
}
registerEditorAction
(
new
SelectBracketAction
());
registerThemingParticipant
((
theme
,
collector
)
=>
{
let
bracketMatchBackground
=
theme
.
getColor
(
editorBracketMatchBackground
);
if
(
bracketMatchBackground
)
{
...
...
src/vs/editor/contrib/caretOperations/common/caretOperations.ts
浏览文件 @
6217946d
...
...
@@ -7,7 +7,7 @@
import
*
as
nls
from
'
vs/nls
'
;
import
{
ICommand
,
ICommonCodeEditor
}
from
'
vs/editor/common/editorCommon
'
;
import
{
EditorContextKeys
}
from
'
vs/editor/common/editorContextKeys
'
;
import
{
IActionOptions
,
e
ditorAction
,
EditorAction
,
ServicesAccessor
}
from
'
vs/editor/common/editorCommonExtensions
'
;
import
{
IActionOptions
,
registerE
ditorAction
,
EditorAction
,
ServicesAccessor
}
from
'
vs/editor/common/editorCommonExtensions
'
;
import
{
MoveCaretCommand
}
from
'
./moveCaretCommand
'
;
class
MoveCaretAction
extends
EditorAction
{
...
...
@@ -35,8 +35,6 @@ class MoveCaretAction extends EditorAction {
}
}
@
editorAction
// @ts-ignore @editorAction uses the class
class
MoveCaretLeftAction
extends
MoveCaretAction
{
constructor
()
{
super
(
true
,
{
...
...
@@ -48,8 +46,6 @@ class MoveCaretLeftAction extends MoveCaretAction {
}
}
@
editorAction
// @ts-ignore @editorAction uses the class
class
MoveCaretRightAction
extends
MoveCaretAction
{
constructor
()
{
super
(
false
,
{
...
...
@@ -60,3 +56,6 @@ class MoveCaretRightAction extends MoveCaretAction {
});
}
}
registerEditorAction
(
new
MoveCaretLeftAction
());
registerEditorAction
(
new
MoveCaretRightAction
());
src/vs/editor/contrib/caretOperations/common/transpose.ts
浏览文件 @
6217946d
...
...
@@ -9,11 +9,9 @@ import { KeyCode, KeyMod } from 'vs/base/common/keyCodes';
import
{
Range
}
from
'
vs/editor/common/core/range
'
;
import
{
ICommand
,
ICommonCodeEditor
}
from
'
vs/editor/common/editorCommon
'
;
import
{
EditorContextKeys
}
from
'
vs/editor/common/editorContextKeys
'
;
import
{
e
ditorAction
,
EditorAction
,
ServicesAccessor
}
from
'
vs/editor/common/editorCommonExtensions
'
;
import
{
registerE
ditorAction
,
EditorAction
,
ServicesAccessor
}
from
'
vs/editor/common/editorCommonExtensions
'
;
import
{
ReplaceCommand
}
from
'
vs/editor/common/commands/replaceCommand
'
;
@
editorAction
// @ts-ignore @editorAction uses the class
class
TransposeLettersAction
extends
EditorAction
{
constructor
()
{
...
...
@@ -70,3 +68,5 @@ class TransposeLettersAction extends EditorAction {
}
}
}
registerEditorAction
(
new
TransposeLettersAction
());
src/vs/editor/contrib/clipboard/browser/clipboard.ts
浏览文件 @
6217946d
...
...
@@ -13,7 +13,7 @@ import * as platform from 'vs/base/common/platform';
import
{
ServicesAccessor
}
from
'
vs/platform/instantiation/common/instantiation
'
;
import
{
ICodeEditorService
}
from
'
vs/editor/common/services/codeEditorService
'
;
import
*
as
editorCommon
from
'
vs/editor/common/editorCommon
'
;
import
{
e
ditorAction
,
IActionOptions
,
EditorAction
,
ICommandKeybindingsOptions
}
from
'
vs/editor/common/editorCommonExtensions
'
;
import
{
registerE
ditorAction
,
IActionOptions
,
EditorAction
,
ICommandKeybindingsOptions
}
from
'
vs/editor/common/editorCommonExtensions
'
;
import
{
CopyOptions
}
from
'
vs/editor/browser/controller/textAreaInput
'
;
import
{
EditorContextKeys
}
from
'
vs/editor/common/editorContextKeys
'
;
...
...
@@ -30,13 +30,6 @@ const supportsPaste = (platform.isNative || (!browser.isChrome && document.query
type
ExecCommand
=
'
cut
'
|
'
copy
'
|
'
paste
'
;
function
conditionalEditorAction
(
condition
:
boolean
)
{
if
(
!
condition
)
{
return
()
=>
{
};
}
return
editorAction
;
}
abstract
class
ExecCommandAction
extends
EditorAction
{
private
browserCommand
:
ExecCommand
;
...
...
@@ -63,8 +56,6 @@ abstract class ExecCommandAction extends EditorAction {
}
}
@
conditionalEditorAction
(
supportsCut
)
// @ts-ignore @editorAction uses the class
class
ExecCommandCutAction
extends
ExecCommandAction
{
constructor
()
{
...
...
@@ -102,8 +93,6 @@ class ExecCommandCutAction extends ExecCommandAction {
}
}
@
conditionalEditorAction
(
supportsCopy
)
// @ts-ignore @editorAction uses the class
class
ExecCommandCopyAction
extends
ExecCommandAction
{
constructor
()
{
...
...
@@ -142,8 +131,6 @@ class ExecCommandCopyAction extends ExecCommandAction {
}
}
@
conditionalEditorAction
(
supportsPaste
)
// @ts-ignore @editorAction uses the class
class
ExecCommandPasteAction
extends
ExecCommandAction
{
constructor
()
{
...
...
@@ -172,8 +159,6 @@ class ExecCommandPasteAction extends ExecCommandAction {
}
}
@
conditionalEditorAction
(
supportsCopyWithSyntaxHighlighting
)
// @ts-ignore @editorAction uses the class
class
ExecCommandCopyWithSyntaxHighlightingAction
extends
ExecCommandAction
{
constructor
()
{
...
...
@@ -201,3 +186,16 @@ class ExecCommandCopyWithSyntaxHighlightingAction extends ExecCommandAction {
CopyOptions
.
forceCopyWithSyntaxHighlighting
=
false
;
}
}
if
(
supportsCut
)
{
registerEditorAction
(
new
ExecCommandCutAction
());
}
if
(
supportsCopy
)
{
registerEditorAction
(
new
ExecCommandCopyAction
());
}
if
(
supportsPaste
)
{
registerEditorAction
(
new
ExecCommandPasteAction
());
}
if
(
supportsCopyWithSyntaxHighlighting
)
{
registerEditorAction
(
new
ExecCommandCopyWithSyntaxHighlightingAction
());
}
src/vs/editor/contrib/comment/common/comment.ts
浏览文件 @
6217946d
...
...
@@ -8,7 +8,7 @@ import * as nls from 'vs/nls';
import
{
KeyCode
,
KeyMod
,
KeyChord
}
from
'
vs/base/common/keyCodes
'
;
import
{
ICommand
,
ICommonCodeEditor
}
from
'
vs/editor/common/editorCommon
'
;
import
{
EditorContextKeys
}
from
'
vs/editor/common/editorContextKeys
'
;
import
{
e
ditorAction
,
IActionOptions
,
EditorAction
,
ServicesAccessor
}
from
'
vs/editor/common/editorCommonExtensions
'
;
import
{
registerE
ditorAction
,
IActionOptions
,
EditorAction
,
ServicesAccessor
}
from
'
vs/editor/common/editorCommonExtensions
'
;
import
{
BlockCommentCommand
}
from
'
./blockCommentCommand
'
;
import
{
LineCommentCommand
,
Type
}
from
'
./lineCommentCommand
'
;
...
...
@@ -42,8 +42,6 @@ abstract class CommentLineAction extends EditorAction {
}
@
editorAction
// @ts-ignore @editorAction uses the class
class
ToggleCommentLineAction
extends
CommentLineAction
{
constructor
()
{
super
(
Type
.
Toggle
,
{
...
...
@@ -59,8 +57,6 @@ class ToggleCommentLineAction extends CommentLineAction {
}
}
@
editorAction
// @ts-ignore @editorAction uses the class
class
AddLineCommentAction
extends
CommentLineAction
{
constructor
()
{
super
(
Type
.
ForceAdd
,
{
...
...
@@ -76,8 +72,6 @@ class AddLineCommentAction extends CommentLineAction {
}
}
@
editorAction
// @ts-ignore @editorAction uses the class
class
RemoveLineCommentAction
extends
CommentLineAction
{
constructor
()
{
super
(
Type
.
ForceRemove
,
{
...
...
@@ -93,8 +87,6 @@ class RemoveLineCommentAction extends CommentLineAction {
}
}
@
editorAction
// @ts-ignore @editorAction uses the class
class
BlockCommentAction
extends
EditorAction
{
constructor
()
{
...
...
@@ -124,3 +116,8 @@ class BlockCommentAction extends EditorAction {
editor
.
pushUndoStop
();
}
}
registerEditorAction
(
new
ToggleCommentLineAction
());
registerEditorAction
(
new
AddLineCommentAction
());
registerEditorAction
(
new
RemoveLineCommentAction
());
registerEditorAction
(
new
BlockCommentAction
());
src/vs/editor/contrib/contextmenu/browser/contextmenu.ts
浏览文件 @
6217946d
...
...
@@ -18,7 +18,7 @@ import { IContextKeyService } from 'vs/platform/contextkey/common/contextkey';
import
{
IMenuService
,
MenuId
}
from
'
vs/platform/actions/common/actions
'
;
import
{
ICommonCodeEditor
,
IEditorContribution
,
IScrollEvent
,
ScrollType
}
from
'
vs/editor/common/editorCommon
'
;
import
{
EditorContextKeys
}
from
'
vs/editor/common/editorContextKeys
'
;
import
{
e
ditorAction
,
ServicesAccessor
,
EditorAction
}
from
'
vs/editor/common/editorCommonExtensions
'
;
import
{
registerE
ditorAction
,
ServicesAccessor
,
EditorAction
}
from
'
vs/editor/common/editorCommonExtensions
'
;
import
{
ICodeEditor
,
IEditorMouseEvent
,
MouseTargetType
}
from
'
vs/editor/browser/editorBrowser
'
;
import
{
editorContribution
}
from
'
vs/editor/browser/editorBrowserExtensions
'
;
...
...
@@ -217,8 +217,6 @@ export class ContextMenuController implements IEditorContribution {
}
}
@
editorAction
// @ts-ignore @editorAction uses the class
class
ShowContextMenu
extends
EditorAction
{
constructor
()
{
...
...
@@ -239,3 +237,5 @@ class ShowContextMenu extends EditorAction {
contribution
.
showContextMenu
();
}
}
registerEditorAction
(
new
ShowContextMenu
());
src/vs/editor/contrib/find/common/findController.ts
浏览文件 @
6217946d
...
...
@@ -11,7 +11,7 @@ import { Disposable } from 'vs/base/common/lifecycle';
import
{
ContextKeyExpr
,
RawContextKey
,
IContextKey
,
IContextKeyService
}
from
'
vs/platform/contextkey/common/contextkey
'
;
import
*
as
strings
from
'
vs/base/common/strings
'
;
import
*
as
editorCommon
from
'
vs/editor/common/editorCommon
'
;
import
{
e
ditorAction
,
ServicesAccessor
,
EditorAction
,
EditorCommand
,
CommonEditorRegistry
}
from
'
vs/editor/common/editorCommonExtensions
'
;
import
{
registerE
ditorAction
,
ServicesAccessor
,
EditorAction
,
EditorCommand
,
CommonEditorRegistry
}
from
'
vs/editor/common/editorCommonExtensions
'
;
import
{
FIND_IDS
,
FindModelBoundToEditorModel
,
ToggleCaseSensitiveKeybinding
,
ToggleRegexKeybinding
,
ToggleWholeWordKeybinding
,
ToggleSearchScopeKeybinding
,
ShowPreviousFindTermKeybinding
,
ShowNextFindTermKeybinding
}
from
'
vs/editor/contrib/find/common/findModel
'
;
import
{
FindReplaceState
,
FindReplaceStateChangedEvent
,
INewFindReplaceState
}
from
'
vs/editor/contrib/find/common/findState
'
;
import
{
getSelectionSearchString
}
from
'
vs/editor/contrib/find/common/find
'
;
...
...
@@ -303,7 +303,6 @@ export class CommonFindController extends Disposable implements editorCommon.IEd
}
}
@
editorAction
export
class
StartFindAction
extends
EditorAction
{
constructor
()
{
...
...
@@ -353,7 +352,6 @@ export abstract class MatchFindAction extends EditorAction {
protected
abstract
_run
(
controller
:
CommonFindController
):
boolean
;
}
@
editorAction
export
class
NextMatchFindAction
extends
MatchFindAction
{
constructor
()
{
...
...
@@ -375,7 +373,6 @@ export class NextMatchFindAction extends MatchFindAction {
}
}
@
editorAction
export
class
PreviousMatchFindAction
extends
MatchFindAction
{
constructor
()
{
...
...
@@ -421,7 +418,6 @@ export abstract class SelectionMatchFindAction extends EditorAction {
protected
abstract
_run
(
controller
:
CommonFindController
):
boolean
;
}
@
editorAction
export
class
NextSelectionMatchFindAction
extends
SelectionMatchFindAction
{
constructor
()
{
...
...
@@ -442,7 +438,6 @@ export class NextSelectionMatchFindAction extends SelectionMatchFindAction {
}
}
@
editorAction
export
class
PreviousSelectionMatchFindAction
extends
SelectionMatchFindAction
{
constructor
()
{
...
...
@@ -463,7 +458,6 @@ export class PreviousSelectionMatchFindAction extends SelectionMatchFindAction {
}
}
@
editorAction
export
class
StartFindReplaceAction
extends
EditorAction
{
constructor
()
{
...
...
@@ -507,8 +501,6 @@ export class StartFindReplaceAction extends EditorAction {
}
}
@
editorAction
export
class
ShowNextFindTermAction
extends
MatchFindAction
{
constructor
()
{
...
...
@@ -533,8 +525,7 @@ export class ShowNextFindTermAction extends MatchFindAction {
}
}
@
editorAction
export
class
ShpwPreviousFindTermAction
extends
MatchFindAction
{
export
class
ShowPreviousFindTermAction
extends
MatchFindAction
{
constructor
()
{
super
({
...
...
@@ -558,6 +549,15 @@ export class ShpwPreviousFindTermAction extends MatchFindAction {
}
}
registerEditorAction
(
new
StartFindAction
());
registerEditorAction
(
new
NextMatchFindAction
());
registerEditorAction
(
new
PreviousMatchFindAction
());
registerEditorAction
(
new
NextSelectionMatchFindAction
());
registerEditorAction
(
new
PreviousSelectionMatchFindAction
());
registerEditorAction
(
new
StartFindReplaceAction
());
registerEditorAction
(
new
ShowNextFindTermAction
());
registerEditorAction
(
new
ShowPreviousFindTermAction
());
const
FindCommand
=
EditorCommand
.
bindToContribution
<
CommonFindController
>
(
CommonFindController
.
get
);
CommonEditorRegistry
.
registerEditorCommand
(
new
FindCommand
({
...
...
@@ -659,4 +659,4 @@ CommonEditorRegistry.registerEditorCommand(new FindCommand({
kbExpr
:
EditorContextKeys
.
focus
,
primary
:
KeyMod
.
Alt
|
KeyCode
.
Enter
}
}));
\ No newline at end of file
}));
src/vs/editor/contrib/folding/browser/folding.ts
浏览文件 @
6217946d
...
...
@@ -14,7 +14,7 @@ import { KeyCode, KeyMod, KeyChord } from 'vs/base/common/keyCodes';
import
{
IDisposable
,
dispose
}
from
'
vs/base/common/lifecycle
'
;
import
{
TPromise
}
from
'
vs/base/common/winjs.base
'
;
import
{
ICommonCodeEditor
,
ScrollType
,
IModel
}
from
'
vs/editor/common/editorCommon
'
;
import
{
e
ditorAction
,
ServicesAccessor
,
EditorAction
,
CommonEditorRegistry
}
from
'
vs/editor/common/editorCommonExtensions
'
;
import
{
registerE
ditorAction
,
ServicesAccessor
,
EditorAction
,
CommonEditorRegistry
}
from
'
vs/editor/common/editorCommonExtensions
'
;
import
{
ICodeEditor
,
IEditorMouseEvent
,
MouseTargetType
}
from
'
vs/editor/browser/editorBrowser
'
;
import
{
editorContribution
}
from
'
vs/editor/browser/editorBrowserExtensions
'
;
import
{
FoldingModel
,
setCollapseStateAtLevel
,
CollapseMemento
,
setCollapseStateLevelsDown
,
setCollapseStateLevelsUp
}
from
'
vs/editor/contrib/folding/common/foldingModel
'
;
...
...
@@ -362,8 +362,6 @@ function foldingArgumentsConstraint(args: any) {
return
true
;
}
@
editorAction
// @ts-ignore @editorAction uses the class
class
UnfoldAction
extends
FoldingAction
<
FoldingArguments
>
{
constructor
()
{
...
...
@@ -407,8 +405,6 @@ class UnfoldAction extends FoldingAction<FoldingArguments> {
}
}
@
editorAction
// @ts-ignore @editorAction uses the class
class
UnFoldRecursivelyAction
extends
FoldingAction
<
void
>
{
constructor
()
{
...
...
@@ -429,8 +425,6 @@ class UnFoldRecursivelyAction extends FoldingAction<void> {
}
}
@
editorAction
// @ts-ignore @editorAction uses the class
class
FoldAction
extends
FoldingAction
<
FoldingArguments
>
{
constructor
()
{
...
...
@@ -474,8 +468,6 @@ class FoldAction extends FoldingAction<FoldingArguments> {
}
}
@
editorAction
// @ts-ignore @editorAction uses the class
class
FoldRecursivelyAction
extends
FoldingAction
<
void
>
{
constructor
()
{
...
...
@@ -501,8 +493,6 @@ class FoldRecursivelyAction extends FoldingAction<void> {
}
}
@
editorAction
// @ts-ignore @editorAction uses the class
class
FoldAllAction
extends
FoldingAction
<
void
>
{
constructor
()
{
...
...
@@ -523,8 +513,6 @@ class FoldAllAction extends FoldingAction<void> {
}
}
@
editorAction
// @ts-ignore @editorAction uses the class
class
UnfoldAllAction
extends
FoldingAction
<
void
>
{
constructor
()
{
...
...
@@ -558,6 +546,13 @@ class FoldLevelAction extends FoldingAction<void> {
}
}
registerEditorAction
(
new
UnfoldAction
());
registerEditorAction
(
new
UnFoldRecursivelyAction
());
registerEditorAction
(
new
FoldAction
());
registerEditorAction
(
new
FoldRecursivelyAction
());
registerEditorAction
(
new
FoldAllAction
());
registerEditorAction
(
new
UnfoldAllAction
());
for
(
let
i
=
1
;
i
<=
9
;
i
++
)
{
CommonEditorRegistry
.
registerEditorAction
(
new
FoldLevelAction
({
...
...
src/vs/editor/contrib/format/browser/formatActions.ts
浏览文件 @
6217946d
...
...
@@ -11,7 +11,7 @@ import { IDisposable, dispose } from 'vs/base/common/lifecycle';
import
{
TPromise
}
from
'
vs/base/common/winjs.base
'
;
import
*
as
editorCommon
from
'
vs/editor/common/editorCommon
'
;
import
{
ContextKeyExpr
}
from
'
vs/platform/contextkey/common/contextkey
'
;
import
{
e
ditorAction
,
ServicesAccessor
,
EditorAction
,
commonEditorContribution
,
IActionOptions
}
from
'
vs/editor/common/editorCommonExtensions
'
;
import
{
registerE
ditorAction
,
ServicesAccessor
,
EditorAction
,
commonEditorContribution
,
IActionOptions
}
from
'
vs/editor/common/editorCommonExtensions
'
;
import
{
OnTypeFormattingEditProviderRegistry
,
DocumentRangeFormattingEditProviderRegistry
}
from
'
vs/editor/common/modes
'
;
import
{
getOnTypeFormattingEdits
,
getDocumentFormattingEdits
,
getDocumentRangeFormattingEdits
,
NoProviderError
}
from
'
../common/format
'
;
import
{
EditOperationsCommand
}
from
'
../common/formatCommand
'
;
...
...
@@ -300,8 +300,6 @@ export abstract class AbstractFormatAction extends EditorAction {
protected
abstract
_getFormattingEdits
(
editor
:
editorCommon
.
ICommonCodeEditor
):
TPromise
<
editorCommon
.
ISingleEditOperation
[]
>
;
}
@
editorAction
export
class
FormatDocumentAction
extends
AbstractFormatAction
{
constructor
()
{
...
...
@@ -331,7 +329,6 @@ export class FormatDocumentAction extends AbstractFormatAction {
}
}
@
editorAction
export
class
FormatSelectionAction
extends
AbstractFormatAction
{
constructor
()
{
...
...
@@ -359,6 +356,9 @@ export class FormatSelectionAction extends AbstractFormatAction {
}
}
registerEditorAction
(
new
FormatDocumentAction
());
registerEditorAction
(
new
FormatSelectionAction
());
// this is the old format action that does both (format document OR format selection)
// and we keep it here such that existing keybinding configurations etc will still work
CommandsRegistry
.
registerCommand
(
'
editor.action.format
'
,
accessor
=>
{
...
...
src/vs/editor/contrib/goToDeclaration/browser/goToDeclarationCommands.ts
浏览文件 @
6217946d
...
...
@@ -15,7 +15,7 @@ import { IEditorService } from 'vs/platform/editor/common/editor';
import
{
IMessageService
}
from
'
vs/platform/message/common/message
'
;
import
{
Range
}
from
'
vs/editor/common/core/range
'
;
import
*
as
editorCommon
from
'
vs/editor/common/editorCommon
'
;
import
{
e
ditorAction
,
IActionOptions
,
ServicesAccessor
,
EditorAction
}
from
'
vs/editor/common/editorCommonExtensions
'
;
import
{
registerE
ditorAction
,
IActionOptions
,
ServicesAccessor
,
EditorAction
}
from
'
vs/editor/common/editorCommonExtensions
'
;
import
{
Location
}
from
'
vs/editor/common/modes
'
;
import
{
getDefinitionsAtPosition
,
getImplementationsAtPosition
,
getTypeDefinitionsAtPosition
}
from
'
./goToDeclaration
'
;
import
{
ReferencesController
}
from
'
vs/editor/contrib/referenceSearch/browser/referencesController
'
;
...
...
@@ -180,7 +180,6 @@ const goToDeclarationKb = platform.isWeb
?
KeyMod
.
CtrlCmd
|
KeyCode
.
F12
:
KeyCode
.
F12
;
@
editorAction
export
class
GoToDefinitionAction
extends
DefinitionAction
{
public
static
ID
=
'
editor.action.goToDeclaration
'
;
...
...
@@ -205,7 +204,6 @@ export class GoToDefinitionAction extends DefinitionAction {
}
}
@
editorAction
export
class
OpenDefinitionToSideAction
extends
DefinitionAction
{
public
static
ID
=
'
editor.action.openDeclarationToTheSide
'
;
...
...
@@ -226,7 +224,6 @@ export class OpenDefinitionToSideAction extends DefinitionAction {
}
}
@
editorAction
export
class
PeekDefinitionAction
extends
DefinitionAction
{
constructor
()
{
super
(
new
DefinitionActionConfig
(
void
0
,
true
,
false
),
{
...
...
@@ -266,7 +263,6 @@ export class ImplementationAction extends DefinitionAction {
}
}
@
editorAction
export
class
GoToImplementationAction
extends
ImplementationAction
{
public
static
ID
=
'
editor.action.goToImplementation
'
;
...
...
@@ -287,7 +283,6 @@ export class GoToImplementationAction extends ImplementationAction {
}
}
@
editorAction
export
class
PeekImplementationAction
extends
ImplementationAction
{
public
static
ID
=
'
editor.action.peekImplementation
'
;
...
...
@@ -324,7 +319,6 @@ export class TypeDefinitionAction extends DefinitionAction {
}
}
@
editorAction
export
class
GoToTypeDefintionAction
extends
TypeDefinitionAction
{
public
static
ID
=
'
editor.action.goToTypeDefinition
'
;
...
...
@@ -349,7 +343,6 @@ export class GoToTypeDefintionAction extends TypeDefinitionAction {
}
}
@
editorAction
export
class
PeekTypeDefinitionAction
extends
TypeDefinitionAction
{
public
static
ID
=
'
editor.action.peekTypeDefinition
'
;
...
...
@@ -370,3 +363,10 @@ export class PeekTypeDefinitionAction extends TypeDefinitionAction {
}
}
registerEditorAction
(
new
GoToDefinitionAction
());
registerEditorAction
(
new
OpenDefinitionToSideAction
());
registerEditorAction
(
new
PeekDefinitionAction
());
registerEditorAction
(
new
GoToImplementationAction
());
registerEditorAction
(
new
PeekImplementationAction
());
registerEditorAction
(
new
GoToTypeDefintionAction
());
registerEditorAction
(
new
PeekTypeDefinitionAction
());
src/vs/editor/contrib/gotoError/browser/gotoError.ts
浏览文件 @
6217946d
...
...
@@ -19,7 +19,7 @@ import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry';
import
{
Position
}
from
'
vs/editor/common/core/position
'
;
import
{
Range
}
from
'
vs/editor/common/core/range
'
;
import
*
as
editorCommon
from
'
vs/editor/common/editorCommon
'
;
import
{
e
ditorAction
,
ServicesAccessor
,
IActionOptions
,
EditorAction
,
EditorCommand
,
CommonEditorRegistry
}
from
'
vs/editor/common/editorCommonExtensions
'
;
import
{
registerE
ditorAction
,
ServicesAccessor
,
IActionOptions
,
EditorAction
,
EditorCommand
,
CommonEditorRegistry
}
from
'
vs/editor/common/editorCommonExtensions
'
;
import
{
ICodeEditor
}
from
'
vs/editor/browser/editorBrowser
'
;
import
{
editorContribution
}
from
'
vs/editor/browser/editorBrowserExtensions
'
;
import
{
ZoneWidget
}
from
'
vs/editor/contrib/zoneWidget/browser/zoneWidget
'
;
...
...
@@ -503,8 +503,6 @@ class MarkerController implements editorCommon.IEditorContribution {
}
}
@
editorAction
// @ts-ignore @editorAction uses the class
class
NextMarkerAction
extends
MarkerNavigationAction
{
constructor
()
{
super
(
true
,
{
...
...
@@ -520,8 +518,6 @@ class NextMarkerAction extends MarkerNavigationAction {
}
}
@
editorAction
// @ts-ignore @editorAction uses the class
class
PrevMarkerAction
extends
MarkerNavigationAction
{
constructor
()
{
super
(
false
,
{
...
...
@@ -537,6 +533,9 @@ class PrevMarkerAction extends MarkerNavigationAction {
}
}
registerEditorAction
(
new
NextMarkerAction
());
registerEditorAction
(
new
PrevMarkerAction
());
const
CONTEXT_MARKERS_NAVIGATION_VISIBLE
=
new
RawContextKey
<
boolean
>
(
'
markersNavigationVisible
'
,
false
);
const
MarkerCommand
=
EditorCommand
.
bindToContribution
<
MarkerController
>
(
MarkerController
.
get
);
...
...
src/vs/editor/contrib/hover/browser/hover.ts
浏览文件 @
6217946d
...
...
@@ -14,7 +14,7 @@ import { IOpenerService } from 'vs/platform/opener/common/opener';
import
{
IModeService
}
from
'
vs/editor/common/services/modeService
'
;
import
{
Range
}
from
'
vs/editor/common/core/range
'
;
import
*
as
editorCommon
from
'
vs/editor/common/editorCommon
'
;
import
{
e
ditorAction
,
ServicesAccessor
,
EditorAction
}
from
'
vs/editor/common/editorCommonExtensions
'
;
import
{
registerE
ditorAction
,
ServicesAccessor
,
EditorAction
}
from
'
vs/editor/common/editorCommonExtensions
'
;
import
{
ICodeEditor
,
IEditorMouseEvent
,
MouseTargetType
}
from
'
vs/editor/browser/editorBrowser
'
;
import
{
editorContribution
}
from
'
vs/editor/browser/editorBrowserExtensions
'
;
import
{
ModesContentHoverWidget
}
from
'
./modesContentHover
'
;
...
...
@@ -169,8 +169,6 @@ export class ModesHoverController implements editorCommon.IEditorContribution {
}
}
@
editorAction
// @ts-ignore @editorAction uses the class
class
ShowHoverAction
extends
EditorAction
{
constructor
()
{
...
...
@@ -197,6 +195,8 @@ class ShowHoverAction extends EditorAction {
}
}
registerEditorAction
(
new
ShowHoverAction
());
// theming
registerThemingParticipant
((
theme
,
collector
)
=>
{
let
editorHoverHighlightColor
=
theme
.
getColor
(
editorHoverHighlight
);
...
...
src/vs/editor/contrib/inPlaceReplace/common/inPlaceReplace.ts
浏览文件 @
6217946d
...
...
@@ -11,7 +11,7 @@ import { Range } from 'vs/editor/common/core/range';
import
{
Selection
}
from
'
vs/editor/common/core/selection
'
;
import
{
IEditorContribution
,
ICommonCodeEditor
,
IModelDecorationsChangeAccessor
}
from
'
vs/editor/common/editorCommon
'
;
import
{
EditorContextKeys
}
from
'
vs/editor/common/editorContextKeys
'
;
import
{
e
ditorAction
,
ServicesAccessor
,
EditorAction
,
commonEditorContribution
}
from
'
vs/editor/common/editorCommonExtensions
'
;
import
{
registerE
ditorAction
,
ServicesAccessor
,
EditorAction
,
commonEditorContribution
}
from
'
vs/editor/common/editorCommonExtensions
'
;
import
{
IInplaceReplaceSupportResult
}
from
'
vs/editor/common/modes
'
;
import
{
IEditorWorkerService
}
from
'
vs/editor/common/services/editorWorkerService
'
;
import
{
InPlaceReplaceCommand
}
from
'
./inPlaceReplaceCommand
'
;
...
...
@@ -138,8 +138,6 @@ class InPlaceReplaceController implements IEditorContribution {
}
}
@
editorAction
// @ts-ignore @editorAction uses the class
class
InPlaceReplaceUp
extends
EditorAction
{
constructor
()
{
...
...
@@ -164,8 +162,6 @@ class InPlaceReplaceUp extends EditorAction {
}
}
@
editorAction
// @ts-ignore @editorAction uses the class
class
InPlaceReplaceDown
extends
EditorAction
{
constructor
()
{
...
...
@@ -190,9 +186,12 @@ class InPlaceReplaceDown extends EditorAction {
}
}
registerEditorAction
(
new
InPlaceReplaceUp
());
registerEditorAction
(
new
InPlaceReplaceDown
());
registerThemingParticipant
((
theme
,
collector
)
=>
{
let
border
=
theme
.
getColor
(
editorBracketMatchBorder
);
if
(
border
)
{
collector
.
addRule
(
`.monaco-editor.vs .valueSetReplacement { outline: solid 2px
${
border
}
; }`
);
}
});
\ No newline at end of file
});
src/vs/editor/contrib/indentation/common/indentation.ts
浏览文件 @
6217946d
...
...
@@ -9,7 +9,7 @@ import { TPromise } from 'vs/base/common/winjs.base';
import
*
as
strings
from
'
vs/base/common/strings
'
;
import
{
ICommonCodeEditor
,
IEditorContribution
,
IIdentifiedSingleEditOperation
,
ICommand
,
ICursorStateComputerData
,
IEditOperationBuilder
,
ITokenizedModel
,
EndOfLineSequence
}
from
'
vs/editor/common/editorCommon
'
;
import
{
EditorContextKeys
}
from
'
vs/editor/common/editorContextKeys
'
;
import
{
e
ditorAction
,
ServicesAccessor
,
IActionOptions
,
EditorAction
,
commonEditorContribution
}
from
'
vs/editor/common/editorCommonExtensions
'
;
import
{
registerE
ditorAction
,
ServicesAccessor
,
IActionOptions
,
EditorAction
,
commonEditorContribution
}
from
'
vs/editor/common/editorCommonExtensions
'
;
import
{
IQuickOpenService
}
from
'
vs/platform/quickOpen/common/quickOpen
'
;
import
{
IModelService
}
from
'
vs/editor/common/services/modelService
'
;
import
{
Range
}
from
'
vs/editor/common/core/range
'
;
...
...
@@ -147,7 +147,6 @@ export function getReindentEditOperations(model: ITokenizedModel, startLineNumbe
return
indentEdits
;
}
@
editorAction
export
class
IndentationToSpacesAction
extends
EditorAction
{
public
static
ID
=
'
editor.action.indentationToSpaces
'
;
...
...
@@ -178,7 +177,6 @@ export class IndentationToSpacesAction extends EditorAction {
}
}
@
editorAction
export
class
IndentationToTabsAction
extends
EditorAction
{
public
static
ID
=
'
editor.action.indentationToTabs
'
;
...
...
@@ -248,7 +246,6 @@ export class ChangeIndentationSizeAction extends EditorAction {
}
}
@
editorAction
export
class
IndentUsingTabs
extends
ChangeIndentationSizeAction
{
public
static
ID
=
'
editor.action.indentUsingTabs
'
;
...
...
@@ -263,7 +260,6 @@ export class IndentUsingTabs extends ChangeIndentationSizeAction {
}
}
@
editorAction
export
class
IndentUsingSpaces
extends
ChangeIndentationSizeAction
{
public
static
ID
=
'
editor.action.indentUsingSpaces
'
;
...
...
@@ -278,7 +274,6 @@ export class IndentUsingSpaces extends ChangeIndentationSizeAction {
}
}
@
editorAction
export
class
DetectIndentation
extends
EditorAction
{
public
static
ID
=
'
editor.action.detectIndentation
'
;
...
...
@@ -305,7 +300,6 @@ export class DetectIndentation extends EditorAction {
}
}
@
editorAction
export
class
ReindentLinesAction
extends
EditorAction
{
constructor
()
{
super
({
...
...
@@ -333,7 +327,7 @@ export class ReindentLinesAction extends EditorAction {
export
class
AutoIndentOnPasteCommand
implements
ICommand
{
private
_edits
:
TextEdit
[];
// @ts-ignore
@editorAction
unused property
// @ts-ignore unused property
private
_newEol
:
EndOfLineSequence
;
private
_initialSelection
:
Selection
;
...
...
@@ -621,3 +615,10 @@ export class IndentationToTabsCommand implements ICommand {
return
helper
.
getTrackedSelection
(
this
.
selectionId
);
}
}
registerEditorAction
(
new
IndentationToSpacesAction
());
registerEditorAction
(
new
IndentationToTabsAction
());
registerEditorAction
(
new
IndentUsingTabs
());
registerEditorAction
(
new
IndentUsingSpaces
());
registerEditorAction
(
new
DetectIndentation
());
registerEditorAction
(
new
ReindentLinesAction
());
src/vs/editor/contrib/linesOperations/common/linesOperations.ts
浏览文件 @
6217946d
...
...
@@ -15,7 +15,7 @@ import { ReplaceCommand, ReplaceCommandThatPreservesSelection } from 'vs/editor/
import
{
Range
}
from
'
vs/editor/common/core/range
'
;
import
{
Selection
}
from
'
vs/editor/common/core/selection
'
;
import
{
Position
}
from
'
vs/editor/common/core/position
'
;
import
{
e
ditorAction
,
ServicesAccessor
,
IActionOptions
,
EditorAction
}
from
'
vs/editor/common/editorCommonExtensions
'
;
import
{
registerE
ditorAction
,
ServicesAccessor
,
IActionOptions
,
EditorAction
}
from
'
vs/editor/common/editorCommonExtensions
'
;
import
{
CopyLinesCommand
}
from
'
./copyLinesCommand
'
;
import
{
DeleteLinesCommand
}
from
'
./deleteLinesCommand
'
;
import
{
MoveLinesCommand
}
from
'
./moveLinesCommand
'
;
...
...
@@ -48,8 +48,6 @@ abstract class AbstractCopyLinesAction extends EditorAction {
}
}
@
editorAction
// @ts-ignore @editorAction uses the class
class
CopyLinesUpAction
extends
AbstractCopyLinesAction
{
constructor
()
{
super
(
false
,
{
...
...
@@ -66,8 +64,6 @@ class CopyLinesUpAction extends AbstractCopyLinesAction {
}
}
@
editorAction
// @ts-ignore @editorAction uses the class
class
CopyLinesDownAction
extends
AbstractCopyLinesAction
{
constructor
()
{
super
(
true
,
{
...
...
@@ -111,8 +107,6 @@ abstract class AbstractMoveLinesAction extends EditorAction {
}
}
@
editorAction
// @ts-ignore @editorAction uses the class
class
MoveLinesUpAction
extends
AbstractMoveLinesAction
{
constructor
()
{
super
(
false
,
{
...
...
@@ -129,8 +123,6 @@ class MoveLinesUpAction extends AbstractMoveLinesAction {
}
}
@
editorAction
// @ts-ignore @editorAction uses the class
class
MoveLinesDownAction
extends
AbstractMoveLinesAction
{
constructor
()
{
super
(
true
,
{
...
...
@@ -169,8 +161,6 @@ abstract class AbstractSortLinesAction extends EditorAction {
}
}
@
editorAction
// @ts-ignore @editorAction uses the class
class
SortLinesAscendingAction
extends
AbstractSortLinesAction
{
constructor
()
{
super
(
false
,
{
...
...
@@ -182,8 +172,6 @@ class SortLinesAscendingAction extends AbstractSortLinesAction {
}
}
@
editorAction
// @ts-ignore @editorAction uses the class
class
SortLinesDescendingAction
extends
AbstractSortLinesAction
{
constructor
()
{
super
(
true
,
{
...
...
@@ -195,7 +183,6 @@ class SortLinesDescendingAction extends AbstractSortLinesAction {
}
}
@
editorAction
export
class
TrimTrailingWhitespaceAction
extends
EditorAction
{
public
static
ID
=
'
editor.action.trimTrailingWhitespace
'
;
...
...
@@ -281,8 +268,6 @@ abstract class AbstractRemoveLinesAction extends EditorAction {
}
}
@
editorAction
// @ts-ignore @editorAction uses the class
class
DeleteLinesAction
extends
AbstractRemoveLinesAction
{
constructor
()
{
...
...
@@ -313,7 +298,6 @@ class DeleteLinesAction extends AbstractRemoveLinesAction {
}
}
@
editorAction
export
class
IndentLinesAction
extends
EditorAction
{
constructor
()
{
super
({
...
...
@@ -335,8 +319,6 @@ export class IndentLinesAction extends EditorAction {
}
}
@
editorAction
// @ts-ignore @editorAction uses the class
class
OutdentLinesAction
extends
EditorAction
{
constructor
()
{
super
({
...
...
@@ -356,7 +338,6 @@ class OutdentLinesAction extends EditorAction {
}
}
@
editorAction
export
class
InsertLineBeforeAction
extends
EditorAction
{
constructor
()
{
super
({
...
...
@@ -377,7 +358,6 @@ export class InsertLineBeforeAction extends EditorAction {
}
}
@
editorAction
export
class
InsertLineAfterAction
extends
EditorAction
{
constructor
()
{
super
({
...
...
@@ -437,7 +417,6 @@ export abstract class AbstractDeleteAllToBoundaryAction extends EditorAction {
protected
abstract
_getRangesToDelete
(
editor
:
ICommonCodeEditor
):
Range
[];
}
@
editorAction
export
class
DeleteAllLeftAction
extends
AbstractDeleteAllToBoundaryAction
{
constructor
()
{
super
({
...
...
@@ -491,7 +470,6 @@ export class DeleteAllLeftAction extends AbstractDeleteAllToBoundaryAction {
}
}
@
editorAction
export
class
DeleteAllRightAction
extends
AbstractDeleteAllToBoundaryAction
{
constructor
()
{
super
({
...
...
@@ -549,7 +527,6 @@ export class DeleteAllRightAction extends AbstractDeleteAllToBoundaryAction {
}
}
@
editorAction
export
class
JoinLinesAction
extends
EditorAction
{
constructor
()
{
super
({
...
...
@@ -698,7 +675,6 @@ export class JoinLinesAction extends EditorAction {
}
}
@
editorAction
export
class
TransposeAction
extends
EditorAction
{
constructor
()
{
super
({
...
...
@@ -784,7 +760,6 @@ export abstract class AbstractCaseAction extends EditorAction {
protected
abstract
_modifyText
(
text
:
string
):
string
;
}
@
editorAction
export
class
UpperCaseAction
extends
AbstractCaseAction
{
constructor
()
{
super
({
...
...
@@ -800,7 +775,6 @@ export class UpperCaseAction extends AbstractCaseAction {
}
}
@
editorAction
export
class
LowerCaseAction
extends
AbstractCaseAction
{
constructor
()
{
super
({
...
...
@@ -815,3 +789,22 @@ export class LowerCaseAction extends AbstractCaseAction {
return
text
.
toLocaleLowerCase
();
}
}
registerEditorAction
(
new
CopyLinesUpAction
());
registerEditorAction
(
new
CopyLinesDownAction
());
registerEditorAction
(
new
MoveLinesUpAction
());
registerEditorAction
(
new
MoveLinesDownAction
());
registerEditorAction
(
new
SortLinesAscendingAction
());
registerEditorAction
(
new
SortLinesDescendingAction
());
registerEditorAction
(
new
TrimTrailingWhitespaceAction
());
registerEditorAction
(
new
DeleteLinesAction
());
registerEditorAction
(
new
IndentLinesAction
());
registerEditorAction
(
new
OutdentLinesAction
());
registerEditorAction
(
new
InsertLineBeforeAction
());
registerEditorAction
(
new
InsertLineAfterAction
());
registerEditorAction
(
new
DeleteAllLeftAction
());
registerEditorAction
(
new
DeleteAllRightAction
());
registerEditorAction
(
new
JoinLinesAction
());
registerEditorAction
(
new
TransposeAction
());
registerEditorAction
(
new
UpperCaseAction
());
registerEditorAction
(
new
LowerCaseAction
());
src/vs/editor/contrib/links/browser/links.ts
浏览文件 @
6217946d
...
...
@@ -14,7 +14,7 @@ import { TPromise } from 'vs/base/common/winjs.base';
import
{
IMessageService
}
from
'
vs/platform/message/common/message
'
;
import
{
IOpenerService
}
from
'
vs/platform/opener/common/opener
'
;
import
*
as
editorCommon
from
'
vs/editor/common/editorCommon
'
;
import
{
e
ditorAction
,
ServicesAccessor
,
EditorAction
}
from
'
vs/editor/common/editorCommonExtensions
'
;
import
{
registerE
ditorAction
,
ServicesAccessor
,
EditorAction
}
from
'
vs/editor/common/editorCommonExtensions
'
;
import
{
LinkProviderRegistry
}
from
'
vs/editor/common/modes
'
;
import
{
ICodeEditor
,
MouseTargetType
}
from
'
vs/editor/browser/editorBrowser
'
;
import
{
getLinks
,
Link
}
from
'
vs/editor/contrib/links/common/links
'
;
...
...
@@ -384,8 +384,6 @@ class LinkDetector implements editorCommon.IEditorContribution {
}
}
@
editorAction
// @ts-ignore @editorAction uses the class
class
OpenLinkAction
extends
EditorAction
{
constructor
()
{
...
...
@@ -410,6 +408,8 @@ class OpenLinkAction extends EditorAction {
}
}
registerEditorAction
(
new
OpenLinkAction
());
registerThemingParticipant
((
theme
,
collector
)
=>
{
let
activeLinkForeground
=
theme
.
getColor
(
editorActiveLinkForeground
);
if
(
activeLinkForeground
)
{
...
...
src/vs/editor/contrib/multicursor/common/multicursor.ts
浏览文件 @
6217946d
...
...
@@ -10,7 +10,7 @@ import { KeyCode, KeyMod, KeyChord } from 'vs/base/common/keyCodes';
import
{
RunOnceScheduler
}
from
'
vs/base/common/async
'
;
import
{
ICommonCodeEditor
,
ScrollType
,
IEditorContribution
,
FindMatch
,
TrackedRangeStickiness
,
OverviewRulerLane
,
IModel
}
from
'
vs/editor/common/editorCommon
'
;
import
{
EditorContextKeys
}
from
'
vs/editor/common/editorContextKeys
'
;
import
{
e
ditorAction
,
commonEditorContribution
,
ServicesAccessor
,
EditorAction
}
from
'
vs/editor/common/editorCommonExtensions
'
;
import
{
registerE
ditorAction
,
commonEditorContribution
,
ServicesAccessor
,
EditorAction
}
from
'
vs/editor/common/editorCommonExtensions
'
;
import
{
Range
}
from
'
vs/editor/common/core/range
'
;
import
{
Selection
}
from
'
vs/editor/common/core/selection
'
;
import
{
CursorChangeReason
,
ICursorSelectionChangedEvent
}
from
'
vs/editor/common/controller/cursorEvents
'
;
...
...
@@ -24,7 +24,6 @@ import { overviewRulerSelectionHighlightForeground } from 'vs/platform/theme/com
import
{
themeColorFromId
}
from
'
vs/platform/theme/common/themeService
'
;
import
{
INewFindReplaceState
,
FindOptionOverride
}
from
'
vs/editor/contrib/find/common/findState
'
;
@
editorAction
export
class
InsertCursorAbove
extends
EditorAction
{
constructor
()
{
super
({
...
...
@@ -64,7 +63,6 @@ export class InsertCursorAbove extends EditorAction {
}
}
@
editorAction
export
class
InsertCursorBelow
extends
EditorAction
{
constructor
()
{
super
({
...
...
@@ -104,8 +102,6 @@ export class InsertCursorBelow extends EditorAction {
}
}
@
editorAction
// @ts-ignore @editorAction uses the class
class
InsertCursorAtEndOfEachLineSelected
extends
EditorAction
{
constructor
()
{
...
...
@@ -522,7 +518,6 @@ export abstract class MultiCursorSelectionControllerAction extends EditorAction
protected
abstract
_run
(
multiCursorController
:
MultiCursorSelectionController
,
findController
:
CommonFindController
):
void
;
}
@
editorAction
export
class
AddSelectionToNextFindMatchAction
extends
MultiCursorSelectionControllerAction
{
constructor
()
{
super
({
...
...
@@ -541,7 +536,6 @@ export class AddSelectionToNextFindMatchAction extends MultiCursorSelectionContr
}
}
@
editorAction
export
class
AddSelectionToPreviousFindMatchAction
extends
MultiCursorSelectionControllerAction
{
constructor
()
{
super
({
...
...
@@ -556,7 +550,6 @@ export class AddSelectionToPreviousFindMatchAction extends MultiCursorSelectionC
}
}
@
editorAction
export
class
MoveSelectionToNextFindMatchAction
extends
MultiCursorSelectionControllerAction
{
constructor
()
{
super
({
...
...
@@ -575,7 +568,6 @@ export class MoveSelectionToNextFindMatchAction extends MultiCursorSelectionCont
}
}
@
editorAction
export
class
MoveSelectionToPreviousFindMatchAction
extends
MultiCursorSelectionControllerAction
{
constructor
()
{
super
({
...
...
@@ -590,7 +582,6 @@ export class MoveSelectionToPreviousFindMatchAction extends MultiCursorSelection
}
}
@
editorAction
export
class
SelectHighlightsAction
extends
MultiCursorSelectionControllerAction
{
constructor
()
{
super
({
...
...
@@ -609,7 +600,6 @@ export class SelectHighlightsAction extends MultiCursorSelectionControllerAction
}
}
@
editorAction
export
class
CompatChangeAll
extends
MultiCursorSelectionControllerAction
{
constructor
()
{
super
({
...
...
@@ -911,3 +901,13 @@ function getValueInRange(model: IModel, range: Range, toLowerCase: boolean): str
const
text
=
model
.
getValueInRange
(
range
);
return
(
toLowerCase
?
text
.
toLowerCase
()
:
text
);
}
registerEditorAction
(
new
InsertCursorAbove
());
registerEditorAction
(
new
InsertCursorBelow
());
registerEditorAction
(
new
InsertCursorAtEndOfEachLineSelected
());
registerEditorAction
(
new
AddSelectionToNextFindMatchAction
());
registerEditorAction
(
new
AddSelectionToPreviousFindMatchAction
());
registerEditorAction
(
new
MoveSelectionToNextFindMatchAction
());
registerEditorAction
(
new
MoveSelectionToPreviousFindMatchAction
());
registerEditorAction
(
new
SelectHighlightsAction
());
registerEditorAction
(
new
CompatChangeAll
());
src/vs/editor/contrib/parameterHints/browser/parameterHints.ts
浏览文件 @
6217946d
...
...
@@ -11,7 +11,7 @@ import { IInstantiationService } from 'vs/platform/instantiation/common/instanti
import
{
ICommonCodeEditor
,
IEditorContribution
}
from
'
vs/editor/common/editorCommon
'
;
import
{
EditorContextKeys
}
from
'
vs/editor/common/editorContextKeys
'
;
import
{
ContextKeyExpr
}
from
'
vs/platform/contextkey/common/contextkey
'
;
import
{
e
ditorAction
,
ServicesAccessor
,
EditorAction
,
EditorCommand
,
CommonEditorRegistry
}
from
'
vs/editor/common/editorCommonExtensions
'
;
import
{
registerE
ditorAction
,
ServicesAccessor
,
EditorAction
,
EditorCommand
,
CommonEditorRegistry
}
from
'
vs/editor/common/editorCommonExtensions
'
;
import
{
ICodeEditor
}
from
'
vs/editor/browser/editorBrowser
'
;
import
{
editorContribution
}
from
'
vs/editor/browser/editorBrowserExtensions
'
;
import
{
ParameterHintsWidget
}
from
'
./parameterHintsWidget
'
;
...
...
@@ -59,7 +59,6 @@ class ParameterHintsController implements IEditorContribution {
}
}
@
editorAction
export
class
TriggerParameterHintsAction
extends
EditorAction
{
constructor
()
{
...
...
@@ -83,6 +82,8 @@ export class TriggerParameterHintsAction extends EditorAction {
}
}
registerEditorAction
(
new
TriggerParameterHintsAction
());
const
weight
=
CommonEditorRegistry
.
commandWeight
(
75
);
const
ParameterHintsCommand
=
EditorCommand
.
bindToContribution
<
ParameterHintsController
>
(
ParameterHintsController
.
get
);
...
...
src/vs/editor/contrib/quickFix/browser/quickFixCommands.ts
浏览文件 @
6217946d
...
...
@@ -14,7 +14,7 @@ import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding';
import
{
IMarkerService
}
from
'
vs/platform/markers/common/markers
'
;
import
{
ICommonCodeEditor
,
IEditorContribution
}
from
'
vs/editor/common/editorCommon
'
;
import
{
EditorContextKeys
}
from
'
vs/editor/common/editorContextKeys
'
;
import
{
e
ditorAction
,
ServicesAccessor
,
EditorAction
}
from
'
vs/editor/common/editorCommonExtensions
'
;
import
{
registerE
ditorAction
,
ServicesAccessor
,
EditorAction
}
from
'
vs/editor/common/editorCommonExtensions
'
;
import
{
ICodeEditor
}
from
'
vs/editor/browser/editorBrowser
'
;
import
{
editorContribution
}
from
'
vs/editor/browser/editorBrowserExtensions
'
;
import
{
QuickFixContextMenu
}
from
'
./quickFixWidget
'
;
...
...
@@ -105,7 +105,6 @@ export class QuickFixController implements IEditorContribution {
}
}
@
editorAction
export
class
QuickFixAction
extends
EditorAction
{
static
Id
=
'
editor.action.quickFix
'
;
...
...
@@ -130,3 +129,5 @@ export class QuickFixAction extends EditorAction {
}
}
}
registerEditorAction
(
new
QuickFixAction
());
src/vs/editor/contrib/referenceSearch/browser/referenceSearch.ts
浏览文件 @
6217946d
...
...
@@ -15,7 +15,7 @@ import { KeybindingsRegistry } from 'vs/platform/keybinding/common/keybindingsRe
import
{
Position
,
IPosition
}
from
'
vs/editor/common/core/position
'
;
import
{
Range
}
from
'
vs/editor/common/core/range
'
;
import
*
as
editorCommon
from
'
vs/editor/common/editorCommon
'
;
import
{
e
ditorAction
,
ServicesAccessor
,
EditorAction
,
CommonEditorRegistry
,
commonEditorContribution
}
from
'
vs/editor/common/editorCommonExtensions
'
;
import
{
registerE
ditorAction
,
ServicesAccessor
,
EditorAction
,
CommonEditorRegistry
,
commonEditorContribution
}
from
'
vs/editor/common/editorCommonExtensions
'
;
import
{
Location
,
ReferenceProviderRegistry
}
from
'
vs/editor/common/modes
'
;
import
{
PeekContext
,
getOuterEditor
}
from
'
./peekViewWidget
'
;
import
{
ReferencesController
,
RequestOptions
,
ctxReferenceSearchVisible
}
from
'
./referencesController
'
;
...
...
@@ -53,7 +53,6 @@ export class ReferenceController implements editorCommon.IEditorContribution {
}
}
@
editorAction
export
class
ReferenceAction
extends
EditorAction
{
constructor
()
{
...
...
@@ -88,6 +87,8 @@ export class ReferenceAction extends EditorAction {
}
}
registerEditorAction
(
new
ReferenceAction
());
let
findReferencesCommand
:
ICommandHandler
=
(
accessor
:
ServicesAccessor
,
resource
:
URI
,
position
:
IPosition
)
=>
{
if
(
!
(
resource
instanceof
URI
))
{
...
...
src/vs/editor/contrib/rename/browser/rename.ts
浏览文件 @
6217946d
...
...
@@ -14,7 +14,7 @@ import { IFileService } from 'vs/platform/files/common/files';
import
{
RawContextKey
,
IContextKey
,
IContextKeyService
,
ContextKeyExpr
}
from
'
vs/platform/contextkey/common/contextkey
'
;
import
{
IMessageService
}
from
'
vs/platform/message/common/message
'
;
import
{
IProgressService
}
from
'
vs/platform/progress/common/progress
'
;
import
{
e
ditorAction
,
ServicesAccessor
,
EditorAction
,
EditorCommand
,
CommonEditorRegistry
}
from
'
vs/editor/common/editorCommonExtensions
'
;
import
{
registerE
ditorAction
,
ServicesAccessor
,
EditorAction
,
EditorCommand
,
CommonEditorRegistry
}
from
'
vs/editor/common/editorCommonExtensions
'
;
import
{
editorContribution
}
from
'
vs/editor/browser/editorBrowserExtensions
'
;
import
{
ICommonCodeEditor
,
IEditorContribution
,
IReadOnlyModel
}
from
'
vs/editor/common/editorCommon
'
;
import
{
EditorContextKeys
}
from
'
vs/editor/common/editorContextKeys
'
;
...
...
@@ -201,7 +201,6 @@ class RenameController implements IEditorContribution {
// ---- action implementation
@
editorAction
export
class
RenameAction
extends
EditorAction
{
constructor
()
{
...
...
@@ -230,6 +229,8 @@ export class RenameAction extends EditorAction {
}
}
registerEditorAction
(
new
RenameAction
());
const
RenameCommand
=
EditorCommand
.
bindToContribution
<
RenameController
>
(
RenameController
.
get
);
CommonEditorRegistry
.
registerEditorCommand
(
new
RenameCommand
({
...
...
src/vs/editor/contrib/smartSelect/common/smartSelect.ts
浏览文件 @
6217946d
...
...
@@ -12,7 +12,7 @@ import { IInstantiationService } from 'vs/platform/instantiation/common/instanti
import
{
Range
}
from
'
vs/editor/common/core/range
'
;
import
{
ICommonCodeEditor
,
IEditorContribution
}
from
'
vs/editor/common/editorCommon
'
;
import
{
EditorContextKeys
}
from
'
vs/editor/common/editorContextKeys
'
;
import
{
e
ditorAction
,
ServicesAccessor
,
IActionOptions
,
EditorAction
,
commonEditorContribution
}
from
'
vs/editor/common/editorCommonExtensions
'
;
import
{
registerE
ditorAction
,
ServicesAccessor
,
IActionOptions
,
EditorAction
,
commonEditorContribution
}
from
'
vs/editor/common/editorCommonExtensions
'
;
import
{
TokenSelectionSupport
,
ILogicalSelectionEntry
}
from
'
./tokenSelectionSupport
'
;
import
{
ICursorPositionChangedEvent
}
from
'
vs/editor/common/controller/cursorEvents
'
;
...
...
@@ -163,8 +163,6 @@ abstract class AbstractSmartSelect extends EditorAction {
}
}
@
editorAction
// @ts-ignore @editorAction uses the class
class
GrowSelectionAction
extends
AbstractSmartSelect
{
constructor
()
{
super
(
true
,
{
...
...
@@ -181,8 +179,6 @@ class GrowSelectionAction extends AbstractSmartSelect {
}
}
@
editorAction
// @ts-ignore @editorAction uses the class
class
ShrinkSelectionAction
extends
AbstractSmartSelect
{
constructor
()
{
super
(
false
,
{
...
...
@@ -198,3 +194,6 @@ class ShrinkSelectionAction extends AbstractSmartSelect {
});
}
}
registerEditorAction
(
new
GrowSelectionAction
());
registerEditorAction
(
new
ShrinkSelectionAction
());
src/vs/editor/contrib/suggest/browser/suggestController.ts
浏览文件 @
6217946d
...
...
@@ -15,7 +15,7 @@ import { ContextKeyExpr, IContextKeyService } from 'vs/platform/contextkey/commo
import
{
ICommandService
}
from
'
vs/platform/commands/common/commands
'
;
import
{
ICommonCodeEditor
,
IEditorContribution
,
ScrollType
}
from
'
vs/editor/common/editorCommon
'
;
import
{
EditorContextKeys
}
from
'
vs/editor/common/editorContextKeys
'
;
import
{
e
ditorAction
,
ServicesAccessor
,
EditorAction
,
EditorCommand
,
CommonEditorRegistry
}
from
'
vs/editor/common/editorCommonExtensions
'
;
import
{
registerE
ditorAction
,
ServicesAccessor
,
EditorAction
,
EditorCommand
,
CommonEditorRegistry
}
from
'
vs/editor/common/editorCommonExtensions
'
;
import
{
ICodeEditor
}
from
'
vs/editor/browser/editorBrowser
'
;
import
{
alert
}
from
'
vs/base/browser/ui/aria/aria
'
;
import
{
editorContribution
}
from
'
vs/editor/browser/editorBrowserExtensions
'
;
...
...
@@ -295,7 +295,6 @@ export class SuggestController implements IEditorContribution {
}
}
@
editorAction
export
class
TriggerSuggestAction
extends
EditorAction
{
static
readonly
id
=
'
editor.action.triggerSuggest
'
;
...
...
@@ -325,6 +324,8 @@ export class TriggerSuggestAction extends EditorAction {
}
}
registerEditorAction
(
new
TriggerSuggestAction
());
const
weight
=
CommonEditorRegistry
.
commandWeight
(
90
);
const
SuggestCommand
=
EditorCommand
.
bindToContribution
<
SuggestController
>
(
SuggestController
.
get
);
...
...
src/vs/editor/contrib/toggleTabFocusMode/common/toggleTabFocusMode.ts
浏览文件 @
6217946d
...
...
@@ -7,10 +7,9 @@
import
*
as
nls
from
'
vs/nls
'
;
import
{
KeyCode
,
KeyMod
}
from
'
vs/base/common/keyCodes
'
;
import
{
ICommonCodeEditor
}
from
'
vs/editor/common/editorCommon
'
;
import
{
e
ditorAction
,
ServicesAccessor
,
EditorAction
}
from
'
vs/editor/common/editorCommonExtensions
'
;
import
{
registerE
ditorAction
,
ServicesAccessor
,
EditorAction
}
from
'
vs/editor/common/editorCommonExtensions
'
;
import
{
TabFocus
}
from
'
vs/editor/common/config/commonEditorConfig
'
;
@
editorAction
export
class
ToggleTabFocusModeAction
extends
EditorAction
{
public
static
ID
=
'
editor.action.toggleTabFocusMode
'
;
...
...
@@ -34,3 +33,5 @@ export class ToggleTabFocusModeAction extends EditorAction {
TabFocus
.
setTabFocusMode
(
!
oldValue
);
}
}
registerEditorAction
(
new
ToggleTabFocusModeAction
());
src/vs/editor/contrib/wordHighlighter/common/wordHighlighter.ts
浏览文件 @
6217946d
...
...
@@ -11,7 +11,7 @@ import { onUnexpectedExternalError } from 'vs/base/common/errors';
import
{
TPromise
}
from
'
vs/base/common/winjs.base
'
;
import
{
Range
}
from
'
vs/editor/common/core/range
'
;
import
*
as
editorCommon
from
'
vs/editor/common/editorCommon
'
;
import
{
CommonEditorRegistry
,
commonEditorContribution
,
EditorAction
,
IActionOptions
,
e
ditorAction
}
from
'
vs/editor/common/editorCommonExtensions
'
;
import
{
CommonEditorRegistry
,
commonEditorContribution
,
EditorAction
,
IActionOptions
,
registerE
ditorAction
}
from
'
vs/editor/common/editorCommonExtensions
'
;
import
{
DocumentHighlight
,
DocumentHighlightKind
,
DocumentHighlightProviderRegistry
}
from
'
vs/editor/common/modes
'
;
import
{
IDisposable
,
dispose
}
from
'
vs/base/common/lifecycle
'
;
import
{
Position
}
from
'
vs/editor/common/core/position
'
;
...
...
@@ -490,8 +490,6 @@ class WordHighlightNavigationAction extends EditorAction {
}
}
@
editorAction
// @ts-ignore @editorAction uses the class
class
NextWordHighlightAction
extends
WordHighlightNavigationAction
{
constructor
()
{
super
(
true
,
{
...
...
@@ -507,8 +505,6 @@ class NextWordHighlightAction extends WordHighlightNavigationAction {
}
}
@
editorAction
// @ts-ignore @editorAction uses the class
class
PrevWordHighlightAction
extends
WordHighlightNavigationAction
{
constructor
()
{
super
(
false
,
{
...
...
@@ -522,4 +518,7 @@ class PrevWordHighlightAction extends WordHighlightNavigationAction {
}
});
}
}
\ No newline at end of file
}
registerEditorAction
(
new
NextWordHighlightAction
());
registerEditorAction
(
new
PrevWordHighlightAction
());
src/vs/editor/standalone/browser/accessibilityHelp/accessibilityHelp.ts
浏览文件 @
6217946d
...
...
@@ -18,7 +18,7 @@ import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding';
import
{
RawContextKey
,
IContextKey
,
IContextKeyService
}
from
'
vs/platform/contextkey/common/contextkey
'
;
import
{
ICommonCodeEditor
,
IEditorContribution
}
from
'
vs/editor/common/editorCommon
'
;
import
{
EditorContextKeys
}
from
'
vs/editor/common/editorContextKeys
'
;
import
{
e
ditorAction
,
CommonEditorRegistry
,
EditorAction
,
EditorCommand
}
from
'
vs/editor/common/editorCommonExtensions
'
;
import
{
registerE
ditorAction
,
CommonEditorRegistry
,
EditorAction
,
EditorCommand
}
from
'
vs/editor/common/editorCommonExtensions
'
;
import
{
ICodeEditor
,
IOverlayWidget
,
IOverlayWidgetPosition
}
from
'
vs/editor/browser/editorBrowser
'
;
import
{
editorContribution
}
from
'
vs/editor/browser/editorBrowserExtensions
'
;
import
{
ToggleTabFocusModeAction
}
from
'
vs/editor/contrib/toggleTabFocusMode/common/toggleTabFocusMode
'
;
...
...
@@ -334,8 +334,6 @@ class AccessibilityHelpWidget extends Widget implements IOverlayWidget {
}
}
@
editorAction
// @ts-ignore @editorAction uses the class
class
ShowAccessibilityHelpAction
extends
EditorAction
{
constructor
()
{
super
({
...
...
@@ -358,6 +356,8 @@ class ShowAccessibilityHelpAction extends EditorAction {
}
}
registerEditorAction
(
new
ShowAccessibilityHelpAction
());
const
AccessibilityHelpCommand
=
EditorCommand
.
bindToContribution
<
AccessibilityHelpController
>
(
AccessibilityHelpController
.
get
);
CommonEditorRegistry
.
registerEditorCommand
(
...
...
src/vs/editor/standalone/browser/inspectTokens/inspectTokens.ts
浏览文件 @
6217946d
...
...
@@ -10,7 +10,7 @@ import { Disposable } from 'vs/base/common/lifecycle';
import
{
escape
}
from
'
vs/base/common/strings
'
;
import
{
Position
}
from
'
vs/editor/common/core/position
'
;
import
{
ICommonCodeEditor
,
IEditorContribution
,
IModel
}
from
'
vs/editor/common/editorCommon
'
;
import
{
e
ditorAction
,
EditorAction
,
ServicesAccessor
}
from
'
vs/editor/common/editorCommonExtensions
'
;
import
{
registerE
ditorAction
,
EditorAction
,
ServicesAccessor
}
from
'
vs/editor/common/editorCommonExtensions
'
;
import
{
ICodeEditor
,
ContentWidgetPositionPreference
,
IContentWidget
,
IContentWidgetPosition
}
from
'
vs/editor/browser/editorBrowser
'
;
import
{
editorContribution
}
from
'
vs/editor/browser/editorBrowserExtensions
'
;
import
{
IModeService
}
from
'
vs/editor/common/services/modeService
'
;
...
...
@@ -82,8 +82,6 @@ class InspectTokensController extends Disposable implements IEditorContribution
}
}
@
editorAction
// @ts-ignore @editorAction uses the class
class
InspectTokens
extends
EditorAction
{
constructor
()
{
...
...
@@ -333,6 +331,8 @@ class InspectTokensWidget extends Disposable implements IContentWidget {
}
}
registerEditorAction
(
new
InspectTokens
());
registerThemingParticipant
((
theme
,
collector
)
=>
{
let
border
=
theme
.
getColor
(
editorHoverBorder
);
if
(
border
)
{
...
...
@@ -344,4 +344,4 @@ registerThemingParticipant((theme, collector) => {
if
(
background
)
{
collector
.
addRule
(
`.monaco-editor .tokens-inspect-widget { background-color:
${
background
}
; }`
);
}
});
\ No newline at end of file
});
src/vs/editor/standalone/browser/quickOpen/gotoLine.ts
浏览文件 @
6217946d
...
...
@@ -13,7 +13,7 @@ import * as editorCommon from 'vs/editor/common/editorCommon';
import
{
EditorContextKeys
}
from
'
vs/editor/common/editorContextKeys
'
;
import
{
ICodeEditor
,
IDiffEditor
}
from
'
vs/editor/browser/editorBrowser
'
;
import
{
BaseEditorQuickOpenAction
,
IDecorator
}
from
'
./editorQuickOpen
'
;
import
{
e
ditorAction
,
ServicesAccessor
}
from
'
vs/editor/common/editorCommonExtensions
'
;
import
{
registerE
ditorAction
,
ServicesAccessor
}
from
'
vs/editor/common/editorCommonExtensions
'
;
import
{
KeyCode
,
KeyMod
}
from
'
vs/base/common/keyCodes
'
;
import
{
Position
}
from
'
vs/editor/common/core/position
'
;
import
{
Range
}
from
'
vs/editor/common/core/range
'
;
...
...
@@ -141,7 +141,6 @@ export class GotoLineEntry extends QuickOpenEntry {
}
}
@
editorAction
export
class
GotoLineAction
extends
BaseEditorQuickOpenAction
{
constructor
()
{
...
...
@@ -172,3 +171,5 @@ export class GotoLineAction extends BaseEditorQuickOpenAction {
});
}
}
registerEditorAction
(
new
GotoLineAction
());
src/vs/editor/standalone/browser/quickOpen/quickCommand.ts
浏览文件 @
6217946d
...
...
@@ -14,7 +14,7 @@ import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding';
import
{
IEditorAction
,
ICommonCodeEditor
,
IEditor
}
from
'
vs/editor/common/editorCommon
'
;
import
{
EditorContextKeys
}
from
'
vs/editor/common/editorContextKeys
'
;
import
{
BaseEditorQuickOpenAction
}
from
'
./editorQuickOpen
'
;
import
{
e
ditorAction
,
ServicesAccessor
}
from
'
vs/editor/common/editorCommonExtensions
'
;
import
{
registerE
ditorAction
,
ServicesAccessor
}
from
'
vs/editor/common/editorCommonExtensions
'
;
import
{
KeyCode
,
KeyMod
}
from
'
vs/base/common/keyCodes
'
;
import
*
as
browser
from
'
vs/base/browser/browser
'
;
...
...
@@ -68,7 +68,6 @@ export class EditorActionCommandEntry extends QuickOpenEntryGroup {
}
}
@
editorAction
export
class
QuickCommandAction
extends
BaseEditorQuickOpenAction
{
constructor
()
{
...
...
@@ -132,4 +131,6 @@ export class QuickCommandAction extends BaseEditorQuickOpenAction {
return
entries
;
}
}
\ No newline at end of file
}
registerEditorAction
(
new
QuickCommandAction
());
src/vs/editor/standalone/browser/quickOpen/quickOutline.ts
浏览文件 @
6217946d
...
...
@@ -18,7 +18,7 @@ import { EditorContextKeys } from 'vs/editor/common/editorContextKeys';
import
{
SymbolInformation
,
DocumentSymbolProviderRegistry
,
symbolKindToCssClass
,
IOutline
}
from
'
vs/editor/common/modes
'
;
import
{
BaseEditorQuickOpenAction
,
IDecorator
}
from
'
./editorQuickOpen
'
;
import
{
getDocumentSymbols
}
from
'
vs/editor/contrib/quickOpen/common/quickOpen
'
;
import
{
e
ditorAction
,
ServicesAccessor
}
from
'
vs/editor/common/editorCommonExtensions
'
;
import
{
registerE
ditorAction
,
ServicesAccessor
}
from
'
vs/editor/common/editorCommonExtensions
'
;
import
{
KeyCode
,
KeyMod
}
from
'
vs/base/common/keyCodes
'
;
import
{
Range
}
from
'
vs/editor/common/core/range
'
;
...
...
@@ -109,7 +109,6 @@ class SymbolEntry extends QuickOpenEntryGroup {
}
}
@
editorAction
export
class
QuickOutlineAction
extends
BaseEditorQuickOpenAction
{
constructor
()
{
...
...
@@ -314,3 +313,5 @@ export class QuickOutlineAction extends BaseEditorQuickOpenAction {
return
elementARange
.
startLineNumber
-
elementBRange
.
startLineNumber
;
}
}
registerEditorAction
(
new
QuickOutlineAction
());
src/vs/editor/standalone/browser/toggleHighContrast/toggleHighContrast.ts
浏览文件 @
6217946d
...
...
@@ -6,11 +6,9 @@
import
*
as
nls
from
'
vs/nls
'
;
import
{
ICommonCodeEditor
}
from
'
vs/editor/common/editorCommon
'
;
import
{
e
ditorAction
,
EditorAction
,
ServicesAccessor
}
from
'
vs/editor/common/editorCommonExtensions
'
;
import
{
registerE
ditorAction
,
EditorAction
,
ServicesAccessor
}
from
'
vs/editor/common/editorCommonExtensions
'
;
import
{
IStandaloneThemeService
}
from
'
vs/editor/standalone/common/standaloneThemeService
'
;
@
editorAction
// @ts-ignore @editorAction uses the class
class
ToggleHighContrast
extends
EditorAction
{
private
_originalThemeName
:
string
;
...
...
@@ -37,3 +35,5 @@ class ToggleHighContrast extends EditorAction {
}
}
}
registerEditorAction
(
new
ToggleHighContrast
());
src/vs/workbench/parts/codeEditor/electron-browser/accessibility.ts
浏览文件 @
6217946d
...
...
@@ -19,7 +19,7 @@ import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding';
import
{
RawContextKey
,
IContextKey
,
IContextKeyService
}
from
'
vs/platform/contextkey/common/contextkey
'
;
import
{
ICommonCodeEditor
,
IEditorContribution
}
from
'
vs/editor/common/editorCommon
'
;
import
{
EditorContextKeys
}
from
'
vs/editor/common/editorContextKeys
'
;
import
{
e
ditorAction
,
CommonEditorRegistry
,
EditorAction
,
EditorCommand
}
from
'
vs/editor/common/editorCommonExtensions
'
;
import
{
registerE
ditorAction
,
CommonEditorRegistry
,
EditorAction
,
EditorCommand
}
from
'
vs/editor/common/editorCommonExtensions
'
;
import
{
ICodeEditor
,
IOverlayWidget
,
IOverlayWidgetPosition
}
from
'
vs/editor/browser/editorBrowser
'
;
import
{
editorContribution
}
from
'
vs/editor/browser/editorBrowserExtensions
'
;
import
{
ToggleTabFocusModeAction
}
from
'
vs/editor/contrib/toggleTabFocusMode/common/toggleTabFocusMode
'
;
...
...
@@ -277,8 +277,6 @@ class AccessibilityHelpWidget extends Widget implements IOverlayWidget {
}
}
@
editorAction
// @ts-ignore @editorAction uses the class
class
ShowAccessibilityHelpAction
extends
EditorAction
{
constructor
()
{
...
...
@@ -302,6 +300,8 @@ class ShowAccessibilityHelpAction extends EditorAction {
}
}
registerEditorAction
(
new
ShowAccessibilityHelpAction
());
const
AccessibilityHelpCommand
=
EditorCommand
.
bindToContribution
<
AccessibilityHelpController
>
(
AccessibilityHelpController
.
get
);
CommonEditorRegistry
.
registerEditorCommand
(
new
AccessibilityHelpCommand
({
...
...
src/vs/workbench/parts/codeEditor/electron-browser/inspectKeybindings.ts
浏览文件 @
6217946d
...
...
@@ -6,14 +6,12 @@
import
*
as
nls
from
'
vs/nls
'
;
import
{
ICommonCodeEditor
}
from
'
vs/editor/common/editorCommon
'
;
import
{
e
ditorAction
,
ServicesAccessor
,
EditorAction
}
from
'
vs/editor/common/editorCommonExtensions
'
;
import
{
registerE
ditorAction
,
ServicesAccessor
,
EditorAction
}
from
'
vs/editor/common/editorCommonExtensions
'
;
import
{
IKeybindingService
}
from
'
vs/platform/keybinding/common/keybinding
'
;
import
{
WorkbenchKeybindingService
}
from
'
vs/workbench/services/keybinding/electron-browser/keybindingService
'
;
import
{
IWorkbenchEditorService
}
from
'
vs/workbench/services/editor/common/editorService
'
;
import
{
IUntitledResourceInput
}
from
'
vs/platform/editor/common/editor
'
;
@
editorAction
// @ts-ignore @editorAction uses the class
class
InspectKeyMap
extends
EditorAction
{
constructor
()
{
...
...
@@ -34,3 +32,5 @@ class InspectKeyMap extends EditorAction {
}
}
}
registerEditorAction
(
new
InspectKeyMap
());
src/vs/workbench/parts/codeEditor/electron-browser/textMate/inspectTMScopes.ts
浏览文件 @
6217946d
...
...
@@ -12,7 +12,7 @@ import { escape } from 'vs/base/common/strings';
import
{
KeyCode
}
from
'
vs/base/common/keyCodes
'
;
import
{
Position
}
from
'
vs/editor/common/core/position
'
;
import
{
ICommonCodeEditor
,
IEditorContribution
,
IModel
}
from
'
vs/editor/common/editorCommon
'
;
import
{
e
ditorAction
,
EditorAction
,
ServicesAccessor
}
from
'
vs/editor/common/editorCommonExtensions
'
;
import
{
registerE
ditorAction
,
EditorAction
,
ServicesAccessor
}
from
'
vs/editor/common/editorCommonExtensions
'
;
import
{
ICodeEditor
,
ContentWidgetPositionPreference
,
IContentWidget
,
IContentWidgetPosition
}
from
'
vs/editor/browser/editorBrowser
'
;
import
{
editorContribution
}
from
'
vs/editor/browser/editorBrowserExtensions
'
;
import
{
TPromise
}
from
'
vs/base/common/winjs.base
'
;
...
...
@@ -101,8 +101,6 @@ class InspectTMScopesController extends Disposable implements IEditorContributio
}
}
@
editorAction
// @ts-ignore @editorAction uses the class
class
InspectTMScopes
extends
EditorAction
{
constructor
()
{
...
...
@@ -377,6 +375,8 @@ class InspectTMScopesWidget extends Disposable implements IContentWidget {
}
}
registerEditorAction
(
new
InspectTMScopes
());
registerThemingParticipant
((
theme
,
collector
)
=>
{
let
border
=
theme
.
getColor
(
editorHoverBorder
);
if
(
border
)
{
...
...
@@ -388,4 +388,4 @@ registerThemingParticipant((theme, collector) => {
if
(
background
)
{
collector
.
addRule
(
`.monaco-editor .tm-inspect-widget { background-color:
${
background
}
; }`
);
}
});
\ No newline at end of file
});
src/vs/workbench/parts/codeEditor/electron-browser/toggleMinimap.ts
浏览文件 @
6217946d
...
...
@@ -6,10 +6,9 @@
import
*
as
nls
from
'
vs/nls
'
;
import
{
ICommonCodeEditor
}
from
'
vs/editor/common/editorCommon
'
;
import
{
e
ditorAction
,
ServicesAccessor
,
EditorAction
}
from
'
vs/editor/common/editorCommonExtensions
'
;
import
{
registerE
ditorAction
,
ServicesAccessor
,
EditorAction
}
from
'
vs/editor/common/editorCommonExtensions
'
;
import
{
IConfigurationService
,
ConfigurationTarget
}
from
'
vs/platform/configuration/common/configuration
'
;
@
editorAction
export
class
ToggleMinimapAction
extends
EditorAction
{
constructor
()
{
...
...
@@ -29,3 +28,5 @@ export class ToggleMinimapAction extends EditorAction {
configurationService
.
updateValue
(
'
editor.minimap.enabled
'
,
newValue
,
ConfigurationTarget
.
USER
);
}
}
registerEditorAction
(
new
ToggleMinimapAction
());
src/vs/workbench/parts/codeEditor/electron-browser/toggleRenderControlCharacter.ts
浏览文件 @
6217946d
...
...
@@ -6,10 +6,9 @@
import
*
as
nls
from
'
vs/nls
'
;
import
{
ICommonCodeEditor
}
from
'
vs/editor/common/editorCommon
'
;
import
{
e
ditorAction
,
ServicesAccessor
,
EditorAction
}
from
'
vs/editor/common/editorCommonExtensions
'
;
import
{
registerE
ditorAction
,
ServicesAccessor
,
EditorAction
}
from
'
vs/editor/common/editorCommonExtensions
'
;
import
{
IConfigurationService
,
ConfigurationTarget
}
from
'
vs/platform/configuration/common/configuration
'
;
@
editorAction
export
class
ToggleRenderControlCharacterAction
extends
EditorAction
{
constructor
()
{
...
...
@@ -29,3 +28,5 @@ export class ToggleRenderControlCharacterAction extends EditorAction {
configurationService
.
updateValue
(
'
editor.renderControlCharacters
'
,
newRenderControlCharacters
,
ConfigurationTarget
.
USER
);
}
}
registerEditorAction
(
new
ToggleRenderControlCharacterAction
());
src/vs/workbench/parts/codeEditor/electron-browser/toggleRenderWhitespace.ts
浏览文件 @
6217946d
...
...
@@ -6,10 +6,9 @@
import
*
as
nls
from
'
vs/nls
'
;
import
{
ICommonCodeEditor
}
from
'
vs/editor/common/editorCommon
'
;
import
{
e
ditorAction
,
ServicesAccessor
,
EditorAction
}
from
'
vs/editor/common/editorCommonExtensions
'
;
import
{
registerE
ditorAction
,
ServicesAccessor
,
EditorAction
}
from
'
vs/editor/common/editorCommonExtensions
'
;
import
{
IConfigurationService
,
ConfigurationTarget
}
from
'
vs/platform/configuration/common/configuration
'
;
@
editorAction
export
class
ToggleRenderWhitespaceAction
extends
EditorAction
{
constructor
()
{
...
...
@@ -35,3 +34,5 @@ export class ToggleRenderWhitespaceAction extends EditorAction {
configurationService
.
updateValue
(
'
editor.renderWhitespace
'
,
newRenderWhitespace
,
ConfigurationTarget
.
USER
);
}
}
registerEditorAction
(
new
ToggleRenderWhitespaceAction
());
src/vs/workbench/parts/codeEditor/electron-browser/toggleWordWrap.ts
浏览文件 @
6217946d
...
...
@@ -8,7 +8,7 @@ import 'vs/css!./media/codeEditor';
import
*
as
nls
from
'
vs/nls
'
;
import
{
KeyCode
,
KeyMod
}
from
'
vs/base/common/keyCodes
'
;
import
{
ICommonCodeEditor
,
IEditorContribution
,
IModel
}
from
'
vs/editor/common/editorCommon
'
;
import
{
e
ditorAction
,
ServicesAccessor
,
EditorAction
,
commonEditorContribution
}
from
'
vs/editor/common/editorCommonExtensions
'
;
import
{
registerE
ditorAction
,
ServicesAccessor
,
EditorAction
,
commonEditorContribution
}
from
'
vs/editor/common/editorCommonExtensions
'
;
import
{
ICodeEditorService
}
from
'
vs/editor/common/services/codeEditorService
'
;
import
{
MenuRegistry
,
MenuId
}
from
'
vs/platform/actions/common/actions
'
;
import
{
ContextKeyExpr
,
IContextKeyService
}
from
'
vs/platform/contextkey/common/contextkey
'
;
...
...
@@ -130,8 +130,6 @@ function applyWordWrapState(editor: ICommonCodeEditor, state: IWordWrapState): v
});
}
@
editorAction
// @ts-ignore @editorAction uses the class
class
ToggleWordWrapAction
extends
EditorAction
{
constructor
()
{
...
...
@@ -252,6 +250,8 @@ function canToggleWordWrap(uri: URI): boolean {
return
(
uri
.
scheme
!==
'
output
'
&&
uri
.
scheme
!==
'
vscode
'
);
}
registerEditorAction
(
new
ToggleWordWrapAction
());
MenuRegistry
.
appendMenuItem
(
MenuId
.
EditorTitle
,
{
command
:
{
id
:
'
editor.action.toggleWordWrap
'
,
...
...
src/vs/workbench/parts/debug/browser/debugEditorActions.ts
浏览文件 @
6217946d
...
...
@@ -9,14 +9,12 @@ import { KeyMod, KeyChord, KeyCode } from 'vs/base/common/keyCodes';
import
{
Range
}
from
'
vs/editor/common/core/range
'
;
import
{
ICommonCodeEditor
}
from
'
vs/editor/common/editorCommon
'
;
import
{
EditorContextKeys
}
from
'
vs/editor/common/editorContextKeys
'
;
import
{
ServicesAccessor
,
e
ditorAction
,
EditorAction
,
CommonEditorRegistry
,
EditorCommand
}
from
'
vs/editor/common/editorCommonExtensions
'
;
import
{
ServicesAccessor
,
registerE
ditorAction
,
EditorAction
,
CommonEditorRegistry
,
EditorCommand
}
from
'
vs/editor/common/editorCommonExtensions
'
;
import
{
ContextKeyExpr
}
from
'
vs/platform/contextkey/common/contextkey
'
;
import
{
IDebugService
,
CONTEXT_IN_DEBUG_MODE
,
CONTEXT_NOT_IN_DEBUG_REPL
,
CONTEXT_DEBUG_STATE
,
State
,
REPL_ID
,
VIEWLET_ID
,
IDebugEditorContribution
,
EDITOR_CONTRIBUTION_ID
,
CONTEXT_BREAKPOINT_WIDGET_VISIBLE
}
from
'
vs/workbench/parts/debug/common/debug
'
;
import
{
IPanelService
}
from
'
vs/workbench/services/panel/common/panelService
'
;
import
{
IViewletService
}
from
'
vs/workbench/services/viewlet/browser/viewlet
'
;
@
editorAction
// @ts-ignore @editorAction uses the class
class
ToggleBreakpointAction
extends
EditorAction
{
constructor
()
{
super
({
...
...
@@ -68,8 +66,6 @@ function addColumnBreakpoint(accessor: ServicesAccessor, editor: ICommonCodeEdit
return
TPromise
.
as
(
null
);
}
@
editorAction
// @ts-ignore @editorAction uses the class
class
ToggleColumnBreakpointAction
extends
EditorAction
{
constructor
()
{
super
({
...
...
@@ -90,8 +86,6 @@ class ToggleColumnBreakpointAction extends EditorAction {
}
// TODO@Isidor merge two column breakpoints actions together
@
editorAction
// @ts-ignore @editorAction uses the class
class
ToggleColumnBreakpointContextMenuAction
extends
EditorAction
{
constructor
()
{
super
({
...
...
@@ -111,8 +105,6 @@ class ToggleColumnBreakpointContextMenuAction extends EditorAction {
}
}
@
editorAction
// @ts-ignore @editorAction uses the class
class
ConditionalBreakpointAction
extends
EditorAction
{
constructor
()
{
...
...
@@ -135,8 +127,6 @@ class ConditionalBreakpointAction extends EditorAction {
}
@
editorAction
// @ts-ignore @editorAction uses the class
class
RunToCursorAction
extends
EditorAction
{
constructor
()
{
...
...
@@ -179,8 +169,6 @@ class RunToCursorAction extends EditorAction {
}
}
@
editorAction
// @ts-ignore @editorAction uses the class
class
SelectionToReplAction
extends
EditorAction
{
constructor
()
{
...
...
@@ -207,8 +195,6 @@ class SelectionToReplAction extends EditorAction {
}
}
@
editorAction
// @ts-ignore @editorAction uses the class
class
SelectionToWatchExpressionsAction
extends
EditorAction
{
constructor
()
{
...
...
@@ -233,8 +219,6 @@ class SelectionToWatchExpressionsAction extends EditorAction {
}
}
@
editorAction
// @ts-ignore @editorAction uses the class
class
ShowDebugHoverAction
extends
EditorAction
{
constructor
()
{
...
...
@@ -282,4 +266,13 @@ class CloseBreakpointWidgetCommand extends EditorCommand {
}
}
registerEditorAction
(
new
ToggleBreakpointAction
());
registerEditorAction
(
new
ToggleColumnBreakpointAction
());
registerEditorAction
(
new
ToggleColumnBreakpointContextMenuAction
());
registerEditorAction
(
new
ConditionalBreakpointAction
());
registerEditorAction
(
new
RunToCursorAction
());
registerEditorAction
(
new
SelectionToReplAction
());
registerEditorAction
(
new
SelectionToWatchExpressionsAction
());
registerEditorAction
(
new
ShowDebugHoverAction
());
CommonEditorRegistry
.
registerEditorCommand
(
new
CloseBreakpointWidgetCommand
());
src/vs/workbench/parts/debug/electron-browser/repl.ts
浏览文件 @
6217946d
...
...
@@ -23,7 +23,7 @@ import { IReadOnlyModel, ICommonCodeEditor } from 'vs/editor/common/editorCommon
import
{
EditorContextKeys
}
from
'
vs/editor/common/editorContextKeys
'
;
import
{
Position
}
from
'
vs/editor/common/core/position
'
;
import
*
as
modes
from
'
vs/editor/common/modes
'
;
import
{
e
ditorAction
,
ServicesAccessor
,
EditorAction
,
EditorCommand
,
CommonEditorRegistry
}
from
'
vs/editor/common/editorCommonExtensions
'
;
import
{
registerE
ditorAction
,
ServicesAccessor
,
EditorAction
,
EditorCommand
,
CommonEditorRegistry
}
from
'
vs/editor/common/editorCommonExtensions
'
;
import
{
IModelService
}
from
'
vs/editor/common/services/modelService
'
;
import
{
MenuId
}
from
'
vs/platform/actions/common/actions
'
;
import
{
ServiceCollection
}
from
'
vs/platform/instantiation/common/serviceCollection
'
;
...
...
@@ -312,8 +312,6 @@ export class Repl extends Panel implements IPrivateReplService {
}
}
@
editorAction
// @ts-ignore @editorAction uses the class
class
ReplHistoryPreviousAction
extends
EditorAction
{
constructor
()
{
...
...
@@ -338,8 +336,6 @@ class ReplHistoryPreviousAction extends EditorAction {
}
}
@
editorAction
// @ts-ignore @editorAction uses the class
class
ReplHistoryNextAction
extends
EditorAction
{
constructor
()
{
...
...
@@ -364,8 +360,6 @@ class ReplHistoryNextAction extends EditorAction {
}
}
@
editorAction
// @ts-ignore @editorAction uses the class
class
AcceptReplInputAction
extends
EditorAction
{
constructor
()
{
...
...
@@ -387,19 +381,6 @@ class AcceptReplInputAction extends EditorAction {
}
}
const
SuggestCommand
=
EditorCommand
.
bindToContribution
<
SuggestController
>
(
SuggestController
.
get
);
CommonEditorRegistry
.
registerEditorCommand
(
new
SuggestCommand
({
id
:
'
repl.action.acceptSuggestion
'
,
precondition
:
ContextKeyExpr
.
and
(
debug
.
CONTEXT_IN_DEBUG_REPL
,
SuggestContext
.
Visible
),
handler
:
x
=>
x
.
acceptSelectedSuggestion
(),
kbOpts
:
{
weight
:
50
,
kbExpr
:
EditorContextKeys
.
textFocus
,
primary
:
KeyCode
.
RightArrow
}
}));
@
editorAction
export
class
ReplCopyAllAction
extends
EditorAction
{
constructor
()
{
...
...
@@ -415,3 +396,20 @@ export class ReplCopyAllAction extends EditorAction {
clipboard
.
writeText
(
accessor
.
get
(
IPrivateReplService
).
getVisibleContent
());
}
}
registerEditorAction
(
new
ReplHistoryPreviousAction
());
registerEditorAction
(
new
ReplHistoryNextAction
());
registerEditorAction
(
new
AcceptReplInputAction
());
registerEditorAction
(
new
ReplCopyAllAction
());
const
SuggestCommand
=
EditorCommand
.
bindToContribution
<
SuggestController
>
(
SuggestController
.
get
);
CommonEditorRegistry
.
registerEditorCommand
(
new
SuggestCommand
({
id
:
'
repl.action.acceptSuggestion
'
,
precondition
:
ContextKeyExpr
.
and
(
debug
.
CONTEXT_IN_DEBUG_REPL
,
SuggestContext
.
Visible
),
handler
:
x
=>
x
.
acceptSelectedSuggestion
(),
kbOpts
:
{
weight
:
50
,
kbExpr
:
EditorContextKeys
.
textFocus
,
primary
:
KeyCode
.
RightArrow
}
}));
src/vs/workbench/parts/emmet/browser/actions/showEmmetCommands.ts
浏览文件 @
6217946d
...
...
@@ -9,14 +9,12 @@ import nls = require('vs/nls');
import
{
TPromise
}
from
'
vs/base/common/winjs.base
'
;
import
{
ICommonCodeEditor
}
from
'
vs/editor/common/editorCommon
'
;
import
{
e
ditorAction
,
EditorAction
,
ServicesAccessor
}
from
'
vs/editor/common/editorCommonExtensions
'
;
import
{
registerE
ditorAction
,
EditorAction
,
ServicesAccessor
}
from
'
vs/editor/common/editorCommonExtensions
'
;
import
{
IQuickOpenService
}
from
'
vs/platform/quickOpen/common/quickOpen
'
;
import
{
EditorContextKeys
}
from
'
vs/editor/common/editorContextKeys
'
;
const
EMMET_COMMANDS_PREFIX
=
'
>Emmet:
'
;
@
editorAction
// @ts-ignore @editorAction uses the class
class
ShowEmmetCommandsAction
extends
EditorAction
{
constructor
()
{
...
...
@@ -33,4 +31,6 @@ class ShowEmmetCommandsAction extends EditorAction {
quickOpenService
.
show
(
EMMET_COMMANDS_PREFIX
);
return
TPromise
.
as
(
null
);
}
}
\ No newline at end of file
}
registerEditorAction
(
new
ShowEmmetCommandsAction
());
src/vs/workbench/parts/emmet/electron-browser/actions/expandAbbreviation.ts
浏览文件 @
6217946d
...
...
@@ -6,13 +6,11 @@
'
use strict
'
;
import
nls
=
require
(
'
vs/nls
'
);
import
{
EmmetEditorAction
}
from
'
vs/workbench/parts/emmet/electron-browser/emmetActions
'
;
import
{
e
ditorAction
}
from
'
vs/editor/common/editorCommonExtensions
'
;
import
{
registerE
ditorAction
}
from
'
vs/editor/common/editorCommonExtensions
'
;
import
{
EditorContextKeys
}
from
'
vs/editor/common/editorContextKeys
'
;
import
{
KeyCode
}
from
'
vs/base/common/keyCodes
'
;
import
{
ContextKeyExpr
}
from
'
vs/platform/contextkey/common/contextkey
'
;
@
editorAction
// @ts-ignore @editorAction uses the class
class
ExpandAbbreviationAction
extends
EmmetEditorAction
{
constructor
()
{
...
...
@@ -33,4 +31,6 @@ class ExpandAbbreviationAction extends EmmetEditorAction {
});
}
}
\ No newline at end of file
}
registerEditorAction
(
new
ExpandAbbreviationAction
());
src/vs/workbench/parts/quickopen/browser/commandsHandler.ts
浏览文件 @
6217946d
...
...
@@ -25,7 +25,7 @@ import { IMessageService, Severity, IMessageWithAction } from 'vs/platform/messa
import
{
ITelemetryService
}
from
'
vs/platform/telemetry/common/telemetry
'
;
import
{
IKeybindingService
}
from
'
vs/platform/keybinding/common/keybinding
'
;
import
{
IQuickOpenService
}
from
'
vs/platform/quickOpen/common/quickOpen
'
;
import
{
e
ditorAction
,
EditorAction
}
from
'
vs/editor/common/editorCommonExtensions
'
;
import
{
registerE
ditorAction
,
EditorAction
}
from
'
vs/editor/common/editorCommonExtensions
'
;
import
{
IStorageService
}
from
'
vs/platform/storage/common/storage
'
;
import
{
ILifecycleService
}
from
'
vs/platform/lifecycle/common/lifecycle
'
;
import
{
once
}
from
'
vs/base/common/event
'
;
...
...
@@ -173,8 +173,6 @@ export class ClearCommandHistoryAction extends Action {
}
}
@
editorAction
// @ts-ignore @editorAction uses the class
class
CommandPaletteEditorAction
extends
EditorAction
{
constructor
()
{
...
...
@@ -568,3 +566,5 @@ export class CommandsHandler extends QuickOpenHandler {
}
}
}
registerEditorAction
(
new
CommandPaletteEditorAction
());
src/vs/workbench/parts/scm/electron-browser/dirtydiffDecorator.ts
浏览文件 @
6217946d
...
...
@@ -29,7 +29,7 @@ import { localize } from 'vs/nls';
import
{
Color
,
RGBA
}
from
'
vs/base/common/color
'
;
import
{
ICodeEditor
,
IEditorMouseEvent
,
MouseTargetType
}
from
'
vs/editor/browser/editorBrowser
'
;
import
{
editorContribution
}
from
'
vs/editor/browser/editorBrowserExtensions
'
;
import
{
e
ditorAction
,
ServicesAccessor
,
EditorAction
,
CommonEditorRegistry
}
from
'
vs/editor/common/editorCommonExtensions
'
;
import
{
registerE
ditorAction
,
ServicesAccessor
,
EditorAction
,
CommonEditorRegistry
}
from
'
vs/editor/common/editorCommonExtensions
'
;
import
{
PeekViewWidget
,
getOuterEditor
}
from
'
vs/editor/contrib/referenceSearch/browser/peekViewWidget
'
;
import
{
IContextKeyService
,
IContextKey
,
ContextKeyExpr
,
RawContextKey
}
from
'
vs/platform/contextkey/common/contextkey
'
;
import
{
EditorContextKeys
}
from
'
vs/editor/common/editorContextKeys
'
;
...
...
@@ -361,7 +361,6 @@ class DirtyDiffWidget extends PeekViewWidget {
}
}
@
editorAction
export
class
ShowPreviousChangeAction
extends
EditorAction
{
constructor
()
{
...
...
@@ -394,8 +393,8 @@ export class ShowPreviousChangeAction extends EditorAction {
controller
.
previous
();
}
}
registerEditorAction
(
new
ShowPreviousChangeAction
());
@
editorAction
export
class
ShowNextChangeAction
extends
EditorAction
{
constructor
()
{
...
...
@@ -428,6 +427,7 @@ export class ShowNextChangeAction extends EditorAction {
controller
.
next
();
}
}
registerEditorAction
(
new
ShowNextChangeAction
());
KeybindingsRegistry
.
registerCommandAndKeybindingRule
({
id
:
'
closeDirtyDiff
'
,
...
...
src/vs/workbench/parts/snippets/electron-browser/insertSnippet.ts
浏览文件 @
6217946d
...
...
@@ -7,7 +7,7 @@
import
*
as
nls
from
'
vs/nls
'
;
import
{
TPromise
}
from
'
vs/base/common/winjs.base
'
;
import
{
ICommonCodeEditor
}
from
'
vs/editor/common/editorCommon
'
;
import
{
e
ditorAction
,
ServicesAccessor
,
EditorAction
}
from
'
vs/editor/common/editorCommonExtensions
'
;
import
{
registerE
ditorAction
,
ServicesAccessor
,
EditorAction
}
from
'
vs/editor/common/editorCommonExtensions
'
;
import
{
IQuickOpenService
,
IPickOpenEntry
}
from
'
vs/platform/quickOpen/common/quickOpen
'
;
import
{
IModeService
}
from
'
vs/editor/common/services/modeService
'
;
import
{
LanguageId
}
from
'
vs/editor/common/modes
'
;
...
...
@@ -51,8 +51,6 @@ class Args {
}
@
editorAction
// @ts-ignore @editorAction uses the class
class
InsertSnippetAction
extends
EditorAction
{
constructor
()
{
...
...
@@ -142,6 +140,8 @@ class InsertSnippetAction extends EditorAction {
}
}
registerEditorAction
(
new
InsertSnippetAction
());
// compatibility command to make sure old keybinding are still working
CommandsRegistry
.
registerCommand
(
'
editor.action.showSnippets
'
,
accessor
=>
{
return
accessor
.
get
(
ICommandService
).
executeCommand
(
'
editor.action.insertSnippet
'
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录