Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
掘金者说
vscode
提交
deb2f763
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,发现更多精彩内容 >>
提交
deb2f763
编写于
4月 30, 2018
作者:
A
Alex Dima
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Introduce and adopt ICodeEditorWidgetOptions
上级
e95910ad
变更
11
隐藏空白更改
内联
并排
Showing
11 changed file
with
81 addition
and
106 deletion
+81
-106
src/vs/editor/browser/widget/codeEditorWidget.ts
src/vs/editor/browser/widget/codeEditorWidget.ts
+31
-14
src/vs/editor/browser/widget/diffEditorWidget.ts
src/vs/editor/browser/widget/diffEditorWidget.ts
+1
-1
src/vs/editor/browser/widget/embeddedCodeEditorWidget.ts
src/vs/editor/browser/widget/embeddedCodeEditorWidget.ts
+1
-1
src/vs/editor/standalone/browser/standaloneCodeEditor.ts
src/vs/editor/standalone/browser/standaloneCodeEditor.ts
+1
-1
src/vs/editor/test/browser/testCodeEditor.ts
src/vs/editor/test/browser/testCodeEditor.ts
+12
-12
src/vs/workbench/browser/parts/editor/textEditor.ts
src/vs/workbench/browser/parts/editor/textEditor.ts
+1
-1
src/vs/workbench/parts/debug/electron-browser/breakpointWidget.ts
...orkbench/parts/debug/electron-browser/breakpointWidget.ts
+4
-2
src/vs/workbench/parts/debug/electron-browser/repl.ts
src/vs/workbench/parts/debug/electron-browser/repl.ts
+3
-2
src/vs/workbench/parts/debug/electron-browser/simpleDebugEditor.ts
...rkbench/parts/debug/electron-browser/simpleDebugEditor.ts
+14
-34
src/vs/workbench/parts/preferences/browser/preferencesEditor.ts
.../workbench/parts/preferences/browser/preferencesEditor.ts
+9
-14
src/vs/workbench/parts/welcome/walkThrough/electron-browser/walkThroughPart.ts
...s/welcome/walkThrough/electron-browser/walkThroughPart.ts
+4
-24
未找到文件。
src/vs/editor/browser/widget/codeEditorWidget.ts
浏览文件 @
deb2f763
...
...
@@ -41,7 +41,7 @@ import { ICodeEditorService } from 'vs/editor/browser/services/codeEditorService
import
{
ICommandService
}
from
'
vs/platform/commands/common/commands
'
;
import
{
IThemeService
,
registerThemingParticipant
}
from
'
vs/platform/theme/common/themeService
'
;
import
{
IContentWidgetData
,
IOverlayWidgetData
,
View
}
from
'
vs/editor/browser/view/viewImpl
'
;
import
{
IEditorContributionCtor
,
Editor
Action
,
Editor
ExtensionsRegistry
}
from
'
vs/editor/browser/editorExtensions
'
;
import
{
IEditorContributionCtor
,
EditorExtensionsRegistry
}
from
'
vs/editor/browser/editorExtensions
'
;
import
{
IMouseEvent
}
from
'
vs/base/browser/mouseEvent
'
;
import
{
InternalEditorAction
}
from
'
vs/editor/common/editorAction
'
;
import
{
ICommandDelegate
}
from
'
vs/editor/browser/view/viewController
'
;
...
...
@@ -52,6 +52,26 @@ import { ClassName } from 'vs/editor/common/model/intervalTree';
let
EDITOR_ID
=
0
;
export
interface
ICodeEditorWidgetOptions
{
/**
* Is this a simple widget (not a real code editor) ?
* Defaults to false.
*/
isSimpleWidget
?:
boolean
;
/**
* Contributions to instantiate.
* Defaults to EditorExtensionsRegistry.getEditorContributions().
*/
contributions
?:
IEditorContributionCtor
[];
/**
* Telemetry data associated with this CodeEditorWidget.
* Defaults to null.
*/
telemetryData
?:
object
;
}
export
class
CodeEditorWidget
extends
Disposable
implements
editorBrowser
.
ICodeEditor
{
//#region Eventing
...
...
@@ -143,6 +163,7 @@ export class CodeEditorWidget extends Disposable implements editorBrowser.ICodeE
//#endregion
public
readonly
isSimpleWidget
:
boolean
;
private
readonly
_telemetryData
:
object
;
private
readonly
domElement
:
HTMLElement
;
private
readonly
id
:
number
;
...
...
@@ -182,7 +203,7 @@ export class CodeEditorWidget extends Disposable implements editorBrowser.ICodeE
constructor
(
domElement
:
HTMLElement
,
options
:
editorOptions
.
IEditorOptions
,
isSimpleWidget
:
boolean
,
codeEditorWidgetOptions
:
ICodeEditorWidgetOptions
,
@
IInstantiationService
instantiationService
:
IInstantiationService
,
@
ICodeEditorService
codeEditorService
:
ICodeEditorService
,
@
ICommandService
commandService
:
ICommandService
,
...
...
@@ -195,7 +216,8 @@ export class CodeEditorWidget extends Disposable implements editorBrowser.ICodeE
this
.
id
=
(
++
EDITOR_ID
);
this
.
_decorationTypeKeysToIds
=
{};
this
.
_decorationTypeSubtypes
=
{};
this
.
isSimpleWidget
=
isSimpleWidget
;
this
.
isSimpleWidget
=
codeEditorWidgetOptions
.
isSimpleWidget
||
false
;
this
.
_telemetryData
=
codeEditorWidgetOptions
.
telemetryData
||
null
;
options
=
options
||
{};
this
.
_configuration
=
this
.
_register
(
this
.
_createConfiguration
(
options
));
...
...
@@ -230,7 +252,10 @@ export class CodeEditorWidget extends Disposable implements editorBrowser.ICodeE
this
.
contentWidgets
=
{};
this
.
overlayWidgets
=
{};
let
contributions
=
this
.
_getContributions
();
let
contributions
:
IEditorContributionCtor
[]
=
codeEditorWidgetOptions
.
contributions
;
if
(
!
Array
.
isArray
(
contributions
))
{
contributions
=
EditorExtensionsRegistry
.
getEditorContributions
();
}
for
(
let
i
=
0
,
len
=
contributions
.
length
;
i
<
len
;
i
++
)
{
let
ctor
=
contributions
[
i
];
try
{
...
...
@@ -241,7 +266,7 @@ export class CodeEditorWidget extends Disposable implements editorBrowser.ICodeE
}
}
this
.
_get
Actions
().
forEach
((
action
)
=>
{
EditorExtensionsRegistry
.
getEditor
Actions
().
forEach
((
action
)
=>
{
const
internalAction
=
new
InternalEditorAction
(
action
.
id
,
action
.
label
,
...
...
@@ -264,14 +289,6 @@ export class CodeEditorWidget extends Disposable implements editorBrowser.ICodeE
return
new
Configuration
(
options
,
this
.
domElement
);
}
protected
_getContributions
():
IEditorContributionCtor
[]
{
return
EditorExtensionsRegistry
.
getEditorContributions
();
}
protected
_getActions
():
EditorAction
[]
{
return
EditorExtensionsRegistry
.
getEditorActions
();
}
public
getId
():
string
{
return
this
.
getEditorType
()
+
'
:
'
+
this
.
id
;
}
...
...
@@ -1478,7 +1495,7 @@ export class CodeEditorWidget extends Disposable implements editorBrowser.ICodeE
"EditorTelemetryData" : {}
*/
public
getTelemetryData
():
{
[
key
:
string
]:
any
;
}
{
return
null
;
return
this
.
_telemetryData
;
}
}
...
...
src/vs/editor/browser/widget/diffEditorWidget.ts
浏览文件 @
deb2f763
...
...
@@ -469,7 +469,7 @@ export class DiffEditorWidget extends Disposable implements editorBrowser.IDiffE
}
protected
_createInnerEditor
(
instantiationService
:
IInstantiationService
,
container
:
HTMLElement
,
options
:
editorOptions
.
IEditorOptions
):
CodeEditorWidget
{
return
instantiationService
.
createInstance
(
CodeEditorWidget
,
container
,
options
,
false
);
return
instantiationService
.
createInstance
(
CodeEditorWidget
,
container
,
options
,
{}
);
}
public
dispose
():
void
{
...
...
src/vs/editor/browser/widget/embeddedCodeEditorWidget.ts
浏览文件 @
deb2f763
...
...
@@ -33,7 +33,7 @@ export class EmbeddedCodeEditorWidget extends CodeEditorWidget {
@
IThemeService
themeService
:
IThemeService
,
@
INotificationService
notificationService
:
INotificationService
)
{
super
(
domElement
,
parentEditor
.
getRawConfiguration
(),
false
,
instantiationService
,
codeEditorService
,
commandService
,
contextKeyService
,
themeService
,
notificationService
);
super
(
domElement
,
parentEditor
.
getRawConfiguration
(),
{}
,
instantiationService
,
codeEditorService
,
commandService
,
contextKeyService
,
themeService
,
notificationService
);
this
.
_parentEditor
=
parentEditor
;
this
.
_overwriteOptions
=
options
;
...
...
src/vs/editor/standalone/browser/standaloneCodeEditor.ts
浏览文件 @
deb2f763
...
...
@@ -175,7 +175,7 @@ export class StandaloneCodeEditor extends CodeEditorWidget implements IStandalon
?
nls
.
localize
(
'
accessibilityHelpMessageIE
'
,
"
Press Ctrl+F1 for Accessibility Options.
"
)
:
nls
.
localize
(
'
accessibilityHelpMessage
'
,
"
Press Alt+F1 for Accessibility Options.
"
)
);
super
(
domElement
,
options
,
false
,
instantiationService
,
codeEditorService
,
commandService
,
contextKeyService
,
themeService
,
notificationService
);
super
(
domElement
,
options
,
{}
,
instantiationService
,
codeEditorService
,
commandService
,
contextKeyService
,
themeService
,
notificationService
);
if
(
keybindingService
instanceof
StandaloneKeybindingService
)
{
this
.
_standaloneKeybindingService
=
keybindingService
;
...
...
src/vs/editor/test/browser/testCodeEditor.ts
浏览文件 @
deb2f763
...
...
@@ -14,12 +14,11 @@ import * as editorBrowser from 'vs/editor/browser/editorBrowser';
import
{
TextModel
}
from
'
vs/editor/common/model/textModel
'
;
import
{
TestConfiguration
}
from
'
vs/editor/test/common/mocks/testConfiguration
'
;
import
*
as
editorOptions
from
'
vs/editor/common/config/editorOptions
'
;
import
{
EditorAction
}
from
'
vs/editor/browser/editorExtensions
'
;
import
{
ITextModel
}
from
'
vs/editor/common/model
'
;
import
{
TestNotificationService
}
from
'
vs/platform/notification/test/common/testNotificationService
'
;
import
{
INotificationService
}
from
'
vs/platform/notification/common/notification
'
;
import
{
CodeEditorWidget
}
from
'
vs/editor/browser/widget/codeEditorWidget
'
;
import
{
I
ConstructorSignature1
}
from
'
vs/platform/instantiation/common/instantiation
'
;
import
{
CodeEditorWidget
,
ICodeEditorWidgetOptions
,
}
from
'
vs/editor/browser/widget/codeEditorWidget
'
;
import
{
I
InstantiationService
}
from
'
vs/platform/instantiation/common/instantiation
'
;
import
{
TestCodeEditorService
,
TestCommandService
}
from
'
vs/editor/test/browser/editorTestServices
'
;
import
{
ICodeEditorService
}
from
'
vs/editor/browser/services/codeEditorService
'
;
import
{
ICommandService
}
from
'
vs/platform/commands/common/commands
'
;
...
...
@@ -28,13 +27,6 @@ import { IThemeService } from 'vs/platform/theme/common/themeService';
export
class
TestCodeEditor
extends
CodeEditorWidget
implements
editorBrowser
.
ICodeEditor
{
protected
_getContributions
():
IConstructorSignature1
<
editorBrowser
.
ICodeEditor
,
editorCommon
.
IEditorContribution
>
[]
{
return
[];
}
protected
_getActions
():
EditorAction
[]
{
return
[];
}
//#region testing overrides
protected
_createConfiguration
(
options
:
editorOptions
.
IEditorOptions
):
editorCommon
.
IConfiguration
{
return
new
TestConfiguration
(
options
);
...
...
@@ -95,7 +87,7 @@ export function withTestCodeEditor(text: string[], options: TestCodeEditorCreati
export
function
createTestCodeEditor
(
options
:
TestCodeEditorCreationOptions
):
TestCodeEditor
{
const
services
:
ServiceCollection
=
options
.
serviceCollection
||
new
ServiceCollection
();
const
instantiationService
=
new
InstantiationService
(
services
);
const
instantiationService
:
IInstantiationService
=
new
InstantiationService
(
services
);
if
(
!
services
.
has
(
ICodeEditorService
))
{
services
.
set
(
ICodeEditorService
,
new
TestCodeEditorService
());
...
...
@@ -113,7 +105,15 @@ export function createTestCodeEditor(options: TestCodeEditorCreationOptions): Te
services
.
set
(
IThemeService
,
new
TestThemeService
());
}
const
editor
=
instantiationService
.
createInstance
(
TestCodeEditor
,
<
any
>
new
TestEditorDomElement
(),
options
,
false
);
const
codeEditorWidgetOptions
:
ICodeEditorWidgetOptions
=
{
contributions
:
[]
};
const
editor
=
instantiationService
.
createInstance
(
TestCodeEditor
,
<
HTMLElement
><
any
>
new
TestEditorDomElement
(),
options
,
codeEditorWidgetOptions
);
editor
.
setModel
(
options
.
model
);
return
editor
;
}
src/vs/workbench/browser/parts/editor/textEditor.ts
浏览文件 @
deb2f763
...
...
@@ -182,7 +182,7 @@ export abstract class BaseTextEditor extends BaseEditor {
protected
createEditorControl
(
parent
:
HTMLElement
,
configuration
:
IEditorOptions
):
IEditor
{
// Use a getter for the instantiation service since some subclasses might use scoped instantiation services
return
this
.
instantiationService
.
createInstance
(
CodeEditorWidget
,
parent
,
configuration
,
false
);
return
this
.
instantiationService
.
createInstance
(
CodeEditorWidget
,
parent
,
configuration
,
{}
);
}
public
setInput
(
input
:
EditorInput
,
options
?:
EditorOptions
):
TPromise
<
void
>
{
...
...
src/vs/workbench/parts/debug/electron-browser/breakpointWidget.ts
浏览文件 @
deb2f763
...
...
@@ -34,6 +34,7 @@ import { ICodeEditorService } from 'vs/editor/browser/services/codeEditorService
import
{
transparent
,
editorForeground
}
from
'
vs/platform/theme/common/colorRegistry
'
;
import
{
ServiceCollection
}
from
'
vs/platform/instantiation/common/serviceCollection
'
;
import
{
IDecorationOptions
}
from
'
vs/editor/common/editorCommon
'
;
import
{
CodeEditorWidget
}
from
'
vs/editor/browser/widget/codeEditorWidget
'
;
const
$
=
dom
.
$
;
const
IPrivateBreakopintWidgetService
=
createDecorator
<
IPrivateBreakopintWidgetService
>
(
'
privateBreakopintWidgetService
'
);
...
...
@@ -47,7 +48,7 @@ export class BreakpointWidget extends ZoneWidget implements IPrivateBreakopintWi
public
_serviceBrand
:
any
;
private
selectContainer
:
HTMLElement
;
private
input
:
SimpleDebugEditor
;
private
input
:
CodeEditorWidget
;
private
toDispose
:
lifecycle
.
IDisposable
[];
private
conditionInput
=
''
;
private
hitCountInput
=
''
;
...
...
@@ -202,7 +203,8 @@ export class BreakpointWidget extends ZoneWidget implements IPrivateBreakopintWi
[
IContextKeyService
,
scopedContextKeyService
],
[
IPrivateBreakopintWidgetService
,
this
]));
const
options
=
SimpleDebugEditor
.
getEditorOptions
();
this
.
input
=
scopedInstatiationService
.
createInstance
(
SimpleDebugEditor
,
container
,
options
);
const
codeEditorWidgetOptions
=
SimpleDebugEditor
.
getCodeEditorWidgetOptions
();
this
.
input
=
scopedInstatiationService
.
createInstance
(
CodeEditorWidget
,
container
,
options
,
codeEditorWidgetOptions
);
CONTEXT_IN_BREAKPOINT_WIDGET
.
bindTo
(
scopedContextKeyService
).
set
(
true
);
const
model
=
this
.
modelService
.
createModel
(
''
,
null
,
uri
.
parse
(
`
${
DEBUG_SCHEME
}
:breakpointinput`
),
true
);
this
.
input
.
setModel
(
model
);
...
...
src/vs/workbench/parts/debug/electron-browser/repl.ts
浏览文件 @
deb2f763
...
...
@@ -43,6 +43,7 @@ import { memoize } from 'vs/base/common/decorators';
import
{
dispose
}
from
'
vs/base/common/lifecycle
'
;
import
{
OpenMode
,
ClickBehavior
}
from
'
vs/base/parts/tree/browser/treeDefaults
'
;
import
{
EditorContextKeys
}
from
'
vs/editor/common/editorContextKeys
'
;
import
{
CodeEditorWidget
}
from
'
vs/editor/browser/widget/codeEditorWidget
'
;
const
$
=
dom
.
$
;
...
...
@@ -75,7 +76,7 @@ export class Repl extends Panel implements IPrivateReplService {
private
renderer
:
ReplExpressionsRenderer
;
private
container
:
HTMLElement
;
private
treeContainer
:
HTMLElement
;
private
replInput
:
SimpleDebugEditor
;
private
replInput
:
CodeEditorWidget
;
private
replInputContainer
:
HTMLElement
;
private
refreshTimeoutHandle
:
number
;
private
actions
:
IAction
[];
...
...
@@ -174,7 +175,7 @@ export class Repl extends Panel implements IPrivateReplService {
const
scopedInstantiationService
=
this
.
instantiationService
.
createChild
(
new
ServiceCollection
(
[
IContextKeyService
,
scopedContextKeyService
],
[
IPrivateReplService
,
this
]));
this
.
replInput
=
scopedInstantiationService
.
createInstance
(
SimpleDebugEditor
,
this
.
replInputContainer
,
SimpleDebugEditor
.
getEditor
Options
());
this
.
replInput
=
scopedInstantiationService
.
createInstance
(
CodeEditorWidget
,
this
.
replInputContainer
,
SimpleDebugEditor
.
getEditorOptions
(),
SimpleDebugEditor
.
getCodeEditorWidget
Options
());
modes
.
SuggestRegistry
.
register
({
scheme
:
debug
.
DEBUG_SCHEME
,
hasAccessToAllModels
:
true
},
{
triggerCharacters
:
[
'
.
'
],
...
...
src/vs/workbench/parts/debug/electron-browser/simpleDebugEditor.ts
浏览文件 @
deb2f763
...
...
@@ -4,12 +4,7 @@
*--------------------------------------------------------------------------------------------*/
import
{
IEditorOptions
}
from
'
vs/editor/common/config/editorOptions
'
;
import
{
EditorAction
,
EditorExtensionsRegistry
,
IEditorContributionCtor
}
from
'
vs/editor/browser/editorExtensions
'
;
import
{
ICodeEditorService
}
from
'
vs/editor/browser/services/codeEditorService
'
;
import
{
CodeEditorWidget
}
from
'
vs/editor/browser/widget/codeEditorWidget
'
;
import
{
IContextKeyService
}
from
'
vs/platform/contextkey/common/contextkey
'
;
import
{
IInstantiationService
}
from
'
vs/platform/instantiation/common/instantiation
'
;
import
{
ICommandService
}
from
'
vs/platform/commands/common/commands
'
;
import
{
ICodeEditorWidgetOptions
}
from
'
vs/editor/browser/widget/codeEditorWidget
'
;
// Allowed Editor Contributions:
import
{
MenuPreventer
}
from
'
vs/workbench/parts/codeEditor/electron-browser/menuPreventer
'
;
...
...
@@ -18,36 +13,21 @@ import { ContextMenuController } from 'vs/editor/contrib/contextmenu/contextmenu
import
{
SuggestController
}
from
'
vs/editor/contrib/suggest/suggestController
'
;
import
{
SnippetController2
}
from
'
vs/editor/contrib/snippet/snippetController2
'
;
import
{
TabCompletionController
}
from
'
vs/workbench/parts/snippets/electron-browser/tabCompletion
'
;
import
{
IThemeService
}
from
'
vs/platform/theme/common/themeService
'
;
import
{
INotificationService
}
from
'
vs/platform/notification/common/notification
'
;
export
class
SimpleDebugEditor
extends
CodeEditorWidget
{
constructor
(
domElement
:
HTMLElement
,
options
:
IEditorOptions
,
@
IInstantiationService
instantiationService
:
IInstantiationService
,
@
ICodeEditorService
codeEditorService
:
ICodeEditorService
,
@
ICommandService
commandService
:
ICommandService
,
@
IContextKeyService
contextKeyService
:
IContextKeyService
,
@
IThemeService
themeService
:
IThemeService
,
@
INotificationService
notificationService
:
INotificationService
,
)
{
super
(
domElement
,
options
,
true
,
instantiationService
,
codeEditorService
,
commandService
,
contextKeyService
,
themeService
,
notificationService
);
}
protected
_getContributions
():
IEditorContributionCtor
[]
{
return
[
MenuPreventer
,
SelectionClipboard
,
ContextMenuController
,
SuggestController
,
SnippetController2
,
TabCompletionController
,
];
}
export
class
SimpleDebugEditor
{
protected
_getActions
():
EditorAction
[]
{
return
EditorExtensionsRegistry
.
getEditorActions
();
public
static
getCodeEditorWidgetOptions
():
ICodeEditorWidgetOptions
{
return
{
isSimpleWidget
:
true
,
contributions
:
[
MenuPreventer
,
SelectionClipboard
,
ContextMenuController
,
SuggestController
,
SnippetController2
,
TabCompletionController
,
]
};
}
public
static
getEditorOptions
():
IEditorOptions
{
...
...
src/vs/workbench/parts/preferences/browser/preferencesEditor.ts
浏览文件 @
deb2f763
...
...
@@ -33,7 +33,7 @@ import { SettingsEditorModel, DefaultSettingsEditorModel } from 'vs/workbench/se
import
{
ICodeEditor
}
from
'
vs/editor/browser/editorBrowser
'
;
import
{
SearchWidget
,
SettingsTargetsWidget
,
SettingsTarget
}
from
'
vs/workbench/parts/preferences/browser/preferencesWidgets
'
;
import
{
ContextKeyExpr
,
IContextKeyService
,
IContextKey
}
from
'
vs/platform/contextkey/common/contextkey
'
;
import
{
registerEditorContribution
,
Command
,
IEditorContributionCtor
}
from
'
vs/editor/browser/editorExtensions
'
;
import
{
registerEditorContribution
,
Command
,
IEditorContributionCtor
,
EditorExtensionsRegistry
}
from
'
vs/editor/browser/editorExtensions
'
;
import
{
ITelemetryService
}
from
'
vs/platform/telemetry/common/telemetry
'
;
import
{
IThemeService
}
from
'
vs/platform/theme/common/themeService
'
;
import
{
IStorageService
}
from
'
vs/platform/storage/common/storage
'
;
...
...
@@ -965,8 +965,15 @@ export class DefaultPreferencesEditor extends BaseTextEditor {
super
(
DefaultPreferencesEditor
.
ID
,
telemetryService
,
instantiationService
,
storageService
,
configurationService
,
themeService
,
textFileService
,
editorGroupService
);
}
private
static
_getContributions
():
IEditorContributionCtor
[]
{
let
skipContributions
=
[
FoldingController
.
prototype
,
SelectionHighlighter
.
prototype
,
FindController
.
prototype
];
let
contributions
=
EditorExtensionsRegistry
.
getEditorContributions
().
filter
(
c
=>
skipContributions
.
indexOf
(
c
.
prototype
)
===
-
1
);
contributions
.
push
(
DefaultSettingsEditorContribution
);
return
contributions
;
}
public
createEditorControl
(
parent
:
HTMLElement
,
configuration
:
IEditorOptions
):
editorCommon
.
IEditor
{
const
editor
=
this
.
instantiationService
.
createInstance
(
DefaultPreferencesCodeEditor
,
parent
,
configuration
,
false
);
const
editor
=
this
.
instantiationService
.
createInstance
(
CodeEditorWidget
,
parent
,
configuration
,
{
contributions
:
DefaultPreferencesEditor
.
_getContributions
()
}
);
// Inform user about editor being readonly if user starts type
this
.
toUnbind
.
push
(
editor
.
onDidType
(()
=>
this
.
showReadonlyHint
(
editor
)));
...
...
@@ -1030,18 +1037,6 @@ export class DefaultPreferencesEditor extends BaseTextEditor {
}
}
class
DefaultPreferencesCodeEditor
extends
CodeEditorWidget
{
protected
_getContributions
():
IEditorContributionCtor
[]
{
let
contributions
=
super
.
_getContributions
();
let
skipContributions
=
[
FoldingController
.
prototype
,
SelectionHighlighter
.
prototype
,
FindController
.
prototype
];
contributions
=
contributions
.
filter
(
c
=>
skipContributions
.
indexOf
(
c
.
prototype
)
===
-
1
);
contributions
.
push
(
DefaultSettingsEditorContribution
);
return
contributions
;
}
}
interface
ISettingsEditorContribution
extends
editorCommon
.
IEditorContribution
{
updatePreferencesRenderer
(
associatedPreferencesModelUri
:
URI
):
TPromise
<
IPreferencesRenderer
<
ISetting
>>
;
...
...
src/vs/workbench/parts/welcome/walkThrough/electron-browser/walkThroughPart.ts
浏览文件 @
deb2f763
...
...
@@ -29,8 +29,7 @@ import { RawContextKey, IContextKey, IContextKeyService } from 'vs/platform/cont
import
{
IConfigurationService
}
from
'
vs/platform/configuration/common/configuration
'
;
import
{
once
}
from
'
vs/base/common/event
'
;
import
{
isObject
}
from
'
vs/base/common/types
'
;
import
{
ICommandService
,
CommandsRegistry
}
from
'
vs/platform/commands/common/commands
'
;
import
{
ICodeEditorService
}
from
'
vs/editor/browser/services/codeEditorService
'
;
import
{
CommandsRegistry
}
from
'
vs/platform/commands/common/commands
'
;
import
{
IEditorOptions
}
from
'
vs/editor/common/config/editorOptions
'
;
import
{
IThemeService
,
registerThemingParticipant
}
from
'
vs/platform/theme/common/themeService
'
;
import
{
registerColor
,
focusBorder
,
textLinkForeground
,
textLinkActiveForeground
,
textPreformatForeground
,
contrastBorder
,
textBlockQuoteBackground
,
textBlockQuoteBorder
}
from
'
vs/platform/theme/common/colorRegistry
'
;
...
...
@@ -55,27 +54,6 @@ interface IWalkThroughEditorViewState {
viewState
:
IViewState
;
}
class
WalkThroughCodeEditor
extends
CodeEditorWidget
{
constructor
(
domElement
:
HTMLElement
,
options
:
IEditorOptions
,
private
telemetryData
:
Object
,
@
IInstantiationService
instantiationService
:
IInstantiationService
,
@
ICodeEditorService
codeEditorService
:
ICodeEditorService
,
@
ICommandService
commandService
:
ICommandService
,
@
IContextKeyService
contextKeyService
:
IContextKeyService
,
@
IThemeService
themeService
:
IThemeService
,
@
INotificationService
notificationService
:
INotificationService
,
)
{
super
(
domElement
,
options
,
false
,
instantiationService
,
codeEditorService
,
commandService
,
contextKeyService
,
themeService
,
notificationService
);
}
getTelemetryData
()
{
return
this
.
telemetryData
;
}
}
export
class
WalkThroughPart
extends
BaseEditor
{
static
readonly
ID
:
string
=
'
workbench.editor.walkThroughPart
'
;
...
...
@@ -330,7 +308,9 @@ export class WalkThroughPart extends BaseEditor {
target
:
this
.
input
instanceof
WalkThroughInput
?
this
.
input
.
getTelemetryFrom
()
:
undefined
,
snippet
:
i
};
const
editor
=
this
.
instantiationService
.
createInstance
(
WalkThroughCodeEditor
,
div
,
options
,
telemetryData
);
const
editor
=
this
.
instantiationService
.
createInstance
(
CodeEditorWidget
,
div
,
options
,
{
telemetryData
:
telemetryData
});
editor
.
setModel
(
model
);
this
.
contentDisposables
.
push
(
editor
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录