Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
00a24d5c
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,体验更适合开发者的 AI 搜索 >>
提交
00a24d5c
编写于
6月 12, 2017
作者:
B
Benjamin Pasero
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
workspace - wire in some new apis to get at folders
上级
240cf011
变更
15
隐藏空白更改
内联
并排
Showing
15 changed file
with
191 addition
and
20 deletion
+191
-20
src/vs/editor/browser/standalone/standaloneServices.ts
src/vs/editor/browser/standalone/standaloneServices.ts
+4
-3
src/vs/platform/workspace/common/workspace.ts
src/vs/platform/workspace/common/workspace.ts
+83
-3
src/vs/workbench/electron-browser/main.contribution.ts
src/vs/workbench/electron-browser/main.contribution.ts
+29
-0
src/vs/workbench/electron-browser/main.ts
src/vs/workbench/electron-browser/main.ts
+1
-1
src/vs/workbench/node/extensionHostMain.ts
src/vs/workbench/node/extensionHostMain.ts
+2
-1
src/vs/workbench/parts/extensions/test/electron-browser/extensionsActions.test.ts
...xtensions/test/electron-browser/extensionsActions.test.ts
+2
-1
src/vs/workbench/parts/extensions/test/electron-browser/extensionsWorkbenchService.test.ts
.../test/electron-browser/extensionsWorkbenchService.test.ts
+2
-1
src/vs/workbench/parts/terminal/test/electron-browser/terminalLinkHandler.test.ts
...erminal/test/electron-browser/terminalLinkHandler.test.ts
+4
-3
src/vs/workbench/services/configuration/node/nullConfigurationService.ts
...h/services/configuration/node/nullConfigurationService.ts
+44
-0
src/vs/workbench/services/configuration/test/node/configurationEditingService.test.ts
...nfiguration/test/node/configurationEditingService.test.ts
+1
-1
src/vs/workbench/test/browser/part.test.ts
src/vs/workbench/test/browser/part.test.ts
+2
-1
src/vs/workbench/test/common/memento.test.ts
src/vs/workbench/test/common/memento.test.ts
+2
-1
src/vs/workbench/test/electron-browser/quickopen.perf.integrationTest.ts
...h/test/electron-browser/quickopen.perf.integrationTest.ts
+2
-2
src/vs/workbench/test/electron-browser/textsearch.perf.integrationTest.ts
.../test/electron-browser/textsearch.perf.integrationTest.ts
+2
-2
src/vs/workbench/test/workbenchTestServices.ts
src/vs/workbench/test/workbenchTestServices.ts
+11
-0
未找到文件。
src/vs/editor/browser/standalone/standaloneServices.ts
浏览文件 @
00a24d5c
...
...
@@ -115,14 +115,15 @@ export module StaticServices {
export
const
instantiationService
=
define
<
IInstantiationService
>
(
IInstantiationService
,
()
=>
new
InstantiationService
(
_serviceCollection
,
true
));
export
const
contextService
=
define
(
IWorkspaceContextService
,
()
=>
new
WorkspaceContextService
(
new
Workspace
(
const
configurationServiceImpl
=
new
SimpleConfigurationService
();
export
const
configurationService
=
define
(
IConfigurationService
,
()
=>
configurationServiceImpl
);
export
const
contextService
=
define
(
IWorkspaceContextService
,
()
=>
new
WorkspaceContextService
(
configurationServiceImpl
,
new
Workspace
(
URI
.
from
({
scheme
:
'
inmemory
'
,
authority
:
'
model
'
,
path
:
'
/
'
})
)));
export
const
telemetryService
=
define
(
ITelemetryService
,
()
=>
new
StandaloneTelemetryService
());
export
const
configurationService
=
define
(
IConfigurationService
,
()
=>
new
SimpleConfigurationService
());
export
const
messageService
=
define
(
IMessageService
,
()
=>
new
SimpleMessageService
());
export
const
markerService
=
define
(
IMarkerService
,
()
=>
new
MarkerService
());
...
...
src/vs/platform/workspace/common/workspace.ts
浏览文件 @
00a24d5c
...
...
@@ -9,6 +9,11 @@ import { createDecorator } from 'vs/platform/instantiation/common/instantiation'
import
paths
=
require
(
'
vs/base/common/paths
'
);
import
{
isEqualOrParent
}
from
'
vs/platform/files/common/files
'
;
import
{
isLinux
}
from
'
vs/base/common/platform
'
;
import
Event
,
{
Emitter
}
from
'
vs/base/common/event
'
;
import
{
IConfigurationService
}
from
"
vs/platform/configuration/common/configuration
"
;
import
{
IDisposable
,
dispose
}
from
"
vs/base/common/lifecycle
"
;
import
{
distinct
,
equals
}
from
"
vs/base/common/arrays
"
;
import
{
Schemas
}
from
"
vs/base/common/network
"
;
export
const
IWorkspaceContextService
=
createDecorator
<
IWorkspaceContextService
>
(
'
contextService
'
);
...
...
@@ -42,6 +47,12 @@ export interface IWorkspaceContextService {
* Given a workspace relative path, returns the resource with the absolute path.
*/
toResource
:
(
workspaceRelativePath
:
string
)
=>
URI
;
/**
* TODO@Ben multiroot
*/
getFolders
():
URI
[];
onDidChangeFolders
:
Event
<
URI
[]
>
;
}
export
interface
IWorkspace
{
...
...
@@ -111,14 +122,79 @@ export class Workspace implements IWorkspace {
}
}
type
IWorkspaceConfiguration
=
{
path
:
string
;
folders
:
string
[];
}[];
export
class
WorkspaceContextService
implements
IWorkspaceContextService
{
public
_serviceBrand
:
any
;
private
workspace
:
Workspace
;
private
_onDidChangeFolders
:
Emitter
<
URI
[]
>
;
private
folders
:
URI
[];
private
toDispose
:
IDisposable
[];
constructor
(
private
configurationService
:
IConfigurationService
,
private
workspace
?:
Workspace
)
{
this
.
toDispose
=
[];
this
.
_onDidChangeFolders
=
new
Emitter
<
URI
[]
>
();
this
.
toDispose
.
push
(
this
.
_onDidChangeFolders
);
this
.
folders
=
workspace
?
[
workspace
.
resource
]
:
[];
this
.
resolveAdditionalFolders
();
this
.
registerListeners
();
}
private
registerListeners
():
void
{
this
.
toDispose
.
push
(
this
.
configurationService
.
onDidUpdateConfiguration
(
e
=>
this
.
onDidUpdateConfiguration
()));
}
private
onDidUpdateConfiguration
():
void
{
this
.
resolveAdditionalFolders
(
true
);
}
private
resolveAdditionalFolders
(
notify
?:
boolean
):
void
{
if
(
!
this
.
workspace
)
{
return
;
// no additional folders for empty workspaces
}
// Resovled configured folders for workspace
let
configuredFolders
:
URI
[]
=
[
this
.
workspace
.
resource
];
const
config
=
this
.
configurationService
.
getConfiguration
<
IWorkspaceConfiguration
>
(
'
workspace
'
);
if
(
Array
.
isArray
(
config
))
{
for
(
let
i
=
0
;
i
<
config
.
length
;
i
++
)
{
const
targetWorkspace
=
config
[
i
];
if
(
targetWorkspace
.
path
===
this
.
workspace
.
resource
.
toString
())
{
const
additionalFolders
=
targetWorkspace
.
folders
.
map
(
f
=>
URI
.
parse
(
f
))
.
filter
(
r
=>
r
.
scheme
===
Schemas
.
file
);
// only support files for now
configuredFolders
.
push
(...
additionalFolders
);
break
;
}
}
}
// Remove duplicates
configuredFolders
=
distinct
(
configuredFolders
,
r
=>
r
.
toString
());
// Find changes
const
changed
=
!
equals
(
this
.
folders
,
configuredFolders
,
(
r1
,
r2
)
=>
r1
.
toString
()
===
r2
.
toString
());
this
.
folders
=
configuredFolders
;
constructor
(
workspace
?:
Workspace
)
{
this
.
workspace
=
workspace
;
if
(
notify
&&
changed
)
{
this
.
_onDidChangeFolders
.
fire
(
configuredFolders
);
}
}
public
get
onDidChangeFolders
():
Event
<
URI
[]
>
{
return
this
.
_onDidChangeFolders
&&
this
.
_onDidChangeFolders
.
event
;
//TODO@Sandeep sinon is a pita
}
public
getFolders
():
URI
[]
{
return
this
.
folders
;
}
public
getWorkspace
():
IWorkspace
{
...
...
@@ -140,4 +216,8 @@ export class WorkspaceContextService implements IWorkspaceContextService {
public
toResource
(
workspaceRelativePath
:
string
):
URI
{
return
this
.
workspace
?
this
.
workspace
.
toResource
(
workspaceRelativePath
)
:
null
;
}
public
dispose
():
void
{
dispose
(
this
.
toDispose
);
}
}
\ No newline at end of file
src/vs/workbench/electron-browser/main.contribution.ts
浏览文件 @
00a24d5c
...
...
@@ -357,4 +357,33 @@ configurationRegistry.registerConfiguration({
'
description
'
:
nls
.
localize
(
'
zenMode.restore
'
,
"
Controls if a window should restore to zen mode if it was exited in zen mode.
"
)
}
}
});
// Configuration: Workspace
configurationRegistry
.
registerConfiguration
(
<
any
>
{
'
id
'
:
'
workspace
'
,
'
order
'
:
10000
,
'
title
'
:
nls
.
localize
(
'
workspaceConfigurationTitle
'
,
"
Workspace
"
),
'
type
'
:
'
object
'
,
'
properties
'
:
{
'
workspace
'
:
{
'
type
'
:
'
array
'
,
'
title
'
:
nls
.
localize
(
'
workspaces.title
'
,
"
Folder configuration of the workspace
"
),
'
items
'
:
{
'
required
'
:
[
'
path
'
],
'
type
'
:
'
object
'
,
'
defaultSnippets
'
:
[{
'
body
'
:
{
'
path
'
:
'
$1
'
,
'
folders
'
:
[
'
$2
'
]
}
}],
'
properties
'
:
{
'
path
'
:
{
'
type
'
:
'
string
'
,
'
description
'
:
nls
.
localize
(
'
workspaces.path
'
,
"
Path of the folder to configure folders for
"
),
},
'
folders
'
:
{
'
description
'
:
nls
.
localize
(
'
workspaces.additionalFolders
'
,
"
Folders of this workspace
"
),
'
type
'
:
'
array
'
}
}
}
}
}
});
\ No newline at end of file
src/vs/workbench/electron-browser/main.ts
浏览文件 @
00a24d5c
...
...
@@ -150,8 +150,8 @@ function getWorkspace(workspacePath: string): TPromise<Workspace> {
function
openWorkbench
(
environment
:
IWindowConfiguration
,
workspace
:
Workspace
,
options
:
IOptions
):
TPromise
<
void
>
{
const
environmentService
=
new
EnvironmentService
(
environment
,
environment
.
execPath
);
const
contextService
=
new
WorkspaceContextService
(
workspace
);
const
configurationService
=
new
WorkspaceConfigurationService
(
environmentService
,
workspace
);
const
contextService
=
new
WorkspaceContextService
(
configurationService
,
workspace
);
const
timerService
=
new
TimerService
((
<
any
>
window
).
MonacoEnvironment
.
timers
as
IInitData
,
!
contextService
.
hasWorkspace
());
// Since the configuration service is one of the core services that is used in so many places, we initialize it
...
...
src/vs/workbench/node/extensionHostMain.ts
浏览文件 @
00a24d5c
...
...
@@ -18,6 +18,7 @@ import { RemoteTelemetryService } from 'vs/workbench/api/node/extHostTelemetry';
import
{
IWorkspaceContextService
,
WorkspaceContextService
,
Workspace
}
from
'
vs/platform/workspace/common/workspace
'
;
import
{
IInitData
,
IEnvironment
,
MainContext
}
from
'
vs/workbench/api/node/extHost.protocol
'
;
import
*
as
errors
from
'
vs/base/common/errors
'
;
import
{
NullConfigurationService
}
from
"
vs/workbench/services/configuration/node/nullConfigurationService
"
;
const
nativeExit
=
process
.
exit
.
bind
(
process
);
process
.
exit
=
function
()
{
...
...
@@ -49,7 +50,7 @@ export class ExtensionHostMain {
if
(
workspaceRaw
)
{
workspace
=
new
Workspace
(
workspaceRaw
.
resource
,
workspaceRaw
.
uid
,
workspaceRaw
.
name
);
}
this
.
_contextService
=
new
WorkspaceContextService
(
workspace
);
this
.
_contextService
=
new
WorkspaceContextService
(
new
NullConfigurationService
(),
workspace
);
//TODO@Ben implement for exthost
const
threadService
=
new
ExtHostThreadService
(
remoteCom
);
const
telemetryService
=
new
RemoteTelemetryService
(
'
pluginHostTelemetry
'
,
threadService
);
...
...
src/vs/workbench/parts/extensions/test/electron-browser/extensionsActions.test.ts
浏览文件 @
00a24d5c
...
...
@@ -31,6 +31,7 @@ import { IExtensionService } from 'vs/platform/extensions/common/extensions';
import
{
IWorkspaceContextService
,
WorkspaceContextService
}
from
'
vs/platform/workspace/common/workspace
'
;
import
{
TestWorkspace
}
from
'
vs/platform/workspace/test/common/testWorkspace
'
;
import
{
IConfigurationService
}
from
'
vs/platform/configuration/common/configuration
'
;
import
{
TestConfigurationService
}
from
"
vs/platform/configuration/test/common/testConfigurationService
"
;
suite
(
'
ExtensionsActions Test
'
,
()
=>
{
...
...
@@ -52,7 +53,7 @@ suite('ExtensionsActions Test', () => {
instantiationService
.
stub
(
IURLService
,
{
onOpenURL
:
new
Emitter
().
event
});
instantiationService
.
stub
(
ITelemetryService
,
NullTelemetryService
);
instantiationService
.
set
(
IWorkspaceContextService
,
new
WorkspaceContextService
(
TestWorkspace
));
instantiationService
.
set
(
IWorkspaceContextService
,
new
WorkspaceContextService
(
new
TestConfigurationService
(),
TestWorkspace
));
instantiationService
.
stub
(
IConfigurationService
,
{
onDidUpdateConfiguration
:
()
=>
{
},
getConfiguration
:
()
=>
({})
});
instantiationService
.
stub
(
IExtensionGalleryService
,
ExtensionGalleryService
);
...
...
src/vs/workbench/parts/extensions/test/electron-browser/extensionsWorkbenchService.test.ts
浏览文件 @
00a24d5c
...
...
@@ -32,6 +32,7 @@ import { IWorkspaceContextService, WorkspaceContextService } from 'vs/platform/w
import
{
TestWorkspace
}
from
'
vs/platform/workspace/test/common/testWorkspace
'
;
import
{
IChoiceService
}
from
'
vs/platform/message/common/message
'
;
import
{
IConfigurationService
}
from
'
vs/platform/configuration/common/configuration
'
;
import
{
TestConfigurationService
}
from
"
vs/platform/configuration/test/common/testConfigurationService
"
;
suite
(
'
ExtensionsWorkbenchService Test
'
,
()
=>
{
...
...
@@ -55,7 +56,7 @@ suite('ExtensionsWorkbenchService Test', () => {
instantiationService
.
stub
(
IExtensionGalleryService
,
ExtensionGalleryService
);
instantiationService
.
set
(
IWorkspaceContextService
,
new
WorkspaceContextService
(
TestWorkspace
));
instantiationService
.
set
(
IWorkspaceContextService
,
new
WorkspaceContextService
(
new
TestConfigurationService
(),
TestWorkspace
));
instantiationService
.
stub
(
IConfigurationService
,
{
onDidUpdateConfiguration
:
()
=>
{
},
getConfiguration
:
()
=>
({})
});
instantiationService
.
stub
(
IExtensionManagementService
,
ExtensionManagementService
);
...
...
src/vs/workbench/parts/terminal/test/electron-browser/terminalLinkHandler.test.ts
浏览文件 @
00a24d5c
...
...
@@ -13,6 +13,7 @@ import URI from 'vs/base/common/uri';
import
*
as
strings
from
'
vs/base/common/strings
'
;
import
*
as
path
from
'
path
'
;
import
*
as
sinon
from
'
sinon
'
;
import
{
TestConfigurationService
}
from
"
vs/platform/configuration/test/common/testConfigurationService
"
;
class
TestTerminalLinkHandler
extends
TerminalLinkHandler
{
public
get
localLinkRegex
():
RegExp
{
...
...
@@ -175,7 +176,7 @@ suite('Workbench - TerminalLinkHandler', () => {
suite
(
'
preprocessPath
'
,
()
=>
{
test
(
'
Windows
'
,
()
=>
{
const
linkHandler
=
new
TestTerminalLinkHandler
(
new
TestXterm
(),
Platform
.
Windows
,
null
,
null
,
new
WorkspaceContextService
(
new
TestWorkspace
(
'
C:
\\
base
'
)));
new
WorkspaceContextService
(
new
Test
ConfigurationService
(),
new
Test
Workspace
(
'
C:
\\
base
'
)));
let
stub
=
sinon
.
stub
(
path
,
'
join
'
,
function
(
arg1
,
arg2
)
{
return
arg1
+
'
\\
'
+
arg2
;
...
...
@@ -189,7 +190,7 @@ suite('Workbench - TerminalLinkHandler', () => {
test
(
'
Linux
'
,
()
=>
{
const
linkHandler
=
new
TestTerminalLinkHandler
(
new
TestXterm
(),
Platform
.
Linux
,
null
,
null
,
new
WorkspaceContextService
(
new
TestWorkspace
(
'
/base
'
)));
new
WorkspaceContextService
(
new
Test
ConfigurationService
(),
new
Test
Workspace
(
'
/base
'
)));
let
stub
=
sinon
.
stub
(
path
,
'
join
'
,
function
(
arg1
,
arg2
)
{
return
arg1
+
'
/
'
+
arg2
;
...
...
@@ -202,7 +203,7 @@ suite('Workbench - TerminalLinkHandler', () => {
});
test
(
'
No Workspace
'
,
()
=>
{
const
linkHandler
=
new
TestTerminalLinkHandler
(
new
TestXterm
(),
Platform
.
Linux
,
null
,
null
,
new
WorkspaceContextService
(
n
ull
));
const
linkHandler
=
new
TestTerminalLinkHandler
(
new
TestXterm
(),
Platform
.
Linux
,
null
,
null
,
new
WorkspaceContextService
(
n
ew
TestConfigurationService
()
));
assert
.
equal
(
linkHandler
.
preprocessPath
(
'
./src/file1
'
),
null
);
assert
.
equal
(
linkHandler
.
preprocessPath
(
'
src/file2
'
),
null
);
...
...
src/vs/workbench/services/configuration/node/nullConfigurationService.ts
0 → 100644
浏览文件 @
00a24d5c
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
'
use strict
'
;
import
{
IConfigurationService
,
IConfigurationServiceEvent
,
IConfigurationValue
,
getConfigurationValue
,
IConfigurationKeys
}
from
"
vs/platform/configuration/common/configuration
"
;
import
Event
,
{
Emitter
}
from
'
vs/base/common/event
'
;
import
{
TPromise
}
from
"
vs/base/common/winjs.base
"
;
export
class
NullConfigurationService
implements
IConfigurationService
{
_serviceBrand
:
any
;
private
_onDidUpdateConfiguration
=
new
Emitter
<
IConfigurationServiceEvent
>
();
public
onDidUpdateConfiguration
:
Event
<
IConfigurationServiceEvent
>
=
this
.
_onDidUpdateConfiguration
.
event
;
private
_config
:
any
;
constructor
()
{
this
.
_config
=
Object
.
create
(
null
);
}
public
getConfiguration
<
T
>
(
section
?:
any
):
T
{
return
this
.
_config
;
}
public
reloadConfiguration
<
T
>
(
section
?:
string
):
TPromise
<
T
>
{
return
TPromise
.
as
<
T
>
(
this
.
getConfiguration
<
T
>
(
section
));
}
public
lookup
<
C
>
(
key
:
string
):
IConfigurationValue
<
C
>
{
return
{
value
:
getConfigurationValue
<
C
>
(
this
.
getConfiguration
(),
key
),
default
:
getConfigurationValue
<
C
>
(
this
.
getConfiguration
(),
key
),
user
:
getConfigurationValue
<
C
>
(
this
.
getConfiguration
(),
key
)
};
}
public
keys
():
IConfigurationKeys
{
return
{
default
:
[],
user
:
[]
};
}
}
\ No newline at end of file
src/vs/workbench/services/configuration/test/node/configurationEditingService.test.ts
浏览文件 @
00a24d5c
...
...
@@ -116,8 +116,8 @@ suite('ConfigurationEditingService', () => {
const
environmentService
=
new
SettingsTestEnvironmentService
(
parseArgs
(
process
.
argv
),
process
.
execPath
,
globalSettingsFile
);
instantiationService
.
stub
(
IEnvironmentService
,
environmentService
);
const
workspace
=
noWorkspace
?
null
:
new
Workspace
(
URI
.
file
(
workspaceDir
));
instantiationService
.
stub
(
IWorkspaceContextService
,
new
WorkspaceContextService
(
workspace
));
const
configurationService
=
new
WorkspaceConfigurationService
(
environmentService
,
workspace
);
instantiationService
.
stub
(
IWorkspaceContextService
,
new
WorkspaceContextService
(
configurationService
,
workspace
));
instantiationService
.
stub
(
IConfigurationService
,
configurationService
);
instantiationService
.
stub
(
ILifecycleService
,
new
TestLifecycleService
());
instantiationService
.
stub
(
IEditorGroupService
,
new
TestEditorGroupService
());
...
...
src/vs/workbench/test/browser/part.test.ts
浏览文件 @
00a24d5c
...
...
@@ -14,6 +14,7 @@ import { IStorageService } from 'vs/platform/storage/common/storage';
import
{
StorageService
,
InMemoryLocalStorage
}
from
'
vs/platform/storage/common/storageService
'
;
import
{
TestWorkspace
}
from
'
vs/platform/workspace/test/common/testWorkspace
'
;
import
{
TestThemeService
}
from
'
vs/workbench/test/workbenchTestServices
'
;
import
{
TestConfigurationService
}
from
"
vs/platform/configuration/test/common/testConfigurationService
"
;
class
MyPart
extends
Part
{
...
...
@@ -91,7 +92,7 @@ suite('Workbench Part', () => {
fixture
=
document
.
createElement
(
'
div
'
);
fixture
.
id
=
fixtureId
;
document
.
body
.
appendChild
(
fixture
);
context
=
new
WorkspaceContextService
(
TestWorkspace
);
context
=
new
WorkspaceContextService
(
new
TestConfigurationService
(),
TestWorkspace
);
storage
=
new
StorageService
(
new
InMemoryLocalStorage
(),
null
,
context
);
});
...
...
src/vs/workbench/test/common/memento.test.ts
浏览文件 @
00a24d5c
...
...
@@ -11,13 +11,14 @@ import { StorageScope } from 'vs/platform/storage/common/storage';
import
{
TestWorkspace
}
from
'
vs/platform/workspace/test/common/testWorkspace
'
;
import
{
Memento
,
Scope
}
from
'
vs/workbench/common/memento
'
;
import
{
StorageService
,
InMemoryLocalStorage
}
from
'
vs/platform/storage/common/storageService
'
;
import
{
TestConfigurationService
}
from
"
vs/platform/configuration/test/common/testConfigurationService
"
;
suite
(
'
Workbench Memento
'
,
()
=>
{
let
context
;
let
storage
;
setup
(()
=>
{
context
=
new
WorkspaceContextService
(
TestWorkspace
);
context
=
new
WorkspaceContextService
(
new
TestConfigurationService
(),
TestWorkspace
);
storage
=
new
StorageService
(
new
InMemoryLocalStorage
(),
null
,
context
);
});
...
...
src/vs/workbench/test/electron-browser/quickopen.perf.integrationTest.ts
浏览文件 @
00a24d5c
...
...
@@ -71,9 +71,9 @@ suite('QuickOpen performance (integration)', () => {
const
configurationService
=
new
SimpleConfigurationService
();
const
instantiationService
=
new
InstantiationService
(
new
ServiceCollection
(
[
ITelemetryService
,
telemetryService
],
[
IConfigurationService
,
new
SimpleConfigurationService
()
],
[
IConfigurationService
,
configurationService
],
[
IModelService
,
new
ModelServiceImpl
(
null
,
configurationService
)],
[
IWorkspaceContextService
,
new
WorkspaceContextService
(
new
Workspace
(
URI
.
file
(
testWorkspacePath
)))],
[
IWorkspaceContextService
,
new
WorkspaceContextService
(
configurationService
,
new
Workspace
(
URI
.
file
(
testWorkspacePath
)))],
[
IWorkbenchEditorService
,
new
TestEditorService
()],
[
IEditorGroupService
,
new
TestEditorGroupService
()],
[
IEnvironmentService
,
TestEnvironmentService
],
...
...
src/vs/workbench/test/electron-browser/textsearch.perf.integrationTest.ts
浏览文件 @
00a24d5c
...
...
@@ -60,9 +60,9 @@ suite('TextSearch performance (integration)', () => {
const
configurationService
=
new
SimpleConfigurationService
();
const
instantiationService
=
new
InstantiationService
(
new
ServiceCollection
(
[
ITelemetryService
,
telemetryService
],
[
IConfigurationService
,
new
SimpleConfigurationService
()
],
[
IConfigurationService
,
configurationService
],
[
IModelService
,
new
ModelServiceImpl
(
null
,
configurationService
)],
[
IWorkspaceContextService
,
new
WorkspaceContextService
(
new
Workspace
(
URI
.
file
(
testWorkspacePath
)))],
[
IWorkspaceContextService
,
new
WorkspaceContextService
(
configurationService
,
new
Workspace
(
URI
.
file
(
testWorkspacePath
)))],
[
IWorkbenchEditorService
,
new
TestEditorService
()],
[
IEditorGroupService
,
new
TestEditorGroupService
()],
[
IEnvironmentService
,
TestEnvironmentService
],
...
...
src/vs/workbench/test/workbenchTestServices.ts
浏览文件 @
00a24d5c
...
...
@@ -66,9 +66,20 @@ export class TestContextService implements IWorkspaceContextService {
private
workspace
:
any
;
private
options
:
any
;
private
_onDidChangeFolders
:
Emitter
<
URI
[]
>
;
constructor
(
workspace
:
any
=
TestWorkspace
,
options
:
any
=
null
)
{
this
.
workspace
=
workspace
;
this
.
options
=
options
||
Object
.
create
(
null
);
this
.
_onDidChangeFolders
=
new
Emitter
<
URI
[]
>
();
}
public
get
onDidChangeFolders
():
Event
<
URI
[]
>
{
return
this
.
_onDidChangeFolders
.
event
;
}
public
getFolders
():
URI
[]
{
return
this
.
workspace
?
[
this
.
workspace
.
resource
]
:
[];
}
public
hasWorkspace
():
boolean
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录