Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
8907b120
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,发现更多精彩内容 >>
提交
8907b120
编写于
7月 06, 2016
作者:
B
Benjamin Pasero
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix a bit of #8578
上级
a1ec009e
变更
16
隐藏空白更改
内联
并排
Showing
16 changed file
with
123 addition
and
114 deletion
+123
-114
src/vs/workbench/browser/parts/editor/baseEditor.ts
src/vs/workbench/browser/parts/editor/baseEditor.ts
+2
-85
src/vs/workbench/browser/parts/editor/editor.contribution.ts
src/vs/workbench/browser/parts/editor/editor.contribution.ts
+2
-1
src/vs/workbench/browser/parts/editor/editorPart.ts
src/vs/workbench/browser/parts/editor/editorPart.ts
+7
-7
src/vs/workbench/browser/workbench.ts
src/vs/workbench/browser/workbench.ts
+2
-2
src/vs/workbench/common/editor.ts
src/vs/workbench/common/editor.ts
+94
-0
src/vs/workbench/common/editor/editorStacksModel.ts
src/vs/workbench/common/editor/editorStacksModel.ts
+1
-2
src/vs/workbench/parts/extensions/electron-browser/extensions.contribution.ts
...ts/extensions/electron-browser/extensions.contribution.ts
+2
-1
src/vs/workbench/parts/files/browser/editors/fileEditorInput.ts
.../workbench/parts/files/browser/editors/fileEditorInput.ts
+2
-3
src/vs/workbench/parts/files/browser/files.contribution.ts
src/vs/workbench/parts/files/browser/files.contribution.ts
+1
-2
src/vs/workbench/parts/files/test/browser/textFileEditor.test.ts
...workbench/parts/files/test/browser/textFileEditor.test.ts
+1
-1
src/vs/workbench/parts/html/browser/html.contribution.ts
src/vs/workbench/parts/html/browser/html.contribution.ts
+2
-1
src/vs/workbench/services/editor/browser/editorService.ts
src/vs/workbench/services/editor/browser/editorService.ts
+2
-2
src/vs/workbench/services/history/browser/history.ts
src/vs/workbench/services/history/browser/history.ts
+1
-2
src/vs/workbench/test/browser/parts/editor/baseEditor.test.ts
...vs/workbench/test/browser/parts/editor/baseEditor.test.ts
+2
-2
src/vs/workbench/test/browser/parts/quickOpen/quickopen.test.ts
.../workbench/test/browser/parts/quickOpen/quickopen.test.ts
+1
-1
src/vs/workbench/test/common/editor/editorStacksModel.test.ts
...vs/workbench/test/common/editor/editorStacksModel.test.ts
+1
-2
未找到文件。
src/vs/workbench/browser/parts/editor/baseEditor.ts
浏览文件 @
8907b120
...
...
@@ -11,7 +11,7 @@ import types = require('vs/base/common/types');
import
{
Builder
}
from
'
vs/base/browser/builder
'
;
import
{
Registry
}
from
'
vs/platform/platform
'
;
import
{
Panel
}
from
'
vs/workbench/browser/panel
'
;
import
{
EditorInput
,
IFileEditorInput
,
EditorOptions
}
from
'
vs/workbench/common/editor
'
;
import
{
EditorInput
,
IFileEditorInput
,
EditorOptions
,
IEditorDescriptor
,
IEditorInputFactory
,
IEditorRegistry
,
Extensions
}
from
'
vs/workbench/common/editor
'
;
import
{
IEditor
,
Position
,
POSITIONS
}
from
'
vs/platform/editor/common/editor
'
;
import
{
IInstantiationService
,
IConstructorSignature0
}
from
'
vs/platform/instantiation/common/instantiation
'
;
import
{
SyncDescriptor
,
AsyncDescriptor
}
from
'
vs/platform/instantiation/common/descriptors
'
;
...
...
@@ -144,7 +144,7 @@ export abstract class BaseEditor extends Panel implements IEditor {
* A lightweight descriptor of an editor. The descriptor is deferred so that heavy editors
* can load lazily in the workbench.
*/
export
class
EditorDescriptor
extends
AsyncDescriptor
<
BaseEditor
>
{
export
class
EditorDescriptor
extends
AsyncDescriptor
<
BaseEditor
>
implements
IEditorDescriptor
{
private
id
:
string
;
private
name
:
string
;
...
...
@@ -168,89 +168,6 @@ export class EditorDescriptor extends AsyncDescriptor<BaseEditor> {
}
}
export
const
Extensions
=
{
Editors
:
'
workbench.contributions.editors
'
};
export
interface
IEditorRegistry
{
/**
* Registers an editor to the platform for the given input type. The second parameter also supports an
* array of input classes to be passed in. If the more than one editor is registered for the same editor
* input, the input itself will be asked which editor it prefers if this method is provided. Otherwise
* the first editor in the list will be returned.
*
* @param editorInputDescriptor a constructor function that returns an instance of EditorInput for which the
* registered editor should be used for.
*/
registerEditor
(
descriptor
:
EditorDescriptor
,
editorInputDescriptor
:
SyncDescriptor
<
EditorInput
>
):
void
;
registerEditor
(
descriptor
:
EditorDescriptor
,
editorInputDescriptor
:
SyncDescriptor
<
EditorInput
>
[]):
void
;
/**
* Returns the editor descriptor for the given input or null if none.
*/
getEditor
(
input
:
EditorInput
):
EditorDescriptor
;
/**
* Returns the editor descriptor for the given identifier or null if none.
*/
getEditorById
(
editorId
:
string
):
EditorDescriptor
;
/**
* Returns an array of registered editors known to the platform.
*/
getEditors
():
EditorDescriptor
[];
/**
* Registers the default input to be used for files in the workbench.
*
* @param editorInputDescriptor a descriptor that resolves to an instance of EditorInput that
* should be used to handle file inputs.
*/
registerDefaultFileInput
(
editorInputDescriptor
:
AsyncDescriptor
<
IFileEditorInput
>
):
void
;
/**
* Returns a descriptor of the default input to be used for files in the workbench.
*
* @return a descriptor that resolves to an instance of EditorInput that should be used to handle
* file inputs.
*/
getDefaultFileInput
():
AsyncDescriptor
<
IFileEditorInput
>
;
/**
* Registers a editor input factory for the given editor input to the registry. An editor input factory
* is capable of serializing and deserializing editor inputs from string data.
*
* @param editorInputId the identifier of the editor input
* @param factory the editor input factory for serialization/deserialization
*/
registerEditorInputFactory
(
editorInputId
:
string
,
ctor
:
IConstructorSignature0
<
IEditorInputFactory
>
):
void
;
/**
* Returns the editor input factory for the given editor input.
*
* @param editorInputId the identifier of the editor input
*/
getEditorInputFactory
(
editorInputId
:
string
):
IEditorInputFactory
;
setInstantiationService
(
service
:
IInstantiationService
):
void
;
}
export
interface
IEditorInputFactory
{
/**
* Returns a string representation of the provided editor input that contains enough information
* to deserialize back to the original editor input from the deserialize() method.
*/
serialize
(
editorInput
:
EditorInput
):
string
;
/**
* Returns an editor input from the provided serialized form of the editor input. This form matches
* the value returned from the serialize() method.
*/
deserialize
(
instantiationService
:
IInstantiationService
,
serializedEditorInput
:
string
):
EditorInput
;
}
const
INPUT_DESCRIPTORS_PROPERTY
=
'
__$inputDescriptors
'
;
class
EditorRegistry
implements
IEditorRegistry
{
...
...
src/vs/workbench/browser/parts/editor/editor.contribution.ts
浏览文件 @
8907b120
...
...
@@ -9,7 +9,8 @@ import nls = require('vs/nls');
import
{
Action
,
IAction
}
from
'
vs/base/common/actions
'
;
import
{
IEditorQuickOpenEntry
,
IQuickOpenRegistry
,
Extensions
as
QuickOpenExtensions
,
QuickOpenHandlerDescriptor
}
from
'
vs/workbench/browser/quickopen
'
;
import
{
StatusbarItemDescriptor
,
StatusbarAlignment
,
IStatusbarRegistry
,
Extensions
as
StatusExtensions
}
from
'
vs/workbench/browser/parts/statusbar/statusbar
'
;
import
{
EditorDescriptor
,
IEditorRegistry
,
Extensions
as
EditorExtensions
}
from
'
vs/workbench/browser/parts/editor/baseEditor
'
;
import
{
EditorDescriptor
}
from
'
vs/workbench/browser/parts/editor/baseEditor
'
;
import
{
IEditorRegistry
,
Extensions
as
EditorExtensions
}
from
'
vs/workbench/common/editor
'
;
import
{
StringEditorInput
}
from
'
vs/workbench/common/editor/stringEditorInput
'
;
import
{
StringEditor
}
from
'
vs/workbench/browser/parts/editor/stringEditor
'
;
import
{
DiffEditorInput
}
from
'
vs/workbench/common/editor/diffEditorInput
'
;
...
...
src/vs/workbench/browser/parts/editor/editorPart.ts
浏览文件 @
8907b120
...
...
@@ -19,8 +19,8 @@ import errors = require('vs/base/common/errors');
import
{
Scope
as
MementoScope
}
from
'
vs/workbench/common/memento
'
;
import
{
Scope
}
from
'
vs/workbench/browser/actionBarRegistry
'
;
import
{
Part
}
from
'
vs/workbench/browser/part
'
;
import
{
IEditorRegistry
,
Extensions
as
EditorExtensions
,
BaseEditor
,
EditorDescriptor
}
from
'
vs/workbench/browser/parts/editor/baseEditor
'
;
import
{
EditorInput
,
EditorOptions
,
ConfirmResult
,
EditorInputEvent
,
IWorkbenchEditorConfiguration
}
from
'
vs/workbench/common/editor
'
;
import
{
BaseEditor
,
EditorDescriptor
}
from
'
vs/workbench/browser/parts/editor/baseEditor
'
;
import
{
IEditorRegistry
,
Extensions
as
EditorExtensions
,
EditorInput
,
EditorOptions
,
ConfirmResult
,
EditorInputEvent
,
IWorkbenchEditorConfiguration
,
IEditorDescriptor
}
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/editor/common/editorService
'
;
...
...
@@ -226,7 +226,7 @@ export class EditorPart extends Part implements IEditorPart, IEditorGroupService
return
this
.
doOpenEditor
(
position
,
descriptor
,
input
,
options
,
widthRatios
);
}
private
doOpenEditor
(
position
:
Position
,
descriptor
:
EditorDescriptor
,
input
:
EditorInput
,
options
:
EditorOptions
,
widthRatios
:
number
[]):
TPromise
<
BaseEditor
>
{
private
doOpenEditor
(
position
:
Position
,
descriptor
:
I
EditorDescriptor
,
input
:
EditorInput
,
options
:
EditorOptions
,
widthRatios
:
number
[]):
TPromise
<
BaseEditor
>
{
// Update stacks: We do this early on before the UI is there because we want our stacks model to have
// a consistent view of the editor world and updating it later async after the UI is there will cause
...
...
@@ -267,7 +267,7 @@ export class EditorPart extends Part implements IEditorPart, IEditorGroupService
});
}
private
doShowEditor
(
group
:
EditorGroup
,
descriptor
:
EditorDescriptor
,
input
:
EditorInput
,
options
:
EditorOptions
,
widthRatios
:
number
[],
monitor
:
ProgressMonitor
):
TPromise
<
BaseEditor
>
{
private
doShowEditor
(
group
:
EditorGroup
,
descriptor
:
I
EditorDescriptor
,
input
:
EditorInput
,
options
:
EditorOptions
,
widthRatios
:
number
[],
monitor
:
ProgressMonitor
):
TPromise
<
BaseEditor
>
{
let
position
=
this
.
stacks
.
positionOfGroup
(
group
);
const
editorAtPosition
=
this
.
visibleEditors
[
position
];
...
...
@@ -310,7 +310,7 @@ export class EditorPart extends Part implements IEditorPart, IEditorGroupService
},
(
e
:
any
)
=>
this
.
messageService
.
show
(
Severity
.
Error
,
types
.
isString
(
e
)
?
new
Error
(
e
)
:
e
));
}
private
doCreateEditor
(
group
:
EditorGroup
,
descriptor
:
EditorDescriptor
,
monitor
:
ProgressMonitor
):
TPromise
<
BaseEditor
>
{
private
doCreateEditor
(
group
:
EditorGroup
,
descriptor
:
I
EditorDescriptor
,
monitor
:
ProgressMonitor
):
TPromise
<
BaseEditor
>
{
let
position
=
this
.
stacks
.
positionOfGroup
(
group
);
// We need the container for this editor now
...
...
@@ -354,7 +354,7 @@ export class EditorPart extends Part implements IEditorPart, IEditorGroupService
});
}
private
doInstantiateEditor
(
group
:
EditorGroup
,
descriptor
:
EditorDescriptor
):
TPromise
<
BaseEditor
>
{
private
doInstantiateEditor
(
group
:
EditorGroup
,
descriptor
:
I
EditorDescriptor
):
TPromise
<
BaseEditor
>
{
let
position
=
this
.
stacks
.
positionOfGroup
(
group
);
// Return early if already instantiated
...
...
@@ -389,7 +389,7 @@ export class EditorPart extends Part implements IEditorPart, IEditorGroupService
return
TPromise
.
wrapError
(
arg
);
};
let
instantiateEditorPromise
=
editorInstantiationService
.
createInstance
(
descriptor
).
then
(
onInstantiate
,
onInstantiate
);
let
instantiateEditorPromise
=
editorInstantiationService
.
createInstance
(
<
EditorDescriptor
>
descriptor
).
then
(
onInstantiate
,
onInstantiate
);
if
(
!
loaded
)
{
this
.
mapEditorInstantiationPromiseToEditor
[
position
][
descriptor
.
getId
()]
=
instantiateEditorPromise
;
...
...
src/vs/workbench/browser/workbench.ts
浏览文件 @
8907b120
...
...
@@ -22,8 +22,8 @@ import {Identifiers} from 'vs/workbench/common/constants';
import
{
isWindows
,
isLinux
}
from
'
vs/base/common/platform
'
;
import
{
IOptions
}
from
'
vs/workbench/common/options
'
;
import
{
IWorkbenchContributionsRegistry
,
Extensions
as
WorkbenchExtensions
}
from
'
vs/workbench/common/contributions
'
;
import
{
IEditorRegistry
,
Extensions
as
EditorExtensions
,
BaseEditor
}
from
'
vs/workbench/browser/parts/editor/baseEditor
'
;
import
{
TextEditorOptions
,
EditorInput
,
EditorOptions
}
from
'
vs/workbench/common/editor
'
;
import
{
BaseEditor
}
from
'
vs/workbench/browser/parts/editor/baseEditor
'
;
import
{
IEditorRegistry
,
Extensions
as
EditorExtensions
,
TextEditorOptions
,
EditorInput
,
EditorOptions
}
from
'
vs/workbench/common/editor
'
;
import
{
Part
}
from
'
vs/workbench/browser/part
'
;
import
{
HistoryService
}
from
'
vs/workbench/services/history/browser/history
'
;
import
{
ActivitybarPart
}
from
'
vs/workbench/browser/parts/activitybar/activitybarPart
'
;
...
...
src/vs/workbench/common/editor.ts
浏览文件 @
8907b120
...
...
@@ -14,6 +14,8 @@ import {IEditorInput, IEditorModel, IEditorOptions, IEditorOptionsBag, ITextEdit
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
'
;
export
enum
ConfirmResult
{
SAVE
,
...
...
@@ -21,6 +23,98 @@ export enum ConfirmResult {
CANCEL
}
export
interface
IEditorDescriptor
{
getId
():
string
;
getName
():
string
;
describes
(
obj
:
any
):
boolean
;
}
export
const
Extensions
=
{
Editors
:
'
workbench.contributions.editors
'
};
export
interface
IEditorRegistry
{
/**
* Registers an editor to the platform for the given input type. The second parameter also supports an
* array of input classes to be passed in. If the more than one editor is registered for the same editor
* input, the input itself will be asked which editor it prefers if this method is provided. Otherwise
* the first editor in the list will be returned.
*
* @param editorInputDescriptor a constructor function that returns an instance of EditorInput for which the
* registered editor should be used for.
*/
registerEditor
(
descriptor
:
IEditorDescriptor
,
editorInputDescriptor
:
SyncDescriptor
<
EditorInput
>
):
void
;
registerEditor
(
descriptor
:
IEditorDescriptor
,
editorInputDescriptor
:
SyncDescriptor
<
EditorInput
>
[]):
void
;
/**
* Returns the editor descriptor for the given input or null if none.
*/
getEditor
(
input
:
EditorInput
):
IEditorDescriptor
;
/**
* Returns the editor descriptor for the given identifier or null if none.
*/
getEditorById
(
editorId
:
string
):
IEditorDescriptor
;
/**
* Returns an array of registered editors known to the platform.
*/
getEditors
():
IEditorDescriptor
[];
/**
* Registers the default input to be used for files in the workbench.
*
* @param editorInputDescriptor a descriptor that resolves to an instance of EditorInput that
* should be used to handle file inputs.
*/
registerDefaultFileInput
(
editorInputDescriptor
:
AsyncDescriptor
<
IFileEditorInput
>
):
void
;
/**
* Returns a descriptor of the default input to be used for files in the workbench.
*
* @return a descriptor that resolves to an instance of EditorInput that should be used to handle
* file inputs.
*/
getDefaultFileInput
():
AsyncDescriptor
<
IFileEditorInput
>
;
/**
* Registers a editor input factory for the given editor input to the registry. An editor input factory
* is capable of serializing and deserializing editor inputs from string data.
*
* @param editorInputId the identifier of the editor input
* @param factory the editor input factory for serialization/deserialization
*/
registerEditorInputFactory
(
editorInputId
:
string
,
ctor
:
IConstructorSignature0
<
IEditorInputFactory
>
):
void
;
/**
* Returns the editor input factory for the given editor input.
*
* @param editorInputId the identifier of the editor input
*/
getEditorInputFactory
(
editorInputId
:
string
):
IEditorInputFactory
;
setInstantiationService
(
service
:
IInstantiationService
):
void
;
}
export
interface
IEditorInputFactory
{
/**
* Returns a string representation of the provided editor input that contains enough information
* to deserialize back to the original editor input from the deserialize() method.
*/
serialize
(
editorInput
:
EditorInput
):
string
;
/**
* Returns an editor input from the provided serialized form of the editor input. This form matches
* the value returned from the serialize() method.
*/
deserialize
(
instantiationService
:
IInstantiationService
,
serializedEditorInput
:
string
):
EditorInput
;
}
/**
* Editor inputs are lightweight objects that can be passed to the workbench API to open inside the editor part.
* Each editor input is mapped to an editor that is capable of opening it through the Platform facade.
...
...
src/vs/workbench/common/editor/editorStacksModel.ts
浏览文件 @
8907b120
...
...
@@ -6,7 +6,7 @@
'
use strict
'
;
import
Event
,
{
Emitter
}
from
'
vs/base/common/event
'
;
import
{
EditorInput
,
getUntitledOrFileResource
,
IEditorStacksModel
,
IEditorGroup
,
IEditorIdentifier
,
IGroupEvent
,
GroupIdentifier
,
IStacksModelChangeEvent
,
IWorkbenchEditorConfiguration
,
EditorOpenPositioning
}
from
'
vs/workbench/common/editor
'
;
import
{
IEditorRegistry
,
Extensions
,
EditorInput
,
getUntitledOrFileResource
,
IEditorStacksModel
,
IEditorGroup
,
IEditorIdentifier
,
IGroupEvent
,
GroupIdentifier
,
IStacksModelChangeEvent
,
IWorkbenchEditorConfiguration
,
EditorOpenPositioning
}
from
'
vs/workbench/common/editor
'
;
import
URI
from
'
vs/base/common/uri
'
;
import
{
IStorageService
,
StorageScope
}
from
'
vs/platform/storage/common/storage
'
;
import
{
IInstantiationService
}
from
'
vs/platform/instantiation/common/instantiation
'
;
...
...
@@ -14,7 +14,6 @@ import {IConfigurationService} from 'vs/platform/configuration/common/configurat
import
{
ILifecycleService
}
from
'
vs/platform/lifecycle/common/lifecycle
'
;
import
{
IWorkspaceContextService
}
from
'
vs/workbench/services/workspace/common/contextService
'
;
import
{
dispose
,
IDisposable
}
from
'
vs/base/common/lifecycle
'
;
import
{
IEditorRegistry
,
Extensions
}
from
'
vs/workbench/browser/parts/editor/baseEditor
'
;
import
{
Registry
}
from
'
vs/platform/platform
'
;
import
{
Position
,
Direction
}
from
'
vs/platform/editor/common/editor
'
;
import
{
DiffEditorInput
}
from
'
vs/workbench/common/editor/diffEditorInput
'
;
...
...
src/vs/workbench/parts/extensions/electron-browser/extensions.contribution.ts
浏览文件 @
8907b120
...
...
@@ -16,7 +16,8 @@ import { ExtensionTipsService } from 'vs/workbench/parts/extensions/electron-bro
import
{
IWorkbenchContributionsRegistry
,
Extensions
as
WorkbenchExtensions
}
from
'
vs/workbench/common/contributions
'
;
import
{
ExtensionsWorkbenchExtension
,
StatusUpdater
}
from
'
vs/workbench/parts/extensions/electron-browser/extensionsWorkbenchExtension
'
;
import
{
IOutputChannelRegistry
,
Extensions
as
OutputExtensions
}
from
'
vs/workbench/parts/output/common/output
'
;
import
{
EditorDescriptor
,
IEditorRegistry
,
Extensions
as
EditorExtensions
}
from
'
vs/workbench/browser/parts/editor/baseEditor
'
;
import
{
EditorDescriptor
}
from
'
vs/workbench/browser/parts/editor/baseEditor
'
;
import
{
IEditorRegistry
,
Extensions
as
EditorExtensions
}
from
'
vs/workbench/common/editor
'
;
import
{
SyncDescriptor
}
from
'
vs/platform/instantiation/common/descriptors
'
;
import
{
VIEWLET_ID
,
IExtensionsWorkbenchService
}
from
'
./extensions
'
;
import
{
ExtensionsWorkbenchService
}
from
'
./extensionsWorkbenchService
'
;
...
...
src/vs/workbench/parts/files/browser/editors/fileEditorInput.ts
浏览文件 @
8907b120
...
...
@@ -13,8 +13,7 @@ import labels = require('vs/base/common/labels');
import
URI
from
'
vs/base/common/uri
'
;
import
strings
=
require
(
'
vs/base/common/strings
'
);
import
assert
=
require
(
'
vs/base/common/assert
'
);
import
{
EditorModel
,
EncodingMode
,
ConfirmResult
}
from
'
vs/workbench/common/editor
'
;
import
{
IEditorRegistry
,
Extensions
,
EditorDescriptor
}
from
'
vs/workbench/browser/parts/editor/baseEditor
'
;
import
{
IEditorRegistry
,
Extensions
,
EditorModel
,
EncodingMode
,
ConfirmResult
,
IEditorDescriptor
}
from
'
vs/workbench/common/editor
'
;
import
{
BinaryEditorModel
}
from
'
vs/workbench/common/editor/binaryEditorModel
'
;
import
{
IFileOperationResult
,
FileOperationResult
}
from
'
vs/platform/files/common/files
'
;
import
{
FileEditorDescriptor
}
from
'
vs/workbench/parts/files/browser/files
'
;
...
...
@@ -195,7 +194,7 @@ export class FileEditorInput extends CommonFileEditorInput {
let
editorRegistry
=
(
<
IEditorRegistry
>
Registry
.
as
(
Extensions
.
Editors
));
// Lookup Editor by Mime
let
descriptor
:
EditorDescriptor
;
let
descriptor
:
I
EditorDescriptor
;
let
mimes
=
this
.
mime
.
split
(
'
,
'
);
for
(
let
m
=
0
;
m
<
mimes
.
length
;
m
++
)
{
let
mime
=
strings
.
trim
(
mimes
[
m
]);
...
...
src/vs/workbench/parts/files/browser/files.contribution.ts
浏览文件 @
8907b120
...
...
@@ -15,8 +15,7 @@ import {Registry} from 'vs/platform/platform';
import
{
IConfigurationRegistry
,
Extensions
as
ConfigurationExtensions
}
from
'
vs/platform/configuration/common/configurationRegistry
'
;
import
{
IWorkbenchActionRegistry
,
Extensions
as
ActionExtensions
}
from
'
vs/workbench/common/actionRegistry
'
;
import
{
IWorkbenchContributionsRegistry
,
Extensions
as
WorkbenchExtensions
}
from
'
vs/workbench/common/contributions
'
;
import
{
IEditorRegistry
,
Extensions
as
EditorExtensions
,
IEditorInputFactory
}
from
'
vs/workbench/browser/parts/editor/baseEditor
'
;
import
{
EditorInput
,
IFileEditorInput
}
from
'
vs/workbench/common/editor
'
;
import
{
IEditorRegistry
,
Extensions
as
EditorExtensions
,
IEditorInputFactory
,
EditorInput
,
IFileEditorInput
}
from
'
vs/workbench/common/editor
'
;
import
{
FileEditorDescriptor
}
from
'
vs/workbench/parts/files/browser/files
'
;
import
{
AutoSaveConfiguration
,
SUPPORTED_ENCODINGS
}
from
'
vs/platform/files/common/files
'
;
import
{
FILE_EDITOR_INPUT_ID
,
VIEWLET_ID
}
from
'
vs/workbench/parts/files/common/files
'
;
...
...
src/vs/workbench/parts/files/test/browser/textFileEditor.test.ts
浏览文件 @
8907b120
...
...
@@ -12,7 +12,7 @@ import {FileEditorDescriptor} from 'vs/workbench/parts/files/browser/files';
import
{
Registry
}
from
'
vs/platform/platform
'
;
import
{
SyncDescriptor
}
from
'
vs/platform/instantiation/common/descriptors
'
;
import
{
FileEditorInput
}
from
'
vs/workbench/parts/files/browser/editors/fileEditorInput
'
;
import
{
Extensions
}
from
'
vs/workbench/
browser/parts/editor/baseE
ditor
'
;
import
{
Extensions
}
from
'
vs/workbench/
common/e
ditor
'
;
import
{
TestTextFileService
,
TestEventService
,
TestContextService
}
from
'
vs/workbench/test/common/servicesTestUtils
'
;
import
{
IEventService
}
from
'
vs/platform/event/common/event
'
;
import
{
IWorkspaceContextService
}
from
'
vs/platform/workspace/common/workspace
'
;
...
...
src/vs/workbench/parts/html/browser/html.contribution.ts
浏览文件 @
8907b120
...
...
@@ -13,7 +13,8 @@ import {Position as EditorPosition} from 'vs/platform/editor/common/editor';
import
{
HtmlInput
}
from
'
../common/htmlInput
'
;
import
{
HtmlPreviewPart
}
from
'
vs/workbench/parts/html/browser/htmlPreviewPart
'
;
import
{
Registry
}
from
'
vs/platform/platform
'
;
import
{
EditorDescriptor
,
IEditorRegistry
,
Extensions
as
EditorExtensions
}
from
'
vs/workbench/browser/parts/editor/baseEditor
'
;
import
{
EditorDescriptor
}
from
'
vs/workbench/browser/parts/editor/baseEditor
'
;
import
{
IEditorRegistry
,
Extensions
as
EditorExtensions
}
from
'
vs/workbench/common/editor
'
;
import
{
SyncDescriptor
}
from
'
vs/platform/instantiation/common/descriptors
'
;
// --- Register Editor
...
...
src/vs/workbench/services/editor/browser/editorService.ts
浏览文件 @
8907b120
...
...
@@ -13,8 +13,8 @@ import {basename, dirname} from 'vs/base/common/paths';
import
types
=
require
(
'
vs/base/common/types
'
);
import
{
IDiffEditor
,
ICodeEditor
}
from
'
vs/editor/browser/editorBrowser
'
;
import
{
ICommonCodeEditor
,
IModel
,
EditorType
,
IEditor
as
ICommonEditor
}
from
'
vs/editor/common/editorCommon
'
;
import
{
BaseEditor
,
IEditorRegistry
,
Extensions
}
from
'
vs/workbench/browser/parts/editor/baseEditor
'
;
import
{
EditorInput
,
EditorOptions
,
IFileEditorInput
,
TextEditorOptions
}
from
'
vs/workbench/common/editor
'
;
import
{
BaseEditor
}
from
'
vs/workbench/browser/parts/editor/baseEditor
'
;
import
{
EditorInput
,
EditorOptions
,
IFileEditorInput
,
TextEditorOptions
,
IEditorRegistry
,
Extensions
}
from
'
vs/workbench/common/editor
'
;
import
{
ResourceEditorInput
}
from
'
vs/workbench/common/editor/resourceEditorInput
'
;
import
{
UntitledEditorInput
}
from
'
vs/workbench/common/editor/untitledEditorInput
'
;
import
{
DiffEditorInput
}
from
'
vs/workbench/common/editor/diffEditorInput
'
;
...
...
src/vs/workbench/services/history/browser/history.ts
浏览文件 @
8907b120
...
...
@@ -10,7 +10,7 @@ import platform = require('vs/base/common/platform');
import
nls
=
require
(
'
vs/nls
'
);
import
{
EventType
}
from
'
vs/base/common/events
'
;
import
{
IEditor
as
IBaseEditor
}
from
'
vs/platform/editor/common/editor
'
;
import
{
TextEditorOptions
,
EditorInput
,
IGroupEvent
}
from
'
vs/workbench/common/editor
'
;
import
{
TextEditorOptions
,
EditorInput
,
IGroupEvent
,
IEditorRegistry
,
Extensions
}
from
'
vs/workbench/common/editor
'
;
import
{
BaseTextEditor
}
from
'
vs/workbench/browser/parts/editor/textEditor
'
;
import
{
IWorkbenchEditorService
}
from
'
vs/workbench/services/editor/common/editorService
'
;
import
{
IHistoryService
}
from
'
vs/workbench/services/history/common/history
'
;
...
...
@@ -21,7 +21,6 @@ import {IWorkspaceContextService} from 'vs/platform/workspace/common/workspace';
import
{
IDisposable
,
dispose
}
from
'
vs/base/common/lifecycle
'
;
import
{
IStorageService
,
StorageScope
}
from
'
vs/platform/storage/common/storage
'
;
import
{
ILifecycleService
}
from
'
vs/platform/lifecycle/common/lifecycle
'
;
import
{
IEditorRegistry
,
Extensions
}
from
'
vs/workbench/browser/parts/editor/baseEditor
'
;
import
{
Registry
}
from
'
vs/platform/platform
'
;
import
{
IInstantiationService
}
from
'
vs/platform/instantiation/common/instantiation
'
;
import
{
IEditorGroupService
}
from
'
vs/workbench/services/group/common/groupService
'
;
...
...
src/vs/workbench/test/browser/parts/editor/baseEditor.test.ts
浏览文件 @
8907b120
...
...
@@ -6,8 +6,8 @@
'
use strict
'
;
import
*
as
assert
from
'
assert
'
;
import
{
BaseEditor
,
EditorInputAction
,
EditorInputActionContributor
,
EditorDescriptor
,
Extensions
,
IEditorRegistry
,
IEditorInputFactory
}
from
'
vs/workbench/browser/parts/editor/baseEditor
'
;
import
{
EditorInput
,
EditorOptions
}
from
'
vs/workbench/common/editor
'
;
import
{
BaseEditor
,
EditorInputAction
,
EditorInputActionContributor
,
EditorDescriptor
}
from
'
vs/workbench/browser/parts/editor/baseEditor
'
;
import
{
EditorInput
,
EditorOptions
,
Extensions
,
IEditorRegistry
,
IEditorInputFactory
}
from
'
vs/workbench/common/editor
'
;
import
{
IInstantiationService
}
from
'
vs/platform/instantiation/common/instantiation
'
;
import
{
InstantiationService
}
from
'
vs/platform/instantiation/common/instantiationService
'
;
import
*
as
Platform
from
'
vs/platform/platform
'
;
...
...
src/vs/workbench/test/browser/parts/quickOpen/quickopen.test.ts
浏览文件 @
8907b120
...
...
@@ -10,7 +10,7 @@ import 'vs/workbench/browser/parts/editor/editor.contribution'; // make sure to
import
{
TestQuickOpenService
}
from
'
vs/workbench/test/common/servicesTestUtils
'
;
import
{
Registry
}
from
'
vs/platform/platform
'
;
import
{
QuickOpenHandlerDescriptor
,
IQuickOpenRegistry
,
Extensions
as
QuickOpenExtensions
,
QuickOpenAction
}
from
'
vs/workbench/browser/quickopen
'
;
import
{
Extensions
}
from
'
vs/workbench/
browser/parts/editor/baseE
ditor
'
;
import
{
Extensions
}
from
'
vs/workbench/
common/e
ditor
'
;
suite
(
'
Workbench QuickOpen
'
,
()
=>
{
...
...
src/vs/workbench/test/common/editor/editorStacksModel.test.ts
浏览文件 @
8907b120
...
...
@@ -7,7 +7,7 @@
import
*
as
assert
from
'
assert
'
;
import
{
EditorStacksModel
,
EditorGroup
}
from
'
vs/workbench/common/editor/editorStacksModel
'
;
import
{
EditorInput
,
IFileEditorInput
,
IEditorIdentifier
,
IEditorGroup
,
IStacksModelChangeEvent
}
from
'
vs/workbench/common/editor
'
;
import
{
EditorInput
,
IFileEditorInput
,
IEditorIdentifier
,
IEditorGroup
,
IStacksModelChangeEvent
,
IEditorRegistry
,
Extensions
as
EditorExtensions
,
IEditorInputFactory
}
from
'
vs/workbench/common/editor
'
;
import
URI
from
'
vs/base/common/uri
'
;
import
{
TestStorageService
,
TestConfigurationService
,
TestLifecycleService
,
TestContextService
,
TestWorkspace
,
TestConfiguration
}
from
'
vs/workbench/test/common/servicesTestUtils
'
;
import
{
InstantiationService
}
from
'
vs/platform/instantiation/common/instantiationService
'
;
...
...
@@ -16,7 +16,6 @@ import {ServiceCollection} from 'vs/platform/instantiation/common/serviceCollect
import
{
IStorageService
}
from
'
vs/platform/storage/common/storage
'
;
import
{
ILifecycleService
}
from
'
vs/platform/lifecycle/common/lifecycle
'
;
import
{
IWorkspaceContextService
}
from
'
vs/workbench/services/workspace/common/contextService
'
;
import
{
IEditorRegistry
,
Extensions
as
EditorExtensions
,
IEditorInputFactory
}
from
'
vs/workbench/browser/parts/editor/baseEditor
'
;
import
{
Registry
}
from
'
vs/platform/platform
'
;
import
{
Position
,
Direction
}
from
'
vs/platform/editor/common/editor
'
;
import
{
IInstantiationService
}
from
'
vs/platform/instantiation/common/instantiation
'
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录