Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
187c592a
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,发现更多精彩内容 >>
提交
187c592a
编写于
1月 23, 2020
作者:
M
Martin Aeschlimann
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
TestWindowConfiguration
上级
9fce8285
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
26 addition
and
22 deletion
+26
-22
src/vs/workbench/services/backup/test/electron-browser/backupFileService.test.ts
...es/backup/test/electron-browser/backupFileService.test.ts
+2
-3
src/vs/workbench/services/configuration/test/electron-browser/configurationEditingService.test.ts
...test/electron-browser/configurationEditingService.test.ts
+2
-4
src/vs/workbench/services/configuration/test/electron-browser/configurationService.test.ts
...ration/test/electron-browser/configurationService.test.ts
+3
-5
src/vs/workbench/services/configurationResolver/test/electron-browser/configurationResolverService.test.ts
...est/electron-browser/configurationResolverService.test.ts
+3
-4
src/vs/workbench/services/keybinding/test/electron-browser/keybindingEditing.test.ts
...eybinding/test/electron-browser/keybindingEditing.test.ts
+2
-4
src/vs/workbench/test/workbenchTestServices.ts
src/vs/workbench/test/workbenchTestServices.ts
+14
-2
未找到文件。
src/vs/workbench/services/backup/test/electron-browser/backupFileService.test.ts
浏览文件 @
187c592a
...
...
@@ -16,18 +16,17 @@ import { TextModel, createTextBufferFactory } from 'vs/editor/common/model/textM
import
{
getRandomTestPath
}
from
'
vs/base/test/node/testUtils
'
;
import
{
DefaultEndOfLine
,
ITextSnapshot
}
from
'
vs/editor/common/model
'
;
import
{
Schemas
}
from
'
vs/base/common/network
'
;
import
{
IWindowConfiguration
}
from
'
vs/platform/windows/common/windows
'
;
import
{
FileService
}
from
'
vs/platform/files/common/fileService
'
;
import
{
NullLogService
}
from
'
vs/platform/log/common/log
'
;
import
{
DiskFileSystemProvider
}
from
'
vs/platform/files/node/diskFileSystemProvider
'
;
import
{
NativeWorkbenchEnvironmentService
}
from
'
vs/workbench/services/environment/electron-browser/environmentService
'
;
import
{
parseArgs
,
OPTIONS
}
from
'
vs/platform/environment/node/argv
'
;
import
{
snapshotToString
}
from
'
vs/workbench/services/textfile/common/textfiles
'
;
import
{
IFileService
}
from
'
vs/platform/files/common/files
'
;
import
{
hashPath
,
BackupFileService
}
from
'
vs/workbench/services/backup/node/backupFileService
'
;
import
{
BACKUPS
}
from
'
vs/platform/environment/common/environment
'
;
import
{
FileUserDataProvider
}
from
'
vs/workbench/services/userData/common/fileUserDataProvider
'
;
import
{
VSBuffer
}
from
'
vs/base/common/buffer
'
;
import
{
TestWindowConfiguration
}
from
'
vs/workbench/test/workbenchTestServices
'
;
const
userdataDir
=
getRandomTestPath
(
os
.
tmpdir
(),
'
vsctests
'
,
'
backupfileservice
'
);
const
appSettingsHome
=
path
.
join
(
userdataDir
,
'
User
'
);
...
...
@@ -49,7 +48,7 @@ const untitledBackupPath = path.join(workspaceBackupPath, 'untitled', hashPath(u
class
TestBackupEnvironmentService
extends
NativeWorkbenchEnvironmentService
{
constructor
(
backupPath
:
string
)
{
super
({
...
parseArgs
(
process
.
argv
,
OPTIONS
),
...{
backupPath
,
'
user-data-dir
'
:
userdataDir
}
}
as
IWindowConfiguration
,
process
.
execPath
,
0
);
super
({
...
TestWindowConfiguration
,
backupPath
,
'
user-data-dir
'
:
userdataDir
},
TestWindowConfiguration
.
execPath
,
TestWindowConfiguration
.
windowId
);
}
}
...
...
src/vs/workbench/services/configuration/test/electron-browser/configurationEditingService.test.ts
浏览文件 @
187c592a
...
...
@@ -11,9 +11,8 @@ import * as fs from 'fs';
import
*
as
json
from
'
vs/base/common/json
'
;
import
{
Registry
}
from
'
vs/platform/registry/common/platform
'
;
import
{
IEnvironmentService
}
from
'
vs/platform/environment/common/environment
'
;
import
{
parseArgs
,
OPTIONS
}
from
'
vs/platform/environment/node/argv
'
;
import
{
IWorkspaceContextService
}
from
'
vs/platform/workspace/common/workspace
'
;
import
{
TestTextFileService
,
workbenchInstantiationService
}
from
'
vs/workbench/test/workbenchTestServices
'
;
import
{
TestTextFileService
,
workbenchInstantiationService
,
TestWindowConfiguration
}
from
'
vs/workbench/test/workbenchTestServices
'
;
import
*
as
uuid
from
'
vs/base/common/uuid
'
;
import
{
IConfigurationRegistry
,
Extensions
as
ConfigurationExtensions
}
from
'
vs/platform/configuration/common/configurationRegistry
'
;
import
{
WorkspaceService
}
from
'
vs/workbench/services/configuration/browser/configurationService
'
;
...
...
@@ -40,13 +39,12 @@ import { IFileService } from 'vs/platform/files/common/files';
import
{
ConfigurationCache
}
from
'
vs/workbench/services/configuration/node/configurationCache
'
;
import
{
KeybindingsEditingService
,
IKeybindingEditingService
}
from
'
vs/workbench/services/keybinding/common/keybindingEditing
'
;
import
{
NativeWorkbenchEnvironmentService
}
from
'
vs/workbench/services/environment/electron-browser/environmentService
'
;
import
{
IWindowConfiguration
}
from
'
vs/platform/windows/common/windows
'
;
import
{
FileUserDataProvider
}
from
'
vs/workbench/services/userData/common/fileUserDataProvider
'
;
class
TestEnvironmentService
extends
NativeWorkbenchEnvironmentService
{
constructor
(
private
_appSettingsHome
:
URI
)
{
super
(
parseArgs
(
process
.
argv
,
OPTIONS
)
as
IWindowConfiguration
,
process
.
execPath
,
0
);
super
(
TestWindowConfiguration
,
TestWindowConfiguration
.
execPath
,
TestWindowConfiguration
.
windowId
);
}
get
appSettingsHome
()
{
return
this
.
_appSettingsHome
;
}
...
...
src/vs/workbench/services/configuration/test/electron-browser/configurationService.test.ts
浏览文件 @
187c592a
...
...
@@ -11,7 +11,6 @@ import * as os from 'os';
import
{
URI
}
from
'
vs/base/common/uri
'
;
import
{
Registry
}
from
'
vs/platform/registry/common/platform
'
;
import
{
IEnvironmentService
}
from
'
vs/platform/environment/common/environment
'
;
import
{
parseArgs
,
OPTIONS
}
from
'
vs/platform/environment/node/argv
'
;
import
*
as
pfs
from
'
vs/base/node/pfs
'
;
import
*
as
uuid
from
'
vs/base/common/uuid
'
;
import
{
IConfigurationRegistry
,
Extensions
as
ConfigurationExtensions
,
ConfigurationScope
}
from
'
vs/platform/configuration/common/configurationRegistry
'
;
...
...
@@ -21,7 +20,7 @@ import { ConfigurationEditingErrorCode } from 'vs/workbench/services/configurati
import
{
IFileService
}
from
'
vs/platform/files/common/files
'
;
import
{
IWorkspaceContextService
,
WorkbenchState
,
IWorkspaceFoldersChangeEvent
}
from
'
vs/platform/workspace/common/workspace
'
;
import
{
ConfigurationTarget
,
IConfigurationService
,
IConfigurationChangeEvent
}
from
'
vs/platform/configuration/common/configuration
'
;
import
{
workbenchInstantiationService
,
TestTextFileService
,
RemoteFileSystemProvider
}
from
'
vs/workbench/test/workbenchTestServices
'
;
import
{
workbenchInstantiationService
,
TestTextFileService
,
RemoteFileSystemProvider
,
TestWindowConfiguration
}
from
'
vs/workbench/test/workbenchTestServices
'
;
import
{
TestInstantiationService
}
from
'
vs/platform/instantiation/test/common/instantiationServiceMock
'
;
import
{
ITextFileService
}
from
'
vs/workbench/services/textfile/common/textfiles
'
;
import
{
ITextModelService
}
from
'
vs/editor/common/services/resolverService
'
;
...
...
@@ -32,7 +31,6 @@ import { createHash } from 'crypto';
import
{
Schemas
}
from
'
vs/base/common/network
'
;
import
{
originalFSPath
}
from
'
vs/base/common/resources
'
;
import
{
isLinux
}
from
'
vs/base/common/platform
'
;
import
{
IWindowConfiguration
}
from
'
vs/platform/windows/common/windows
'
;
import
{
RemoteAgentService
}
from
'
vs/workbench/services/remote/electron-browser/remoteAgentServiceImpl
'
;
import
{
RemoteAuthorityResolverService
}
from
'
vs/platform/remote/electron-browser/remoteAuthorityResolverService
'
;
import
{
IRemoteAgentService
}
from
'
vs/workbench/services/remote/common/remoteAgentService
'
;
...
...
@@ -52,7 +50,7 @@ import { timeout } from 'vs/base/common/async';
class
TestEnvironmentService
extends
NativeWorkbenchEnvironmentService
{
constructor
(
private
_appSettingsHome
:
URI
)
{
super
(
parseArgs
(
process
.
argv
,
OPTIONS
)
as
IWindowConfiguration
,
process
.
execPath
,
0
);
super
(
TestWindowConfiguration
,
TestWindowConfiguration
.
execPath
,
TestWindowConfiguration
.
windowId
);
}
get
appSettingsHome
()
{
return
this
.
_appSettingsHome
;
}
...
...
@@ -110,7 +108,7 @@ suite('WorkspaceContextService - Folder', () => {
const
diskFileSystemProvider
=
new
DiskFileSystemProvider
(
new
NullLogService
());
fileService
.
registerProvider
(
Schemas
.
file
,
diskFileSystemProvider
);
fileService
.
registerProvider
(
Schemas
.
userData
,
new
FileUserDataProvider
(
environmentService
.
appSettingsHome
,
environmentService
.
backupHome
,
new
DiskFileSystemProvider
(
new
NullLogService
()),
environmentService
));
workspaceContextService
=
new
WorkspaceService
({
configurationCache
:
new
ConfigurationCache
(
environmentService
)
},
environmentService
,
fileService
,
new
RemoteAgentService
(
<
IWindowConfiguration
>
{}
,
environmentService
,
new
RemoteAuthorityResolverService
(),
new
SignService
(
undefined
),
new
NullLogService
()));
workspaceContextService
=
new
WorkspaceService
({
configurationCache
:
new
ConfigurationCache
(
environmentService
)
},
environmentService
,
fileService
,
new
RemoteAgentService
(
TestWindowConfiguration
,
environmentService
,
new
RemoteAuthorityResolverService
(),
new
SignService
(
undefined
),
new
NullLogService
()));
return
(
<
WorkspaceService
>
workspaceContextService
).
initialize
(
convertToWorkspacePayload
(
URI
.
file
(
folderDir
)));
});
});
...
...
src/vs/workbench/services/configurationResolver/test/electron-browser/configurationResolverService.test.ts
浏览文件 @
187c592a
...
...
@@ -11,7 +11,7 @@ import { ICommandService } from 'vs/platform/commands/common/commands';
import
{
IConfigurationResolverService
}
from
'
vs/workbench/services/configurationResolver/common/configurationResolver
'
;
import
{
ConfigurationResolverService
}
from
'
vs/workbench/services/configurationResolver/browser/configurationResolverService
'
;
import
{
IWorkspaceFolder
}
from
'
vs/platform/workspace/common/workspace
'
;
import
{
TestEditorService
,
TestContextService
}
from
'
vs/workbench/test/workbenchTestServices
'
;
import
{
TestEditorService
,
TestContextService
,
TestWindowConfiguration
}
from
'
vs/workbench/test/workbenchTestServices
'
;
import
{
TestConfigurationService
}
from
'
vs/platform/configuration/test/common/testConfigurationService
'
;
import
{
Disposable
}
from
'
vs/base/common/lifecycle
'
;
import
{
IQuickInputService
,
IQuickPickItem
,
QuickPickInput
,
IPickOptions
,
Omit
,
IInputOptions
,
IQuickInputButton
,
IQuickPick
,
IInputBox
,
IQuickNavigateConfiguration
}
from
'
vs/platform/quickinput/common/quickInput
'
;
...
...
@@ -20,7 +20,6 @@ import * as Types from 'vs/base/common/types';
import
{
EditorType
}
from
'
vs/editor/common/editorCommon
'
;
import
{
Selection
}
from
'
vs/editor/common/core/selection
'
;
import
{
NativeWorkbenchEnvironmentService
}
from
'
vs/workbench/services/environment/electron-browser/environmentService
'
;
import
{
IWindowConfiguration
}
from
'
vs/platform/windows/common/windows
'
;
import
{
IWorkbenchEnvironmentService
}
from
'
vs/workbench/services/environment/common/environmentService
'
;
const
mockLineNumber
=
10
;
...
...
@@ -618,7 +617,7 @@ class MockInputsConfigurationService extends TestConfigurationService {
class
MockWorkbenchEnvironmentService
extends
NativeWorkbenchEnvironmentService
{
constructor
(
e
nv
:
platform
.
IProcessEnvironment
)
{
super
({
userEnv
:
env
}
as
IWindowConfiguration
,
process
.
execPath
,
0
);
constructor
(
userE
nv
:
platform
.
IProcessEnvironment
)
{
super
({
...
TestWindowConfiguration
,
userEnv
},
TestWindowConfiguration
.
execPath
,
TestWindowConfiguration
.
windowId
);
}
}
src/vs/workbench/services/keybinding/test/electron-browser/keybindingEditing.test.ts
浏览文件 @
187c592a
...
...
@@ -38,22 +38,20 @@ import { IEditorGroupsService } from 'vs/workbench/services/editor/common/editor
import
{
KeybindingsEditingService
}
from
'
vs/workbench/services/keybinding/common/keybindingEditing
'
;
import
{
ITextFileService
}
from
'
vs/workbench/services/textfile/common/textfiles
'
;
import
{
TextModelResolverService
}
from
'
vs/workbench/services/textmodelResolver/common/textModelResolverService
'
;
import
{
TestBackupFileService
,
TestContextService
,
TestEditorGroupsService
,
TestEditorService
,
TestLifecycleService
,
TestTextFileService
,
TestTextResourcePropertiesService
,
TestWorkingCopyService
}
from
'
vs/workbench/test/workbenchTestServices
'
;
import
{
TestBackupFileService
,
TestContextService
,
TestEditorGroupsService
,
TestEditorService
,
TestLifecycleService
,
TestTextFileService
,
TestTextResourcePropertiesService
,
TestWorkingCopyService
,
TestWindowConfiguration
}
from
'
vs/workbench/test/workbenchTestServices
'
;
import
{
FileService
}
from
'
vs/platform/files/common/fileService
'
;
import
{
Schemas
}
from
'
vs/base/common/network
'
;
import
{
DiskFileSystemProvider
}
from
'
vs/platform/files/node/diskFileSystemProvider
'
;
import
{
URI
}
from
'
vs/base/common/uri
'
;
import
{
FileUserDataProvider
}
from
'
vs/workbench/services/userData/common/fileUserDataProvider
'
;
import
{
parseArgs
,
OPTIONS
}
from
'
vs/platform/environment/node/argv
'
;
import
{
NativeWorkbenchEnvironmentService
}
from
'
vs/workbench/services/environment/electron-browser/environmentService
'
;
import
{
IWindowConfiguration
}
from
'
vs/platform/windows/common/windows
'
;
import
{
TestConfigurationService
}
from
'
vs/platform/configuration/test/common/testConfigurationService
'
;
import
{
IWorkingCopyService
}
from
'
vs/workbench/services/workingCopy/common/workingCopyService
'
;
class
TestEnvironmentService
extends
NativeWorkbenchEnvironmentService
{
constructor
(
private
_appSettingsHome
:
URI
)
{
super
(
parseArgs
(
process
.
argv
,
OPTIONS
)
as
IWindowConfiguration
,
process
.
execPath
,
0
);
super
(
TestWindowConfiguration
,
TestWindowConfiguration
.
execPath
,
TestWindowConfiguration
.
windowId
);
}
get
appSettingsHome
()
{
return
this
.
_appSettingsHome
;
}
...
...
src/vs/workbench/test/workbenchTestServices.ts
浏览文件 @
187c592a
...
...
@@ -63,7 +63,7 @@ import { ICodeEditor, IDiffEditor } from 'vs/editor/browser/editorBrowser';
import
{
IDecorationRenderOptions
}
from
'
vs/editor/common/editorCommon
'
;
import
{
EditorGroup
}
from
'
vs/workbench/common/editor/editorGroup
'
;
import
{
Dimension
}
from
'
vs/base/browser/dom
'
;
import
{
ILogService
,
NullLogService
}
from
'
vs/platform/log/common/log
'
;
import
{
ILogService
,
NullLogService
,
LogLevel
}
from
'
vs/platform/log/common/log
'
;
import
{
ILabelService
}
from
'
vs/platform/label/common/label
'
;
import
{
timeout
}
from
'
vs/base/common/async
'
;
import
{
IViewletService
}
from
'
vs/workbench/services/viewlet/browser/viewlet
'
;
...
...
@@ -100,7 +100,19 @@ export function createFileInput(instantiationService: IInstantiationService, res
return
instantiationService
.
createInstance
(
FileEditorInput
,
resource
,
undefined
,
undefined
);
}
export
const
TestEnvironmentService
=
new
NativeWorkbenchEnvironmentService
(
parseArgs
(
process
.
argv
,
OPTIONS
)
as
IWindowConfiguration
,
process
.
execPath
,
0
);
export
const
TestWindowConfiguration
:
IWindowConfiguration
=
{
windowId
:
0
,
sessionId
:
'
testSessionId
'
,
logLevel
:
LogLevel
.
Error
,
mainPid
:
0
,
appRoot
:
''
,
userEnv
:
{},
execPath
:
process
.
execPath
,
perfEntries
:
[],
...
parseArgs
(
process
.
argv
,
OPTIONS
)
};
export
const
TestEnvironmentService
=
new
NativeWorkbenchEnvironmentService
(
TestWindowConfiguration
,
process
.
execPath
,
0
);
export
class
TestContextService
implements
IWorkspaceContextService
{
_serviceBrand
:
undefined
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录