Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
cd762483
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,发现更多精彩内容 >>
提交
cd762483
编写于
2月 28, 2020
作者:
B
Benjamin Pasero
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
tests - more coverage for text file editors
上级
86b7936c
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
162 addition
and
22 deletion
+162
-22
src/vs/workbench/contrib/files/browser/editors/textFileEditor.ts
...workbench/contrib/files/browser/editors/textFileEditor.ts
+6
-4
src/vs/workbench/contrib/files/electron-browser/textFileEditor.ts
...orkbench/contrib/files/electron-browser/textFileEditor.ts
+5
-3
src/vs/workbench/contrib/files/test/browser/textFileEditor.test.ts
...rkbench/contrib/files/test/browser/textFileEditor.test.ts
+110
-0
src/vs/workbench/services/editor/test/browser/editorService.test.ts
...kbench/services/editor/test/browser/editorService.test.ts
+20
-1
src/vs/workbench/test/browser/workbenchTestServices.ts
src/vs/workbench/test/browser/workbenchTestServices.ts
+21
-14
未找到文件。
src/vs/workbench/contrib/files/browser/editors/textFileEditor.ts
浏览文件 @
cd762483
...
@@ -31,6 +31,7 @@ import { IEditorGroupView } from 'vs/workbench/browser/parts/editor/editor';
...
@@ -31,6 +31,7 @@ import { IEditorGroupView } from 'vs/workbench/browser/parts/editor/editor';
import
{
createErrorWithActions
}
from
'
vs/base/common/errorsWithActions
'
;
import
{
createErrorWithActions
}
from
'
vs/base/common/errorsWithActions
'
;
import
{
MutableDisposable
}
from
'
vs/base/common/lifecycle
'
;
import
{
MutableDisposable
}
from
'
vs/base/common/lifecycle
'
;
import
{
EditorActivation
,
IEditorOptions
}
from
'
vs/platform/editor/common/editor
'
;
import
{
EditorActivation
,
IEditorOptions
}
from
'
vs/platform/editor/common/editor
'
;
import
{
IConfigurationService
}
from
'
vs/platform/configuration/common/configuration
'
;
/**
/**
* An implementation of editor for file system resources.
* An implementation of editor for file system resources.
...
@@ -49,14 +50,15 @@ export class TextFileEditor extends BaseTextEditor {
...
@@ -49,14 +50,15 @@ export class TextFileEditor extends BaseTextEditor {
@
IInstantiationService
instantiationService
:
IInstantiationService
,
@
IInstantiationService
instantiationService
:
IInstantiationService
,
@
IWorkspaceContextService
private
readonly
contextService
:
IWorkspaceContextService
,
@
IWorkspaceContextService
private
readonly
contextService
:
IWorkspaceContextService
,
@
IStorageService
storageService
:
IStorageService
,
@
IStorageService
storageService
:
IStorageService
,
@
ITextResourceConfigurationService
c
onfigurationService
:
ITextResourceConfigurationService
,
@
ITextResourceConfigurationService
textResourceC
onfigurationService
:
ITextResourceConfigurationService
,
@
IEditorService
editorService
:
IEditorService
,
@
IEditorService
editorService
:
IEditorService
,
@
IThemeService
themeService
:
IThemeService
,
@
IThemeService
themeService
:
IThemeService
,
@
IEditorGroupsService
editorGroupService
:
IEditorGroupsService
,
@
IEditorGroupsService
editorGroupService
:
IEditorGroupsService
,
@
ITextFileService
private
readonly
textFileService
:
ITextFileService
,
@
ITextFileService
private
readonly
textFileService
:
ITextFileService
,
@
IExplorerService
private
readonly
explorerService
:
IExplorerService
@
IExplorerService
private
readonly
explorerService
:
IExplorerService
,
@
IConfigurationService
private
readonly
configurationService
:
IConfigurationService
)
{
)
{
super
(
TextFileEditor
.
ID
,
telemetryService
,
instantiationService
,
storageService
,
c
onfigurationService
,
themeService
,
editorService
,
editorGroupService
);
super
(
TextFileEditor
.
ID
,
telemetryService
,
instantiationService
,
storageService
,
textResourceC
onfigurationService
,
themeService
,
editorService
,
editorGroupService
);
this
.
updateRestoreViewStateConfiguration
();
this
.
updateRestoreViewStateConfiguration
();
...
@@ -87,7 +89,7 @@ export class TextFileEditor extends BaseTextEditor {
...
@@ -87,7 +89,7 @@ export class TextFileEditor extends BaseTextEditor {
}
}
private
updateRestoreViewStateConfiguration
():
void
{
private
updateRestoreViewStateConfiguration
():
void
{
this
.
restoreViewState
=
this
.
textResourceConfigurationService
.
getValue
(
undefined
,
'
workbench.editor.restoreViewState
'
)
;
this
.
restoreViewState
=
this
.
configurationService
.
getValue
(
'
workbench.editor.restoreViewState
'
)
??
true
/* default */
;
}
}
getTitle
():
string
{
getTitle
():
string
{
...
...
src/vs/workbench/contrib/files/electron-browser/textFileEditor.ts
浏览文件 @
cd762483
...
@@ -24,6 +24,7 @@ import { ITextFileService } from 'vs/workbench/services/textfile/common/textfile
...
@@ -24,6 +24,7 @@ import { ITextFileService } from 'vs/workbench/services/textfile/common/textfile
import
{
IPreferencesService
}
from
'
vs/workbench/services/preferences/common/preferences
'
;
import
{
IPreferencesService
}
from
'
vs/workbench/services/preferences/common/preferences
'
;
import
{
IExplorerService
}
from
'
vs/workbench/contrib/files/common/files
'
;
import
{
IExplorerService
}
from
'
vs/workbench/contrib/files/common/files
'
;
import
{
IElectronService
}
from
'
vs/platform/electron/node/electron
'
;
import
{
IElectronService
}
from
'
vs/platform/electron/node/electron
'
;
import
{
IConfigurationService
}
from
'
vs/platform/configuration/common/configuration
'
;
/**
/**
* An implementation of editor for file system resources.
* An implementation of editor for file system resources.
...
@@ -37,16 +38,17 @@ export class NativeTextFileEditor extends TextFileEditor {
...
@@ -37,16 +38,17 @@ export class NativeTextFileEditor extends TextFileEditor {
@
IInstantiationService
instantiationService
:
IInstantiationService
,
@
IInstantiationService
instantiationService
:
IInstantiationService
,
@
IWorkspaceContextService
contextService
:
IWorkspaceContextService
,
@
IWorkspaceContextService
contextService
:
IWorkspaceContextService
,
@
IStorageService
storageService
:
IStorageService
,
@
IStorageService
storageService
:
IStorageService
,
@
ITextResourceConfigurationService
c
onfigurationService
:
ITextResourceConfigurationService
,
@
ITextResourceConfigurationService
textResourceC
onfigurationService
:
ITextResourceConfigurationService
,
@
IEditorService
editorService
:
IEditorService
,
@
IEditorService
editorService
:
IEditorService
,
@
IThemeService
themeService
:
IThemeService
,
@
IThemeService
themeService
:
IThemeService
,
@
IEditorGroupsService
editorGroupService
:
IEditorGroupsService
,
@
IEditorGroupsService
editorGroupService
:
IEditorGroupsService
,
@
ITextFileService
textFileService
:
ITextFileService
,
@
ITextFileService
textFileService
:
ITextFileService
,
@
IElectronService
private
readonly
electronService
:
IElectronService
,
@
IElectronService
private
readonly
electronService
:
IElectronService
,
@
IPreferencesService
private
readonly
preferencesService
:
IPreferencesService
,
@
IPreferencesService
private
readonly
preferencesService
:
IPreferencesService
,
@
IExplorerService
explorerService
:
IExplorerService
@
IExplorerService
explorerService
:
IExplorerService
,
@
IConfigurationService
configurationService
:
IConfigurationService
)
{
)
{
super
(
telemetryService
,
fileService
,
viewletService
,
instantiationService
,
contextService
,
storageService
,
configurationService
,
editorService
,
themeService
,
editorGroupService
,
textFileService
,
explorer
Service
);
super
(
telemetryService
,
fileService
,
viewletService
,
instantiationService
,
contextService
,
storageService
,
textResourceConfigurationService
,
editorService
,
themeService
,
editorGroupService
,
textFileService
,
explorerService
,
configuration
Service
);
}
}
protected
handleSetInputError
(
error
:
Error
,
input
:
FileEditorInput
,
options
:
EditorOptions
|
undefined
):
void
{
protected
handleSetInputError
(
error
:
Error
,
input
:
FileEditorInput
,
options
:
EditorOptions
|
undefined
):
void
{
...
...
src/vs/workbench/contrib/files/test/browser/textFileEditor.test.ts
0 → 100644
浏览文件 @
cd762483
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import
*
as
assert
from
'
assert
'
;
import
{
toResource
}
from
'
vs/base/test/common/utils
'
;
import
{
IEditorService
}
from
'
vs/workbench/services/editor/common/editorService
'
;
import
{
workbenchInstantiationService
,
TestServiceAccessor
,
TestFilesConfigurationService
,
TestEnvironmentService
}
from
'
vs/workbench/test/browser/workbenchTestServices
'
;
import
{
IEditorGroupsService
}
from
'
vs/workbench/services/editor/common/editorGroupsService
'
;
import
{
dispose
,
IDisposable
}
from
'
vs/base/common/lifecycle
'
;
import
{
IEditorRegistry
,
EditorDescriptor
,
Extensions
as
EditorExtensions
}
from
'
vs/workbench/browser/editor
'
;
import
{
Registry
}
from
'
vs/platform/registry/common/platform
'
;
import
{
TextFileEditor
}
from
'
vs/workbench/contrib/files/browser/editors/textFileEditor
'
;
import
{
SyncDescriptor
}
from
'
vs/platform/instantiation/common/descriptors
'
;
import
{
EditorInput
}
from
'
vs/workbench/common/editor
'
;
import
{
FileEditorInput
}
from
'
vs/workbench/contrib/files/common/editors/fileEditorInput
'
;
import
{
TextFileEditorModelManager
}
from
'
vs/workbench/services/textfile/common/textFileEditorModelManager
'
;
import
{
EditorPart
}
from
'
vs/workbench/browser/parts/editor/editorPart
'
;
import
{
EditorService
}
from
'
vs/workbench/services/editor/browser/editorService
'
;
import
{
IInstantiationService
}
from
'
vs/platform/instantiation/common/instantiation
'
;
import
{
CodeEditorWidget
}
from
'
vs/editor/browser/widget/codeEditorWidget
'
;
import
{
Selection
}
from
'
vs/editor/common/core/selection
'
;
import
{
TestConfigurationService
}
from
'
vs/platform/configuration/test/common/testConfigurationService
'
;
import
{
IConfigurationService
}
from
'
vs/platform/configuration/common/configuration
'
;
import
{
IFilesConfigurationService
}
from
'
vs/workbench/services/filesConfiguration/common/filesConfigurationService
'
;
import
{
IContextKeyService
}
from
'
vs/platform/contextkey/common/contextkey
'
;
import
{
MockContextKeyService
}
from
'
vs/platform/keybinding/test/common/mockKeybindingService
'
;
suite
(
'
Files - TextFileEditor
'
,
()
=>
{
let
disposables
:
IDisposable
[]
=
[];
setup
(()
=>
{
disposables
.
push
(
Registry
.
as
<
IEditorRegistry
>
(
EditorExtensions
.
Editors
).
registerEditor
(
EditorDescriptor
.
create
(
TextFileEditor
,
TextFileEditor
.
ID
,
'
Text File Editor
'
),
[
new
SyncDescriptor
<
EditorInput
>
(
FileEditorInput
)]
));
});
teardown
(()
=>
{
dispose
(
disposables
);
disposables
=
[];
});
async
function
createPart
(
restoreViewState
:
boolean
):
Promise
<
[
EditorPart
,
TestServiceAccessor
,
IInstantiationService
,
IEditorService
]
>
{
const
instantiationService
=
workbenchInstantiationService
();
const
configurationService
=
new
TestConfigurationService
();
configurationService
.
setUserConfiguration
(
'
workbench
'
,
{
editor
:
{
restoreViewState
}
});
instantiationService
.
stub
(
IConfigurationService
,
configurationService
);
instantiationService
.
stub
(
IFilesConfigurationService
,
new
TestFilesConfigurationService
(
<
IContextKeyService
>
instantiationService
.
createInstance
(
MockContextKeyService
),
configurationService
,
TestEnvironmentService
));
const
part
=
instantiationService
.
createInstance
(
EditorPart
);
part
.
create
(
document
.
createElement
(
'
div
'
));
part
.
layout
(
400
,
300
);
instantiationService
.
stub
(
IEditorGroupsService
,
part
);
const
editorService
:
EditorService
=
instantiationService
.
createInstance
(
EditorService
);
instantiationService
.
stub
(
IEditorService
,
editorService
);
const
accessor
=
instantiationService
.
createInstance
(
TestServiceAccessor
);
await
part
.
whenRestored
;
return
[
part
,
accessor
,
instantiationService
,
editorService
];
}
test
(
'
text file editor preserves viewstate
'
,
async
function
()
{
return
viewStateTest
(
this
,
true
);
});
test
(
'
text file editor resets viewstate if configured as such
'
,
async
function
()
{
return
viewStateTest
(
this
,
false
);
});
async
function
viewStateTest
(
context
:
Mocha
.
ITestCallbackContext
,
restoreViewState
:
boolean
):
Promise
<
void
>
{
const
[
part
,
accessor
]
=
await
createPart
(
restoreViewState
);
let
editor
=
await
accessor
.
editorService
.
openEditor
(
accessor
.
editorService
.
createInput
({
resource
:
toResource
.
call
(
context
,
'
/path/index.txt
'
),
forceFile
:
true
}));
let
codeEditor
=
editor
?.
getControl
()
as
CodeEditorWidget
;
const
selection
=
new
Selection
(
1
,
3
,
1
,
4
);
codeEditor
.
setSelection
(
selection
);
editor
=
await
accessor
.
editorService
.
openEditor
(
accessor
.
editorService
.
createInput
({
resource
:
toResource
.
call
(
context
,
'
/path/index-other.txt
'
),
forceFile
:
true
}));
editor
=
await
accessor
.
editorService
.
openEditor
(
accessor
.
editorService
.
createInput
({
resource
:
toResource
.
call
(
context
,
'
/path/index.txt
'
),
forceFile
:
true
}));
codeEditor
=
editor
?.
getControl
()
as
CodeEditorWidget
;
if
(
restoreViewState
)
{
assert
.
ok
(
codeEditor
.
getSelection
()?.
equalsSelection
(
selection
));
}
else
{
assert
.
ok
(
!
codeEditor
.
getSelection
()?.
equalsSelection
(
selection
));
}
part
.
dispose
();
(
<
TextFileEditorModelManager
>
accessor
.
textFileService
.
files
).
dispose
();
}
});
src/vs/workbench/services/editor/test/browser/editorService.test.ts
浏览文件 @
cd762483
...
@@ -8,7 +8,7 @@ import { EditorActivation } from 'vs/platform/editor/common/editor';
...
@@ -8,7 +8,7 @@ import { EditorActivation } from 'vs/platform/editor/common/editor';
import
{
URI
}
from
'
vs/base/common/uri
'
;
import
{
URI
}
from
'
vs/base/common/uri
'
;
import
{
Event
}
from
'
vs/base/common/event
'
;
import
{
Event
}
from
'
vs/base/common/event
'
;
import
{
BaseEditor
}
from
'
vs/workbench/browser/parts/editor/baseEditor
'
;
import
{
BaseEditor
}
from
'
vs/workbench/browser/parts/editor/baseEditor
'
;
import
{
EditorInput
,
EditorsOrder
}
from
'
vs/workbench/common/editor
'
;
import
{
EditorInput
,
EditorsOrder
,
SideBySideEditorInput
}
from
'
vs/workbench/common/editor
'
;
import
{
workbenchInstantiationService
,
TestStorageService
,
TestServiceAccessor
,
registerTestEditor
,
TestFileEditorInput
}
from
'
vs/workbench/test/browser/workbenchTestServices
'
;
import
{
workbenchInstantiationService
,
TestStorageService
,
TestServiceAccessor
,
registerTestEditor
,
TestFileEditorInput
}
from
'
vs/workbench/test/browser/workbenchTestServices
'
;
import
{
ResourceEditorInput
}
from
'
vs/workbench/common/editor/resourceEditorInput
'
;
import
{
ResourceEditorInput
}
from
'
vs/workbench/common/editor/resourceEditorInput
'
;
import
{
TestThemeService
}
from
'
vs/platform/theme/test/common/testThemeService
'
;
import
{
TestThemeService
}
from
'
vs/platform/theme/test/common/testThemeService
'
;
...
@@ -26,6 +26,7 @@ import { Disposable, IDisposable, dispose } from 'vs/base/common/lifecycle';
...
@@ -26,6 +26,7 @@ import { Disposable, IDisposable, dispose } from 'vs/base/common/lifecycle';
import
{
ModesRegistry
}
from
'
vs/editor/common/modes/modesRegistry
'
;
import
{
ModesRegistry
}
from
'
vs/editor/common/modes/modesRegistry
'
;
import
{
UntitledTextEditorModel
}
from
'
vs/workbench/services/untitled/common/untitledTextEditorModel
'
;
import
{
UntitledTextEditorModel
}
from
'
vs/workbench/services/untitled/common/untitledTextEditorModel
'
;
import
{
NullFileSystemProvider
}
from
'
vs/platform/files/test/common/nullFileSystemProvider
'
;
import
{
NullFileSystemProvider
}
from
'
vs/platform/files/test/common/nullFileSystemProvider
'
;
import
{
DiffEditorInput
}
from
'
vs/workbench/common/editor/diffEditorInput
'
;
const
TEST_EDITOR_ID
=
'
MyTestEditorForEditorService
'
;
const
TEST_EDITOR_ID
=
'
MyTestEditorForEditorService
'
;
const
TEST_EDITOR_INPUT_ID
=
'
testEditorInputForEditorService
'
;
const
TEST_EDITOR_INPUT_ID
=
'
testEditorInputForEditorService
'
;
...
@@ -233,6 +234,10 @@ suite('EditorService', () => {
...
@@ -233,6 +234,10 @@ suite('EditorService', () => {
let
contentInput
=
<
FileEditorInput
>
input
;
let
contentInput
=
<
FileEditorInput
>
input
;
assert
.
strictEqual
(
contentInput
.
resource
.
fsPath
,
toResource
.
call
(
this
,
'
/index.html
'
).
fsPath
);
assert
.
strictEqual
(
contentInput
.
resource
.
fsPath
,
toResource
.
call
(
this
,
'
/index.html
'
).
fsPath
);
// Typed Input
assert
.
equal
(
service
.
createInput
(
input
),
input
);
assert
.
equal
(
service
.
createInput
({
editor
:
input
}),
input
);
// Untyped Input (file, encoding)
// Untyped Input (file, encoding)
input
=
service
.
createInput
({
resource
:
toResource
.
call
(
this
,
'
/index.html
'
),
encoding
:
'
utf16le
'
,
options
:
{
selection
:
{
startLineNumber
:
1
,
startColumn
:
1
}
}
});
input
=
service
.
createInput
({
resource
:
toResource
.
call
(
this
,
'
/index.html
'
),
encoding
:
'
utf16le
'
,
options
:
{
selection
:
{
startLineNumber
:
1
,
startColumn
:
1
}
}
});
assert
(
input
instanceof
FileEditorInput
);
assert
(
input
instanceof
FileEditorInput
);
...
@@ -289,6 +294,20 @@ suite('EditorService', () => {
...
@@ -289,6 +294,20 @@ suite('EditorService', () => {
// Untyped Input (resource)
// Untyped Input (resource)
input
=
service
.
createInput
({
resource
:
URI
.
parse
(
'
custom:resource
'
)
});
input
=
service
.
createInput
({
resource
:
URI
.
parse
(
'
custom:resource
'
)
});
assert
(
input
instanceof
ResourceEditorInput
);
assert
(
input
instanceof
ResourceEditorInput
);
// Untyped Input (side by side)
input
=
service
.
createInput
({
masterResource
:
toResource
.
call
(
this
,
'
/master.html
'
),
detailResource
:
toResource
.
call
(
this
,
'
/detail.html
'
)
});
assert
(
input
instanceof
SideBySideEditorInput
);
// Untyped Input (diff)
input
=
service
.
createInput
({
leftResource
:
toResource
.
call
(
this
,
'
/master.html
'
),
rightResource
:
toResource
.
call
(
this
,
'
/detail.html
'
)
});
assert
(
input
instanceof
DiffEditorInput
);
});
});
test
(
'
delegate
'
,
function
(
done
)
{
test
(
'
delegate
'
,
function
(
done
)
{
...
...
src/vs/workbench/test/browser/workbenchTestServices.ts
浏览文件 @
cd762483
...
@@ -10,7 +10,7 @@ import * as resources from 'vs/base/common/resources';
...
@@ -10,7 +10,7 @@ import * as resources from 'vs/base/common/resources';
import
{
URI
}
from
'
vs/base/common/uri
'
;
import
{
URI
}
from
'
vs/base/common/uri
'
;
import
{
ITelemetryService
}
from
'
vs/platform/telemetry/common/telemetry
'
;
import
{
ITelemetryService
}
from
'
vs/platform/telemetry/common/telemetry
'
;
import
{
NullTelemetryService
}
from
'
vs/platform/telemetry/common/telemetryUtils
'
;
import
{
NullTelemetryService
}
from
'
vs/platform/telemetry/common/telemetryUtils
'
;
import
{
IEditorInputWithOptions
,
CloseDirection
,
IEditorIdentifier
,
IUntitledTextResourceInput
,
IResourceDiffInput
,
IResourceSideBySideInput
,
IEditorInput
,
IEditor
,
IEditorCloseEvent
,
IEditorPartOptions
,
IRevertOptions
,
GroupIdentifier
,
EditorInput
,
EditorOptions
,
EditorsOrder
,
IFileEditorInput
,
IEditorInputFactoryRegistry
,
IEditorInputFactory
,
Extensions
as
EditorExtensions
,
ISaveOptions
,
IMoveResult
}
from
'
vs/workbench/common/editor
'
;
import
{
IEditorInputWithOptions
,
CloseDirection
,
IEditorIdentifier
,
IUntitledTextResourceInput
,
IResourceDiffInput
,
IResourceSideBySideInput
,
IEditorInput
,
IEditor
,
IEditorCloseEvent
,
IEditorPartOptions
,
IRevertOptions
,
GroupIdentifier
,
EditorInput
,
EditorOptions
,
EditorsOrder
,
IFileEditorInput
,
IEditorInputFactoryRegistry
,
IEditorInputFactory
,
Extensions
as
EditorExtensions
,
ISaveOptions
,
IMoveResult
,
ITextEditor
,
ITextDiffEditor
,
ITextSideBySideEditor
}
from
'
vs/workbench/common/editor
'
;
import
{
IEditorOpeningEvent
,
EditorServiceImpl
,
IEditorGroupView
,
IEditorGroupsAccessor
}
from
'
vs/workbench/browser/parts/editor/editor
'
;
import
{
IEditorOpeningEvent
,
EditorServiceImpl
,
IEditorGroupView
,
IEditorGroupsAccessor
}
from
'
vs/workbench/browser/parts/editor/editor
'
;
import
{
Event
,
Emitter
}
from
'
vs/base/common/event
'
;
import
{
Event
,
Emitter
}
from
'
vs/base/common/event
'
;
import
{
IBackupFileService
,
IResolvedBackup
}
from
'
vs/workbench/services/backup/common/backup
'
;
import
{
IBackupFileService
,
IResolvedBackup
}
from
'
vs/workbench/services/backup/common/backup
'
;
...
@@ -18,7 +18,7 @@ import { IConfigurationService, ConfigurationTarget } from 'vs/platform/configur
...
@@ -18,7 +18,7 @@ import { IConfigurationService, ConfigurationTarget } from 'vs/platform/configur
import
{
IWorkbenchLayoutService
,
Parts
,
Position
as
PartPosition
}
from
'
vs/workbench/services/layout/browser/layoutService
'
;
import
{
IWorkbenchLayoutService
,
Parts
,
Position
as
PartPosition
}
from
'
vs/workbench/services/layout/browser/layoutService
'
;
import
{
TextModelResolverService
}
from
'
vs/workbench/services/textmodelResolver/common/textModelResolverService
'
;
import
{
TextModelResolverService
}
from
'
vs/workbench/services/textmodelResolver/common/textModelResolverService
'
;
import
{
ITextModelService
}
from
'
vs/editor/common/services/resolverService
'
;
import
{
ITextModelService
}
from
'
vs/editor/common/services/resolverService
'
;
import
{
IEditorOptions
,
IResourceInput
,
IEditorModel
}
from
'
vs/platform/editor/common/editor
'
;
import
{
IEditorOptions
,
IResourceInput
,
IEditorModel
,
ITextEditorOptions
}
from
'
vs/platform/editor/common/editor
'
;
import
{
IUntitledTextEditorService
,
UntitledTextEditorService
}
from
'
vs/workbench/services/untitled/common/untitledTextEditorService
'
;
import
{
IUntitledTextEditorService
,
UntitledTextEditorService
}
from
'
vs/workbench/services/untitled/common/untitledTextEditorService
'
;
import
{
IWorkspaceContextService
}
from
'
vs/platform/workspace/common/workspace
'
;
import
{
IWorkspaceContextService
}
from
'
vs/platform/workspace/common/workspace
'
;
import
{
ILifecycleService
,
BeforeShutdownEvent
,
ShutdownReason
,
StartupKind
,
LifecyclePhase
,
WillShutdownEvent
}
from
'
vs/platform/lifecycle/common/lifecycle
'
;
import
{
ILifecycleService
,
BeforeShutdownEvent
,
ShutdownReason
,
StartupKind
,
LifecyclePhase
,
WillShutdownEvent
}
from
'
vs/platform/lifecycle/common/lifecycle
'
;
...
@@ -51,8 +51,8 @@ import { IExtensionService, NullExtensionService } from 'vs/workbench/services/e
...
@@ -51,8 +51,8 @@ import { IExtensionService, NullExtensionService } from 'vs/workbench/services/e
import
{
IKeybindingService
}
from
'
vs/platform/keybinding/common/keybinding
'
;
import
{
IKeybindingService
}
from
'
vs/platform/keybinding/common/keybinding
'
;
import
{
IDecorationsService
,
IResourceDecorationChangeEvent
,
IDecoration
,
IDecorationData
,
IDecorationsProvider
}
from
'
vs/workbench/services/decorations/browser/decorations
'
;
import
{
IDecorationsService
,
IResourceDecorationChangeEvent
,
IDecoration
,
IDecorationData
,
IDecorationsProvider
}
from
'
vs/workbench/services/decorations/browser/decorations
'
;
import
{
IDisposable
,
toDisposable
,
Disposable
,
DisposableStore
}
from
'
vs/base/common/lifecycle
'
;
import
{
IDisposable
,
toDisposable
,
Disposable
,
DisposableStore
}
from
'
vs/base/common/lifecycle
'
;
import
{
IEditorGroupsService
,
IEditorGroup
,
GroupsOrder
,
GroupsArrangement
,
GroupDirection
,
IAddGroupOptions
,
IMergeGroupOptions
,
IMoveEditorOptions
,
ICopyEditorOptions
,
IEditorReplacement
,
IGroupChangeEvent
,
IFindGroupScope
,
EditorGroupLayout
,
ICloseEditorOptions
}
from
'
vs/workbench/services/editor/common/editorGroupsService
'
;
import
{
IEditorGroupsService
,
IEditorGroup
,
GroupsOrder
,
GroupsArrangement
,
GroupDirection
,
IAddGroupOptions
,
IMergeGroupOptions
,
IMoveEditorOptions
,
ICopyEditorOptions
,
IEditorReplacement
,
IGroupChangeEvent
,
IFindGroupScope
,
EditorGroupLayout
,
ICloseEditorOptions
,
GroupOrientation
}
from
'
vs/workbench/services/editor/common/editorGroupsService
'
;
import
{
IEditorService
,
IOpenEditorOverrideHandler
,
IVisibleEditor
,
ISaveEditorsOptions
,
IRevertAllEditorsOptions
,
IResourceEditor
}
from
'
vs/workbench/services/editor/common/editorService
'
;
import
{
IEditorService
,
IOpenEditorOverrideHandler
,
IVisibleEditor
,
ISaveEditorsOptions
,
IRevertAllEditorsOptions
,
IResourceEditor
,
SIDE_GROUP_TYPE
,
ACTIVE_GROUP_TYPE
}
from
'
vs/workbench/services/editor/common/editorService
'
;
import
{
ICodeEditorService
}
from
'
vs/editor/browser/services/codeEditorService
'
;
import
{
ICodeEditorService
}
from
'
vs/editor/browser/services/codeEditorService
'
;
import
{
IEditorRegistry
,
EditorDescriptor
,
Extensions
}
from
'
vs/workbench/browser/editor
'
;
import
{
IEditorRegistry
,
EditorDescriptor
,
Extensions
}
from
'
vs/workbench/browser/editor
'
;
import
{
EditorGroup
}
from
'
vs/workbench/common/editor/editorGroup
'
;
import
{
EditorGroup
}
from
'
vs/workbench/common/editor/editorGroup
'
;
...
@@ -104,6 +104,8 @@ export import TestTextResourcePropertiesService = CommonWorkbenchTestServices.Te
...
@@ -104,6 +104,8 @@ export import TestTextResourcePropertiesService = CommonWorkbenchTestServices.Te
export
import
TestContextService
=
CommonWorkbenchTestServices
.
TestContextService
;
export
import
TestContextService
=
CommonWorkbenchTestServices
.
TestContextService
;
export
import
TestStorageService
=
CommonWorkbenchTestServices
.
TestStorageService
;
export
import
TestStorageService
=
CommonWorkbenchTestServices
.
TestStorageService
;
export
import
TestWorkingCopyService
=
CommonWorkbenchTestServices
.
TestWorkingCopyService
;
export
import
TestWorkingCopyService
=
CommonWorkbenchTestServices
.
TestWorkingCopyService
;
import
{
ICodeEditor
}
from
'
vs/editor/browser/editorBrowser
'
;
import
{
IDiffEditor
}
from
'
vs/editor/common/editorCommon
'
;
export
function
createFileInput
(
instantiationService
:
IInstantiationService
,
resource
:
URI
):
FileEditorInput
{
export
function
createFileInput
(
instantiationService
:
IInstantiationService
,
resource
:
URI
):
FileEditorInput
{
return
instantiationService
.
createInstance
(
FileEditorInput
,
resource
,
undefined
,
undefined
);
return
instantiationService
.
createInstance
(
FileEditorInput
,
resource
,
undefined
,
undefined
);
...
@@ -469,7 +471,7 @@ export class TestEditorGroupsService implements IEditorGroupsService {
...
@@ -469,7 +471,7 @@ export class TestEditorGroupsService implements IEditorGroupsService {
onDidLayout
:
Event
<
IDimension
>
=
Event
.
None
;
onDidLayout
:
Event
<
IDimension
>
=
Event
.
None
;
onDidEditorPartOptionsChange
=
Event
.
None
;
onDidEditorPartOptionsChange
=
Event
.
None
;
orientation
:
any
;
orientation
=
GroupOrientation
.
HORIZONTAL
;
whenRestored
:
Promise
<
void
>
=
Promise
.
resolve
(
undefined
);
whenRestored
:
Promise
<
void
>
=
Promise
.
resolve
(
undefined
);
willRestoreEditors
=
false
;
willRestoreEditors
=
false
;
...
@@ -488,7 +490,7 @@ export class TestEditorGroupsService implements IEditorGroupsService {
...
@@ -488,7 +490,7 @@ export class TestEditorGroupsService implements IEditorGroupsService {
setSize
(
_group
:
number
|
IEditorGroup
,
_size
:
{
width
:
number
,
height
:
number
}):
void
{
}
setSize
(
_group
:
number
|
IEditorGroup
,
_size
:
{
width
:
number
,
height
:
number
}):
void
{
}
arrangeGroups
(
_arrangement
:
GroupsArrangement
):
void
{
}
arrangeGroups
(
_arrangement
:
GroupsArrangement
):
void
{
}
applyLayout
(
_layout
:
EditorGroupLayout
):
void
{
}
applyLayout
(
_layout
:
EditorGroupLayout
):
void
{
}
setGroupOrientation
(
_orientation
:
any
):
void
{
}
setGroupOrientation
(
_orientation
:
GroupOrientation
):
void
{
}
addGroup
(
_location
:
number
|
IEditorGroup
,
_direction
:
GroupDirection
,
_options
?:
IAddGroupOptions
):
IEditorGroup
{
throw
new
Error
(
'
not implemented
'
);
}
addGroup
(
_location
:
number
|
IEditorGroup
,
_direction
:
GroupDirection
,
_options
?:
IAddGroupOptions
):
IEditorGroup
{
throw
new
Error
(
'
not implemented
'
);
}
removeGroup
(
_group
:
number
|
IEditorGroup
):
void
{
}
removeGroup
(
_group
:
number
|
IEditorGroup
):
void
{
}
moveGroup
(
_group
:
number
|
IEditorGroup
,
_location
:
number
|
IEditorGroup
,
_direction
:
GroupDirection
):
IEditorGroup
{
throw
new
Error
(
'
not implemented
'
);
}
moveGroup
(
_group
:
number
|
IEditorGroup
,
_location
:
number
|
IEditorGroup
,
_direction
:
GroupDirection
):
IEditorGroup
{
throw
new
Error
(
'
not implemented
'
);
}
...
@@ -591,10 +593,10 @@ export class TestEditorService implements EditorServiceImpl {
...
@@ -591,10 +593,10 @@ export class TestEditorService implements EditorServiceImpl {
onDidOpenEditorFail
:
Event
<
IEditorIdentifier
>
=
Event
.
None
;
onDidOpenEditorFail
:
Event
<
IEditorIdentifier
>
=
Event
.
None
;
onDidMostRecentlyActiveEditorsChange
:
Event
<
void
>
=
Event
.
None
;
onDidMostRecentlyActiveEditorsChange
:
Event
<
void
>
=
Event
.
None
;
activeControl
!
:
IVisibleEditor
;
activeControl
:
IVisibleEditor
|
undefined
;
activeTextEditorWidget
:
any
;
activeTextEditorWidget
:
ICodeEditor
|
IDiffEditor
|
undefined
;
activeTextEditorMode
:
any
;
activeTextEditorMode
:
string
|
undefined
;
activeEditor
!
:
IEditorInput
;
activeEditor
:
IEditorInput
|
undefined
;
editors
:
ReadonlyArray
<
IEditorInput
>
=
[];
editors
:
ReadonlyArray
<
IEditorInput
>
=
[];
mostRecentlyActiveEditors
:
ReadonlyArray
<
IEditorIdentifier
>
=
[];
mostRecentlyActiveEditors
:
ReadonlyArray
<
IEditorIdentifier
>
=
[];
visibleControls
:
ReadonlyArray
<
IVisibleEditor
>
=
[];
visibleControls
:
ReadonlyArray
<
IVisibleEditor
>
=
[];
...
@@ -606,7 +608,13 @@ export class TestEditorService implements EditorServiceImpl {
...
@@ -606,7 +608,13 @@ export class TestEditorService implements EditorServiceImpl {
getEditors
()
{
return
[];
}
getEditors
()
{
return
[];
}
overrideOpenEditor
(
_handler
:
IOpenEditorOverrideHandler
):
IDisposable
{
return
toDisposable
(()
=>
undefined
);
}
overrideOpenEditor
(
_handler
:
IOpenEditorOverrideHandler
):
IDisposable
{
return
toDisposable
(()
=>
undefined
);
}
openEditor
(
_editor
:
any
,
_options
?:
any
,
_group
?:
any
):
Promise
<
any
>
{
throw
new
Error
(
'
not implemented
'
);
}
openEditor
(
editor
:
IEditorInput
,
options
?:
IEditorOptions
|
ITextEditorOptions
,
group
?:
IEditorGroup
|
GroupIdentifier
|
SIDE_GROUP_TYPE
|
ACTIVE_GROUP_TYPE
):
Promise
<
IEditor
|
undefined
>
;
openEditor
(
editor
:
IResourceInput
|
IUntitledTextResourceInput
,
group
?:
IEditorGroup
|
GroupIdentifier
|
SIDE_GROUP_TYPE
|
ACTIVE_GROUP_TYPE
):
Promise
<
ITextEditor
|
undefined
>
;
openEditor
(
editor
:
IResourceDiffInput
,
group
?:
IEditorGroup
|
GroupIdentifier
|
SIDE_GROUP_TYPE
|
ACTIVE_GROUP_TYPE
):
Promise
<
ITextDiffEditor
|
undefined
>
;
openEditor
(
editor
:
IResourceSideBySideInput
,
group
?:
IEditorGroup
|
GroupIdentifier
|
SIDE_GROUP_TYPE
|
ACTIVE_GROUP_TYPE
):
Promise
<
ITextSideBySideEditor
|
undefined
>
;
async
openEditor
(
editor
:
IEditorInput
|
IResourceEditor
,
optionsOrGroup
?:
IEditorOptions
|
ITextEditorOptions
|
IEditorGroup
|
GroupIdentifier
|
SIDE_GROUP_TYPE
|
ACTIVE_GROUP_TYPE
,
group
?:
IEditorGroup
|
GroupIdentifier
|
SIDE_GROUP_TYPE
|
ACTIVE_GROUP_TYPE
):
Promise
<
IEditor
|
undefined
>
{
throw
new
Error
(
'
not implemented
'
);
}
doResolveEditorOpenRequest
(
editor
:
IEditorInput
|
IResourceEditor
):
[
IEditorGroup
,
EditorInput
,
EditorOptions
|
undefined
]
|
undefined
{
doResolveEditorOpenRequest
(
editor
:
IEditorInput
|
IResourceEditor
):
[
IEditorGroup
,
EditorInput
,
EditorOptions
|
undefined
]
|
undefined
{
if
(
!
this
.
editorGroupService
)
{
if
(
!
this
.
editorGroupService
)
{
return
undefined
;
return
undefined
;
...
@@ -615,8 +623,7 @@ export class TestEditorService implements EditorServiceImpl {
...
@@ -615,8 +623,7 @@ export class TestEditorService implements EditorServiceImpl {
return
[
this
.
editorGroupService
.
activeGroup
,
editor
as
EditorInput
,
undefined
];
return
[
this
.
editorGroupService
.
activeGroup
,
editor
as
EditorInput
,
undefined
];
}
}
openEditors
(
_editors
:
any
,
_group
?:
any
):
Promise
<
IEditor
[]
>
{
throw
new
Error
(
'
not implemented
'
);
}
openEditors
(
_editors
:
any
,
_group
?:
any
):
Promise
<
IEditor
[]
>
{
throw
new
Error
(
'
not implemented
'
);
}
isOpen
(
_editor
:
IEditorInput
|
IResourceInput
|
IUntitledTextResourceInput
):
boolean
{
return
false
;
}
isOpen
(
_editor
:
IEditorInput
):
boolean
{
return
false
;
}
getOpened
(
_editor
:
IEditorInput
|
IResourceInput
|
IUntitledTextResourceInput
):
IEditorInput
{
throw
new
Error
(
'
not implemented
'
);
}
replaceEditors
(
_editors
:
any
,
_group
:
any
)
{
return
Promise
.
resolve
(
undefined
);
}
replaceEditors
(
_editors
:
any
,
_group
:
any
)
{
return
Promise
.
resolve
(
undefined
);
}
invokeWithinEditorContext
<
T
>
(
fn
:
(
accessor
:
ServicesAccessor
)
=>
T
):
T
{
throw
new
Error
(
'
not implemented
'
);
}
invokeWithinEditorContext
<
T
>
(
fn
:
(
accessor
:
ServicesAccessor
)
=>
T
):
T
{
throw
new
Error
(
'
not implemented
'
);
}
createInput
(
_input
:
IResourceInput
|
IUntitledTextResourceInput
|
IResourceDiffInput
|
IResourceSideBySideInput
):
EditorInput
{
throw
new
Error
(
'
not implemented
'
);
}
createInput
(
_input
:
IResourceInput
|
IUntitledTextResourceInput
|
IResourceDiffInput
|
IResourceSideBySideInput
):
EditorInput
{
throw
new
Error
(
'
not implemented
'
);
}
...
@@ -946,7 +953,7 @@ export function registerTestEditor(id: string, inputs: SyncDescriptor<EditorInpu
...
@@ -946,7 +953,7 @@ export function registerTestEditor(id: string, inputs: SyncDescriptor<EditorInpu
getId
():
string
{
return
id
;
}
getId
():
string
{
return
id
;
}
layout
():
void
{
}
layout
():
void
{
}
createEditor
():
any
{
}
createEditor
():
void
{
}
}
}
const
disposables
=
new
DisposableStore
();
const
disposables
=
new
DisposableStore
();
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录