Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
dfd3f574
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,发现更多精彩内容 >>
提交
dfd3f574
编写于
10月 13, 2016
作者:
B
Benjamin Pasero
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
debt - get rid of onEditorOpening event
上级
30a8ec17
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
2 addition
and
52 deletion
+2
-52
src/vs/test/utils/servicesTestUtils.ts
src/vs/test/utils/servicesTestUtils.ts
+1
-7
src/vs/workbench/browser/parts/editor/editorPart.ts
src/vs/workbench/browser/parts/editor/editorPart.ts
+1
-15
src/vs/workbench/common/editor.ts
src/vs/workbench/common/editor.ts
+0
-24
src/vs/workbench/services/group/common/groupService.ts
src/vs/workbench/services/group/common/groupService.ts
+0
-6
未找到文件。
src/vs/test/utils/servicesTestUtils.ts
浏览文件 @
dfd3f574
...
...
@@ -14,7 +14,7 @@ import * as paths from 'vs/base/common/paths';
import
URI
from
'
vs/base/common/uri
'
;
import
{
ITelemetryService
,
NullTelemetryService
}
from
'
vs/platform/telemetry/common/telemetry
'
;
import
{
Storage
,
InMemoryLocalStorage
}
from
'
vs/workbench/node/storage
'
;
import
{
EditorInputEvent
,
IEditorGroup
,
ConfirmResult
}
from
'
vs/workbench/common/editor
'
;
import
{
IEditorGroup
,
ConfirmResult
}
from
'
vs/workbench/common/editor
'
;
import
Event
,
{
Emitter
}
from
'
vs/base/common/event
'
;
import
Severity
from
'
vs/base/common/severity
'
;
import
{
IConfigurationService
,
getConfigurationValue
,
IConfigurationValue
}
from
'
vs/platform/configuration/common/configuration
'
;
...
...
@@ -317,14 +317,12 @@ export class TestEditorGroupService implements IEditorGroupService {
private
stacksModel
:
EditorStacksModel
;
private
_onEditorsChanged
:
Emitter
<
void
>
;
private
_onEditorOpening
:
Emitter
<
EditorInputEvent
>
;
private
_onEditorOpenFail
:
Emitter
<
IEditorInput
>
;
private
_onEditorsMoved
:
Emitter
<
void
>
;
constructor
(
callback
?:
(
method
:
string
)
=>
void
)
{
this
.
_onEditorsMoved
=
new
Emitter
<
void
>
();
this
.
_onEditorsChanged
=
new
Emitter
<
void
>
();
this
.
_onEditorOpening
=
new
Emitter
<
EditorInputEvent
>
();
this
.
_onEditorOpenFail
=
new
Emitter
<
IEditorInput
>
();
let
services
=
new
ServiceCollection
();
...
...
@@ -348,10 +346,6 @@ export class TestEditorGroupService implements IEditorGroupService {
return
this
.
_onEditorsChanged
.
event
;
}
public
get
onEditorOpening
():
Event
<
EditorInputEvent
>
{
return
this
.
_onEditorOpening
.
event
;
}
public
get
onEditorOpenFail
():
Event
<
IEditorInput
>
{
return
this
.
_onEditorOpenFail
.
event
;
}
...
...
src/vs/workbench/browser/parts/editor/editorPart.ts
浏览文件 @
dfd3f574
...
...
@@ -20,7 +20,7 @@ import { toErrorMessage } from 'vs/base/common/errorMessage';
import
{
Scope
as
MementoScope
}
from
'
vs/workbench/common/memento
'
;
import
{
Part
}
from
'
vs/workbench/browser/part
'
;
import
{
BaseEditor
,
EditorDescriptor
}
from
'
vs/workbench/browser/parts/editor/baseEditor
'
;
import
{
IEditorRegistry
,
Extensions
as
EditorExtensions
,
EditorInput
,
EditorOptions
,
ConfirmResult
,
EditorInputEvent
,
IWorkbenchEditorConfiguration
,
IEditorDescriptor
,
TextEditorOptions
}
from
'
vs/workbench/common/editor
'
;
import
{
IEditorRegistry
,
Extensions
as
EditorExtensions
,
EditorInput
,
EditorOptions
,
ConfirmResult
,
IWorkbenchEditorConfiguration
,
IEditorDescriptor
,
TextEditorOptions
}
from
'
vs/workbench/common/editor
'
;
import
{
SideBySideEditorControl
,
Rochade
,
ISideBySideEditorControl
,
ProgressState
}
from
'
vs/workbench/browser/parts/editor/sideBySideEditorControl
'
;
import
{
WorkbenchProgressService
}
from
'
vs/workbench/services/progress/browser/progressService
'
;
import
{
GroupArrangement
}
from
'
vs/workbench/services/group/common/groupService
'
;
...
...
@@ -85,7 +85,6 @@ export class EditorPart extends Part implements IEditorPart, IEditorGroupService
private
previewEditors
:
boolean
;
private
_onEditorsChanged
:
Emitter
<
void
>
;
private
_onEditorOpening
:
Emitter
<
EditorInputEvent
>
;
private
_onEditorsMoved
:
Emitter
<
void
>
;
private
_onEditorOpenFail
:
Emitter
<
EditorInput
>
;
...
...
@@ -110,7 +109,6 @@ export class EditorPart extends Part implements IEditorPart, IEditorGroupService
super
(
id
);
this
.
_onEditorsChanged
=
new
Emitter
<
void
>
();
this
.
_onEditorOpening
=
new
Emitter
<
EditorInputEvent
>
();
this
.
_onEditorsMoved
=
new
Emitter
<
void
>
();
this
.
_onEditorOpenFail
=
new
Emitter
<
EditorInput
>
();
...
...
@@ -171,10 +169,6 @@ export class EditorPart extends Part implements IEditorPart, IEditorGroupService
return
this
.
_onEditorsChanged
.
event
;
}
public
get
onEditorOpening
():
Event
<
EditorInputEvent
>
{
return
this
.
_onEditorOpening
.
event
;
}
public
get
onEditorsMoved
():
Event
<
void
>
{
return
this
.
_onEditorsMoved
.
event
;
}
...
...
@@ -203,13 +197,6 @@ export class EditorPart extends Part implements IEditorPart, IEditorGroupService
return
TPromise
.
as
<
BaseEditor
>
(
null
);
}
// Emit early open event to allow for veto
const
event
=
new
EditorInputEvent
(
input
);
this
.
_onEditorOpening
.
fire
(
event
);
if
(
event
.
isPrevented
())
{
return
TPromise
.
as
<
BaseEditor
>
(
null
);
}
// We need an editor descriptor for the input
const
descriptor
=
Registry
.
as
<
IEditorRegistry
>
(
EditorExtensions
.
Editors
).
getEditor
(
input
);
if
(
!
descriptor
)
{
...
...
@@ -1137,7 +1124,6 @@ export class EditorPart extends Part implements IEditorPart, IEditorGroupService
// Emitters
this
.
_onEditorsChanged
.
dispose
();
this
.
_onEditorOpening
.
dispose
();
this
.
_onEditorsMoved
.
dispose
();
this
.
_onEditorOpenFail
.
dispose
();
...
...
src/vs/workbench/common/editor.ts
浏览文件 @
dfd3f574
...
...
@@ -11,7 +11,6 @@ import URI from 'vs/base/common/uri';
import
{
IEditor
,
ICommonCodeEditor
,
IEditorViewState
,
IEditorOptions
as
ICodeEditorOptions
}
from
'
vs/editor/common/editorCommon
'
;
import
{
IEditorInput
,
IEditorModel
,
IEditorOptions
,
ITextEditorOptions
,
IResourceInput
,
Position
}
from
'
vs/platform/editor/common/editor
'
;
import
{
IWorkspaceContextService
}
from
'
vs/platform/workspace/common/workspace
'
;
import
{
Event
as
BaseEvent
}
from
'
vs/base/common/events
'
;
import
{
IEditorGroupService
}
from
'
vs/workbench/services/group/common/groupService
'
;
import
{
SyncDescriptor
,
AsyncDescriptor
}
from
'
vs/platform/instantiation/common/descriptors
'
;
import
{
IInstantiationService
,
IConstructorSignature0
}
from
'
vs/platform/instantiation/common/instantiation
'
;
...
...
@@ -278,29 +277,6 @@ export abstract class EditorInput implements IEditorInput {
}
}
export
class
EditorInputEvent
extends
BaseEvent
{
private
_editorInput
:
IEditorInput
;
private
prevented
:
boolean
;
constructor
(
editorInput
:
IEditorInput
)
{
super
(
null
);
this
.
_editorInput
=
editorInput
;
}
public
get
editorInput
():
IEditorInput
{
return
this
.
_editorInput
;
}
public
prevent
():
void
{
this
.
prevented
=
true
;
}
public
isPrevented
():
boolean
{
return
this
.
prevented
;
}
}
export
enum
EncodingMode
{
/**
...
...
src/vs/workbench/services/group/common/groupService.ts
浏览文件 @
dfd3f574
...
...
@@ -9,7 +9,6 @@ import { createDecorator, ServiceIdentifier } from 'vs/platform/instantiation/co
import
{
Position
,
IEditorInput
}
from
'
vs/platform/editor/common/editor
'
;
import
{
IEditorStacksModel
,
IEditorGroup
}
from
'
vs/workbench/common/editor
'
;
import
Event
from
'
vs/base/common/event
'
;
import
{
EditorInputEvent
}
from
'
vs/workbench/common/editor
'
;
export
enum
GroupArrangement
{
MINIMIZE_OTHERS
,
...
...
@@ -30,11 +29,6 @@ export interface IEditorGroupService {
*/
onEditorsChanged
:
Event
<
void
>
;
/**
* Emitted when an editor is about to open.
*/
onEditorOpening
:
Event
<
EditorInputEvent
>
;
/**
* Emitted when opening an editor fails.
*/
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录