Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
86757168
V
vscode
项目概览
xxadev
/
vscode
与 Fork 源项目一致
从无法访问的项目Fork
通知
2
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
V
vscode
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
86757168
编写于
11月 08, 2017
作者:
A
Alex Dima
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Remove usages of @commonEditorContribution (#37212)
上级
6217946d
变更
13
显示空白变更内容
内联
并排
Showing
13 changed file
with
57 addition
and
54 deletion
+57
-54
src/vs/editor/common/editorCommonExtensions.ts
src/vs/editor/common/editorCommonExtensions.ts
+1
-1
src/vs/editor/contrib/bracketMatching/common/bracketMatching.ts
.../editor/contrib/bracketMatching/common/bracketMatching.ts
+2
-2
src/vs/editor/contrib/format/browser/formatActions.ts
src/vs/editor/contrib/format/browser/formatActions.ts
+3
-5
src/vs/editor/contrib/inPlaceReplace/common/inPlaceReplace.ts
...vs/editor/contrib/inPlaceReplace/common/inPlaceReplace.ts
+2
-2
src/vs/editor/contrib/indentation/common/indentation.ts
src/vs/editor/contrib/indentation/common/indentation.ts
+2
-2
src/vs/editor/contrib/message/messageController.ts
src/vs/editor/contrib/message/messageController.ts
+3
-2
src/vs/editor/contrib/multicursor/common/multicursor.ts
src/vs/editor/contrib/multicursor/common/multicursor.ts
+4
-3
src/vs/editor/contrib/referenceSearch/browser/referenceSearch.ts
...editor/contrib/referenceSearch/browser/referenceSearch.ts
+3
-2
src/vs/editor/contrib/smartSelect/common/smartSelect.ts
src/vs/editor/contrib/smartSelect/common/smartSelect.ts
+2
-2
src/vs/editor/contrib/snippet/browser/snippetController2.ts
src/vs/editor/contrib/snippet/browser/snippetController2.ts
+3
-2
src/vs/editor/contrib/wordHighlighter/common/wordHighlighter.ts
.../editor/contrib/wordHighlighter/common/wordHighlighter.ts
+25
-26
src/vs/workbench/parts/codeEditor/electron-browser/toggleWordWrap.ts
...bench/parts/codeEditor/electron-browser/toggleWordWrap.ts
+4
-3
src/vs/workbench/parts/snippets/electron-browser/tabCompletion.ts
...orkbench/parts/snippets/electron-browser/tabCompletion.ts
+3
-2
未找到文件。
src/vs/editor/common/editorCommonExtensions.ts
浏览文件 @
86757168
...
...
@@ -225,7 +225,7 @@ export function registerEditorCommand<T extends EditorCommand>(editorCommand: T)
return
editorCommand
;
}
export
function
c
ommonEditorContribution
(
ctor
:
ICommonEditorContributionCtor
):
void
{
export
function
registerC
ommonEditorContribution
(
ctor
:
ICommonEditorContributionCtor
):
void
{
EditorContributionRegistry
.
INSTANCE
.
registerEditorContribution
(
ctor
);
}
...
...
src/vs/editor/contrib/bracketMatching/common/bracketMatching.ts
浏览文件 @
86757168
...
...
@@ -13,7 +13,7 @@ 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
{
registerEditorAction
,
c
ommonEditorContribution
,
ServicesAccessor
,
EditorAction
}
from
'
vs/editor/common/editorCommonExtensions
'
;
import
{
registerEditorAction
,
registerC
ommonEditorContribution
,
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
'
;
...
...
@@ -54,7 +54,6 @@ class BracketsData {
}
}
@
commonEditorContribution
export
class
BracketMatchingController
extends
Disposable
implements
editorCommon
.
IEditorContribution
{
private
static
ID
=
'
editor.contrib.bracketMatchingController
'
;
...
...
@@ -225,6 +224,7 @@ export class BracketMatchingController extends Disposable implements editorCommo
}
}
registerCommonEditorContribution
(
BracketMatchingController
);
registerEditorAction
(
new
SelectBracketAction
());
registerThemingParticipant
((
theme
,
collector
)
=>
{
let
bracketMatchBackground
=
theme
.
getColor
(
editorBracketMatchBackground
);
...
...
src/vs/editor/contrib/format/browser/formatActions.ts
浏览文件 @
86757168
...
...
@@ -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
{
registerEditorAction
,
ServicesAccessor
,
EditorAction
,
c
ommonEditorContribution
,
IActionOptions
}
from
'
vs/editor/common/editorCommonExtensions
'
;
import
{
registerEditorAction
,
ServicesAccessor
,
EditorAction
,
registerC
ommonEditorContribution
,
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
'
;
...
...
@@ -53,8 +53,6 @@ function alertFormattingEdits(edits: editorCommon.ISingleEditOperation[]): void
}
}
@
commonEditorContribution
// @ts-ignore @editorAction uses the class
class
FormatOnType
implements
editorCommon
.
IEditorContribution
{
private
static
ID
=
'
editor.contrib.autoFormat
'
;
...
...
@@ -180,8 +178,6 @@ class FormatOnType implements editorCommon.IEditorContribution {
}
}
@
commonEditorContribution
// @ts-ignore @editorAction uses the class
class
FormatOnPaste
implements
editorCommon
.
IEditorContribution
{
private
static
ID
=
'
editor.contrib.formatOnPaste
'
;
...
...
@@ -356,6 +352,8 @@ export class FormatSelectionAction extends AbstractFormatAction {
}
}
registerCommonEditorContribution
(
FormatOnType
);
registerCommonEditorContribution
(
FormatOnPaste
);
registerEditorAction
(
new
FormatDocumentAction
());
registerEditorAction
(
new
FormatSelectionAction
());
...
...
src/vs/editor/contrib/inPlaceReplace/common/inPlaceReplace.ts
浏览文件 @
86757168
...
...
@@ -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
{
registerEditorAction
,
ServicesAccessor
,
EditorAction
,
c
ommonEditorContribution
}
from
'
vs/editor/common/editorCommonExtensions
'
;
import
{
registerEditorAction
,
ServicesAccessor
,
EditorAction
,
registerC
ommonEditorContribution
}
from
'
vs/editor/common/editorCommonExtensions
'
;
import
{
IInplaceReplaceSupportResult
}
from
'
vs/editor/common/modes
'
;
import
{
IEditorWorkerService
}
from
'
vs/editor/common/services/editorWorkerService
'
;
import
{
InPlaceReplaceCommand
}
from
'
./inPlaceReplaceCommand
'
;
...
...
@@ -20,7 +20,6 @@ import { registerThemingParticipant } from 'vs/platform/theme/common/themeServic
import
{
editorBracketMatchBorder
}
from
'
vs/editor/common/view/editorColorRegistry
'
;
import
{
ModelDecorationOptions
}
from
'
vs/editor/common/model/textModelWithDecorations
'
;
@
commonEditorContribution
class
InPlaceReplaceController
implements
IEditorContribution
{
private
static
ID
=
'
editor.contrib.inPlaceReplaceController
'
;
...
...
@@ -186,6 +185,7 @@ class InPlaceReplaceDown extends EditorAction {
}
}
registerCommonEditorContribution
(
InPlaceReplaceController
);
registerEditorAction
(
new
InPlaceReplaceUp
());
registerEditorAction
(
new
InPlaceReplaceDown
());
...
...
src/vs/editor/contrib/indentation/common/indentation.ts
浏览文件 @
86757168
...
...
@@ -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
{
registerEditorAction
,
ServicesAccessor
,
IActionOptions
,
EditorAction
,
c
ommonEditorContribution
}
from
'
vs/editor/common/editorCommonExtensions
'
;
import
{
registerEditorAction
,
ServicesAccessor
,
IActionOptions
,
EditorAction
,
registerC
ommonEditorContribution
}
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
'
;
...
...
@@ -376,7 +376,6 @@ export class AutoIndentOnPasteCommand implements ICommand {
}
}
@
commonEditorContribution
export
class
AutoIndentOnPaste
implements
IEditorContribution
{
private
static
ID
=
'
editor.contrib.autoIndentOnPaste
'
;
...
...
@@ -616,6 +615,7 @@ export class IndentationToTabsCommand implements ICommand {
}
}
registerCommonEditorContribution
(
AutoIndentOnPaste
);
registerEditorAction
(
new
IndentationToSpacesAction
());
registerEditorAction
(
new
IndentationToTabsAction
());
registerEditorAction
(
new
IndentUsingTabs
());
...
...
src/vs/editor/contrib/message/messageController.ts
浏览文件 @
86757168
...
...
@@ -12,14 +12,13 @@ import { IDisposable, dispose } from 'vs/base/common/lifecycle';
import
{
alert
}
from
'
vs/base/browser/ui/aria/aria
'
;
import
{
Range
}
from
'
vs/editor/common/core/range
'
;
import
*
as
editorCommon
from
'
vs/editor/common/editorCommon
'
;
import
{
c
ommonEditorContribution
,
CommonEditorRegistry
,
EditorCommand
}
from
'
vs/editor/common/editorCommonExtensions
'
;
import
{
registerC
ommonEditorContribution
,
CommonEditorRegistry
,
EditorCommand
}
from
'
vs/editor/common/editorCommonExtensions
'
;
import
{
ICodeEditor
,
IContentWidget
,
IContentWidgetPosition
,
ContentWidgetPositionPreference
}
from
'
vs/editor/browser/editorBrowser
'
;
import
{
IContextKeyService
,
RawContextKey
,
IContextKey
}
from
'
vs/platform/contextkey/common/contextkey
'
;
import
{
IPosition
}
from
'
vs/editor/common/core/position
'
;
import
{
registerThemingParticipant
,
HIGH_CONTRAST
}
from
'
vs/platform/theme/common/themeService
'
;
import
{
inputValidationInfoBorder
,
inputValidationInfoBackground
}
from
'
vs/platform/theme/common/colorRegistry
'
;
@
commonEditorContribution
export
class
MessageController
{
private
static
_id
=
'
editor.contrib.messageController
'
;
...
...
@@ -174,6 +173,8 @@ class MessageWidget implements IContentWidget {
}
}
registerCommonEditorContribution
(
MessageController
);
registerThemingParticipant
((
theme
,
collector
)
=>
{
let
border
=
theme
.
getColor
(
inputValidationInfoBorder
);
if
(
border
)
{
...
...
src/vs/editor/contrib/multicursor/common/multicursor.ts
浏览文件 @
86757168
...
...
@@ -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
{
registerEditorAction
,
c
ommonEditorContribution
,
ServicesAccessor
,
EditorAction
}
from
'
vs/editor/common/editorCommonExtensions
'
;
import
{
registerEditorAction
,
registerC
ommonEditorContribution
,
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
'
;
...
...
@@ -300,7 +300,6 @@ export class MultiCursorSession {
}
}
@
commonEditorContribution
export
class
MultiCursorSelectionController
extends
Disposable
implements
IEditorContribution
{
private
static
ID
=
'
editor.contrib.multiCursorController
'
;
...
...
@@ -653,7 +652,6 @@ class SelectionHighlighterState {
}
}
@
commonEditorContribution
export
class
SelectionHighlighter
extends
Disposable
implements
IEditorContribution
{
private
static
ID
=
'
editor.contrib.selectionHighlighter
'
;
...
...
@@ -902,6 +900,9 @@ function getValueInRange(model: IModel, range: Range, toLowerCase: boolean): str
return
(
toLowerCase
?
text
.
toLowerCase
()
:
text
);
}
registerCommonEditorContribution
(
MultiCursorSelectionController
);
registerCommonEditorContribution
(
SelectionHighlighter
);
registerEditorAction
(
new
InsertCursorAbove
());
registerEditorAction
(
new
InsertCursorBelow
());
registerEditorAction
(
new
InsertCursorAtEndOfEachLineSelected
());
...
...
src/vs/editor/contrib/referenceSearch/browser/referenceSearch.ts
浏览文件 @
86757168
...
...
@@ -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
{
registerEditorAction
,
ServicesAccessor
,
EditorAction
,
CommonEditorRegistry
,
c
ommonEditorContribution
}
from
'
vs/editor/common/editorCommonExtensions
'
;
import
{
registerEditorAction
,
ServicesAccessor
,
EditorAction
,
CommonEditorRegistry
,
registerC
ommonEditorContribution
}
from
'
vs/editor/common/editorCommonExtensions
'
;
import
{
Location
,
ReferenceProviderRegistry
}
from
'
vs/editor/common/modes
'
;
import
{
PeekContext
,
getOuterEditor
}
from
'
./peekViewWidget
'
;
import
{
ReferencesController
,
RequestOptions
,
ctxReferenceSearchVisible
}
from
'
./referencesController
'
;
...
...
@@ -31,7 +31,6 @@ const defaultReferenceSearchOptions: RequestOptions = {
}
};
@
commonEditorContribution
export
class
ReferenceController
implements
editorCommon
.
IEditorContribution
{
private
static
ID
=
'
editor.contrib.referenceController
'
;
...
...
@@ -87,6 +86,8 @@ export class ReferenceAction extends EditorAction {
}
}
registerCommonEditorContribution
(
ReferenceController
);
registerEditorAction
(
new
ReferenceAction
());
let
findReferencesCommand
:
ICommandHandler
=
(
accessor
:
ServicesAccessor
,
resource
:
URI
,
position
:
IPosition
)
=>
{
...
...
src/vs/editor/contrib/smartSelect/common/smartSelect.ts
浏览文件 @
86757168
...
...
@@ -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
{
registerEditorAction
,
ServicesAccessor
,
IActionOptions
,
EditorAction
,
c
ommonEditorContribution
}
from
'
vs/editor/common/editorCommonExtensions
'
;
import
{
registerEditorAction
,
ServicesAccessor
,
IActionOptions
,
EditorAction
,
registerC
ommonEditorContribution
}
from
'
vs/editor/common/editorCommonExtensions
'
;
import
{
TokenSelectionSupport
,
ILogicalSelectionEntry
}
from
'
./tokenSelectionSupport
'
;
import
{
ICursorPositionChangedEvent
}
from
'
vs/editor/common/controller/cursorEvents
'
;
...
...
@@ -39,7 +39,6 @@ var ignoreSelection = false;
// -- action implementation
@
commonEditorContribution
class
SmartSelectController
implements
IEditorContribution
{
private
static
ID
=
'
editor.contrib.smartSelectController
'
;
...
...
@@ -195,5 +194,6 @@ class ShrinkSelectionAction extends AbstractSmartSelect {
}
}
registerCommonEditorContribution
(
SmartSelectController
);
registerEditorAction
(
new
GrowSelectionAction
());
registerEditorAction
(
new
ShrinkSelectionAction
());
src/vs/editor/contrib/snippet/browser/snippetController2.ts
浏览文件 @
86757168
...
...
@@ -7,7 +7,7 @@
import
{
RawContextKey
,
IContextKey
,
IContextKeyService
,
ContextKeyExpr
}
from
'
vs/platform/contextkey/common/contextkey
'
;
import
{
ICommonCodeEditor
}
from
'
vs/editor/common/editorCommon
'
;
import
{
c
ommonEditorContribution
,
CommonEditorRegistry
,
EditorCommand
}
from
'
vs/editor/common/editorCommonExtensions
'
;
import
{
registerC
ommonEditorContribution
,
CommonEditorRegistry
,
EditorCommand
}
from
'
vs/editor/common/editorCommonExtensions
'
;
import
{
dispose
,
IDisposable
}
from
'
vs/base/common/lifecycle
'
;
import
{
SnippetSession
}
from
'
./snippetSession
'
;
import
{
EditorContextKeys
}
from
'
vs/editor/common/editorContextKeys
'
;
...
...
@@ -18,7 +18,6 @@ import { Selection } from 'vs/editor/common/core/selection';
import
{
Choice
}
from
'
vs/editor/contrib/snippet/browser/snippetParser
'
;
import
{
repeat
}
from
'
vs/base/common/strings
'
;
@
commonEditorContribution
export
class
SnippetController2
{
static
get
(
editor
:
ICommonCodeEditor
):
SnippetController2
{
...
...
@@ -183,6 +182,8 @@ export class SnippetController2 {
}
registerCommonEditorContribution
(
SnippetController2
);
const
CommandCtor
=
EditorCommand
.
bindToContribution
<
SnippetController2
>
(
SnippetController2
.
get
);
CommonEditorRegistry
.
registerEditorCommand
(
new
CommandCtor
({
...
...
src/vs/editor/contrib/wordHighlighter/common/wordHighlighter.ts
浏览文件 @
86757168
...
...
@@ -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
,
c
ommonEditorContribution
,
EditorAction
,
IActionOptions
,
registerEditorAction
}
from
'
vs/editor/common/editorCommonExtensions
'
;
import
{
CommonEditorRegistry
,
registerC
ommonEditorContribution
,
EditorAction
,
IActionOptions
,
registerEditorAction
}
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
'
;
...
...
@@ -397,9 +397,6 @@ class WordHighlighter {
}
}
@
commonEditorContribution
class
WordHighlighterContribution
implements
editorCommon
.
IEditorContribution
{
private
static
ID
=
'
editor.contrib.wordHighlighter
'
;
...
...
@@ -444,28 +441,6 @@ class WordHighlighterContribution implements editorCommon.IEditorContribution {
}
}
registerThemingParticipant
((
theme
,
collector
)
=>
{
let
selectionHighlight
=
theme
.
getColor
(
editorSelectionHighlight
);
if
(
selectionHighlight
)
{
collector
.
addRule
(
`.monaco-editor .focused .selectionHighlight { background-color:
${
selectionHighlight
}
; }`
);
collector
.
addRule
(
`.monaco-editor .selectionHighlight { background-color:
${
selectionHighlight
.
transparent
(
0.5
)}
; }`
);
}
let
wordHighlight
=
theme
.
getColor
(
editorWordHighlight
);
if
(
wordHighlight
)
{
collector
.
addRule
(
`.monaco-editor .wordHighlight { background-color:
${
wordHighlight
}
; }`
);
}
let
wordHighlightStrong
=
theme
.
getColor
(
editorWordHighlightStrong
);
if
(
wordHighlightStrong
)
{
collector
.
addRule
(
`.monaco-editor .wordHighlightStrong { background-color:
${
wordHighlightStrong
}
; }`
);
}
let
hcOutline
=
theme
.
getColor
(
activeContrastBorder
);
if
(
hcOutline
)
{
collector
.
addRule
(
`.monaco-editor .selectionHighlight { border: 1px dotted
${
hcOutline
}
; box-sizing: border-box; }`
);
collector
.
addRule
(
`.monaco-editor .wordHighlight { border: 1px dashed
${
hcOutline
}
; box-sizing: border-box; }`
);
collector
.
addRule
(
`.monaco-editor .wordHighlightStrong { border: 1px dashed
${
hcOutline
}
; box-sizing: border-box; }`
);
}
});
class
WordHighlightNavigationAction
extends
EditorAction
{
...
...
@@ -520,5 +495,29 @@ class PrevWordHighlightAction extends WordHighlightNavigationAction {
}
}
registerCommonEditorContribution
(
WordHighlighterContribution
);
registerEditorAction
(
new
NextWordHighlightAction
());
registerEditorAction
(
new
PrevWordHighlightAction
());
registerThemingParticipant
((
theme
,
collector
)
=>
{
let
selectionHighlight
=
theme
.
getColor
(
editorSelectionHighlight
);
if
(
selectionHighlight
)
{
collector
.
addRule
(
`.monaco-editor .focused .selectionHighlight { background-color:
${
selectionHighlight
}
; }`
);
collector
.
addRule
(
`.monaco-editor .selectionHighlight { background-color:
${
selectionHighlight
.
transparent
(
0.5
)}
; }`
);
}
let
wordHighlight
=
theme
.
getColor
(
editorWordHighlight
);
if
(
wordHighlight
)
{
collector
.
addRule
(
`.monaco-editor .wordHighlight { background-color:
${
wordHighlight
}
; }`
);
}
let
wordHighlightStrong
=
theme
.
getColor
(
editorWordHighlightStrong
);
if
(
wordHighlightStrong
)
{
collector
.
addRule
(
`.monaco-editor .wordHighlightStrong { background-color:
${
wordHighlightStrong
}
; }`
);
}
let
hcOutline
=
theme
.
getColor
(
activeContrastBorder
);
if
(
hcOutline
)
{
collector
.
addRule
(
`.monaco-editor .selectionHighlight { border: 1px dotted
${
hcOutline
}
; box-sizing: border-box; }`
);
collector
.
addRule
(
`.monaco-editor .wordHighlight { border: 1px dashed
${
hcOutline
}
; box-sizing: border-box; }`
);
collector
.
addRule
(
`.monaco-editor .wordHighlightStrong { border: 1px dashed
${
hcOutline
}
; box-sizing: border-box; }`
);
}
});
src/vs/workbench/parts/codeEditor/electron-browser/toggleWordWrap.ts
浏览文件 @
86757168
...
...
@@ -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
{
registerEditorAction
,
ServicesAccessor
,
EditorAction
,
c
ommonEditorContribution
}
from
'
vs/editor/common/editorCommonExtensions
'
;
import
{
registerEditorAction
,
ServicesAccessor
,
EditorAction
,
registerC
ommonEditorContribution
}
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
'
;
...
...
@@ -173,8 +173,6 @@ class ToggleWordWrapAction extends EditorAction {
}
}
@
commonEditorContribution
// @ts-ignore @editorAction uses the class
class
ToggleWordWrapController
extends
Disposable
implements
IEditorContribution
{
private
static
_ID
=
'
editor.contrib.toggleWordWrapController
'
;
...
...
@@ -250,6 +248,9 @@ function canToggleWordWrap(uri: URI): boolean {
return
(
uri
.
scheme
!==
'
output
'
&&
uri
.
scheme
!==
'
vscode
'
);
}
registerCommonEditorContribution
(
ToggleWordWrapController
);
registerEditorAction
(
new
ToggleWordWrapAction
());
MenuRegistry
.
appendMenuItem
(
MenuId
.
EditorTitle
,
{
...
...
src/vs/workbench/parts/snippets/electron-browser/tabCompletion.ts
浏览文件 @
86757168
...
...
@@ -16,14 +16,13 @@ import { endsWith } from 'vs/base/common/strings';
import
{
IDisposable
,
dispose
}
from
'
vs/base/common/lifecycle
'
;
import
*
as
editorCommon
from
'
vs/editor/common/editorCommon
'
;
import
{
Range
}
from
'
vs/editor/common/core/range
'
;
import
{
CommonEditorRegistry
,
c
ommonEditorContribution
,
EditorCommand
}
from
'
vs/editor/common/editorCommonExtensions
'
;
import
{
CommonEditorRegistry
,
registerC
ommonEditorContribution
,
EditorCommand
}
from
'
vs/editor/common/editorCommonExtensions
'
;
import
{
SnippetController2
}
from
'
vs/editor/contrib/snippet/browser/snippetController2
'
;
import
{
showSimpleSuggestions
}
from
'
vs/editor/contrib/suggest/browser/suggest
'
;
import
{
IConfigurationRegistry
,
Extensions
as
ConfigExt
}
from
'
vs/platform/configuration/common/configurationRegistry
'
;
import
{
EditorContextKeys
}
from
'
vs/editor/common/editorContextKeys
'
;
import
{
IConfigurationService
}
from
'
vs/platform/configuration/common/configuration
'
;
@
commonEditorContribution
export
class
TabCompletionController
implements
editorCommon
.
IEditorContribution
{
private
static
ID
=
'
editor.tabCompletionController
'
;
...
...
@@ -132,6 +131,8 @@ export class TabCompletionController implements editorCommon.IEditorContribution
}
}
registerCommonEditorContribution
(
TabCompletionController
);
const
TabCompletionCommand
=
EditorCommand
.
bindToContribution
<
TabCompletionController
>
(
TabCompletionController
.
get
);
CommonEditorRegistry
.
registerEditorCommand
(
new
TabCompletionCommand
({
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录