Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
掘金者说
vscode
提交
3d3cda18
V
vscode
项目概览
掘金者说
/
vscode
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
V
vscode
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
3d3cda18
编写于
8月 19, 2016
作者:
B
Benjamin Pasero
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
more workspace service simplification
上级
c6497e86
变更
10
隐藏空白更改
内联
并排
Showing
10 changed file
with
22 addition
and
51 deletion
+22
-51
src/vs/editor/browser/standalone/standaloneServices.ts
src/vs/editor/browser/standalone/standaloneServices.ts
+3
-7
src/vs/platform/workspace/common/workspace.ts
src/vs/platform/workspace/common/workspace.ts
+6
-20
src/vs/test/utils/servicesTestUtils.ts
src/vs/test/utils/servicesTestUtils.ts
+1
-3
src/vs/workbench/common/storage.ts
src/vs/workbench/common/storage.ts
+1
-1
src/vs/workbench/electron-browser/main.ts
src/vs/workbench/electron-browser/main.ts
+1
-3
src/vs/workbench/node/extensionHostMain.ts
src/vs/workbench/node/extensionHostMain.ts
+2
-2
src/vs/workbench/services/workspace/common/contextService.ts
src/vs/workbench/services/workspace/common/contextService.ts
+2
-2
src/vs/workbench/test/browser/part.test.ts
src/vs/workbench/test/browser/part.test.ts
+2
-2
src/vs/workbench/test/browser/parts/quickOpen/quickopen.perf.test.ts
...bench/test/browser/parts/quickOpen/quickopen.perf.test.ts
+2
-9
src/vs/workbench/test/common/memento.test.ts
src/vs/workbench/test/common/memento.test.ts
+2
-2
未找到文件。
src/vs/editor/browser/standalone/standaloneServices.ts
浏览文件 @
3d3cda18
...
...
@@ -28,7 +28,7 @@ import {IMessageService} from 'vs/platform/message/common/message';
import
{
IProgressService
}
from
'
vs/platform/progress/common/progress
'
;
import
{
IStorageService
,
NullStorageService
}
from
'
vs/platform/storage/common/storage
'
;
import
{
ITelemetryService
,
NullTelemetryService
}
from
'
vs/platform/telemetry/common/telemetry
'
;
import
{
IWorkspaceContextService
,
Base
WorkspaceContextService
}
from
'
vs/platform/workspace/common/workspace
'
;
import
{
IWorkspaceContextService
,
WorkspaceContextService
}
from
'
vs/platform/workspace/common/workspace
'
;
import
{
ICodeEditorService
}
from
'
vs/editor/common/services/codeEditorService
'
;
import
{
IEditorWorkerService
}
from
'
vs/editor/common/services/editorWorkerService
'
;
import
{
EditorWorkerServiceImpl
}
from
'
vs/editor/common/services/editorWorkerServiceImpl
'
;
...
...
@@ -237,12 +237,8 @@ export function getOrCreateStaticServices(services?: IEditorOverrideServices): I
let
serviceCollection
=
new
ServiceCollection
();
const
instantiationService
=
new
InstantiationService
(
serviceCollection
,
true
);
let
contextService
=
services
.
contextService
||
new
BaseWorkspaceContextService
({
resource
:
URI
.
from
({
scheme
:
'
inmemory
'
,
authority
:
'
model
'
,
path
:
'
/
'
}),
id
:
null
,
name
:
null
,
uid
:
null
,
mtime
:
null
let
contextService
=
services
.
contextService
||
new
WorkspaceContextService
({
resource
:
URI
.
from
({
scheme
:
'
inmemory
'
,
authority
:
'
model
'
,
path
:
'
/
'
})
});
serviceCollection
.
set
(
IWorkspaceContextService
,
contextService
);
...
...
src/vs/platform/workspace/common/workspace.ts
浏览文件 @
3d3cda18
...
...
@@ -45,34 +45,20 @@ export interface IWorkspace {
*/
resource
:
URI
;
/**
* the identifier that uniquely identifies this workspace among others.
*/
id
:
string
;
/**
* the name of the workspace
*/
name
:
string
;
/**
* the last modified date of the workspace if known
*/
mtime
?:
number
;
/**
* the unique identifier of the workspace. if the workspace is deleted and recreated
* the identifier also changes. this makes the uid more unique compared to the id which
* is just derived from the workspace name.
*/
uid
?:
number
;
/**
* the name of the workspace
*/
name
?:
string
;
}
/**
* Simple IWorkspaceContextService implementation to allow sharing of this service implementation
* between different layers of the platform.
*/
export
class
BaseWorkspaceContextService
implements
IWorkspaceContextService
{
export
class
WorkspaceContextService
implements
IWorkspaceContextService
{
public
_serviceBrand
:
any
;
...
...
src/vs/test/utils/servicesTestUtils.ts
浏览文件 @
3d3cda18
...
...
@@ -45,10 +45,8 @@ import {EnvironmentService} from 'vs/platform/environment/node/environmentServic
export
const
TestWorkspace
:
IWorkspace
=
{
resource
:
URI
.
file
(
'
C:
\\
testWorkspace
'
),
id
:
'
testWorkspace
'
,
name
:
'
Test Workspace
'
,
uid
:
new
Date
().
getTime
(),
mtime
:
new
Date
().
getTime
()
uid
:
new
Date
().
getTime
()
};
export
const
TestEnvironmentService
=
new
EnvironmentService
(
Objects
.
assign
(
parseArgs
(
process
.
argv
),
{
execPath
:
process
.
execPath
}));
...
...
src/vs/workbench/common/storage.ts
浏览文件 @
3d3cda18
...
...
@@ -49,7 +49,7 @@ export class Storage implements IStorageService {
this
.
workspaceKey
=
this
.
getWorkspaceKey
(
workspace
);
// Make sure to delete all workspace storage if the workspace has been recreated meanwhile
const
workspaceUniqueId
:
number
=
workspace
?
workspace
.
uid
:
null
;
const
workspaceUniqueId
:
number
=
workspace
?
workspace
.
uid
:
void
0
;
if
(
types
.
isNumber
(
workspaceUniqueId
))
{
this
.
cleanupWorkspaceScope
(
workspaceUniqueId
,
workspace
.
name
);
}
...
...
src/vs/workbench/electron-browser/main.ts
浏览文件 @
3d3cda18
...
...
@@ -122,10 +122,8 @@ function getWorkspace(workspacePath: string): IWorkspace {
return
<
IWorkspace
>
{
'
resource
'
:
workspaceResource
,
'
id
'
:
platform
.
isLinux
?
realWorkspacePath
:
realWorkspacePath
.
toLowerCase
(),
'
name
'
:
folderName
,
'
uid
'
:
platform
.
isLinux
?
folderStat
.
ino
:
folderStat
.
birthtime
.
getTime
(),
// On Linux, birthtime is ctime, so we cannot use it! We use the ino instead!
'
mtime
'
:
folderStat
.
mtime
.
getTime
()
'
uid
'
:
platform
.
isLinux
?
folderStat
.
ino
:
folderStat
.
birthtime
.
getTime
()
// On Linux, birthtime is ctime, so we cannot use it! We use the ino instead!
};
}
...
...
src/vs/workbench/node/extensionHostMain.ts
浏览文件 @
3d3cda18
...
...
@@ -22,7 +22,7 @@ import {ExtHostExtensionService} from 'vs/workbench/api/node/extHostExtensionSer
import
{
ExtHostThreadService
}
from
'
vs/workbench/services/thread/common/extHostThreadService
'
;
import
{
RemoteTelemetryService
}
from
'
vs/workbench/api/node/extHostTelemetry
'
;
import
{
ExtensionScanner
,
MessagesCollector
}
from
'
vs/workbench/node/extensionPoints
'
;
import
{
IWorkspaceContextService
,
Base
WorkspaceContextService
}
from
'
vs/platform/workspace/common/workspace
'
;
import
{
IWorkspaceContextService
,
WorkspaceContextService
}
from
'
vs/platform/workspace/common/workspace
'
;
import
{
Client
}
from
'
vs/base/parts/ipc/node/ipc.net
'
;
import
{
IExtensionManagementChannel
,
ExtensionManagementChannelClient
}
from
'
vs/platform/extensionManagement/common/extensionManagementIpc
'
;
...
...
@@ -72,7 +72,7 @@ export class ExtensionHostMain {
this
.
_environment
=
initData
.
environment
;
this
.
_contextService
=
new
Base
WorkspaceContextService
(
initData
.
contextService
.
workspace
);
this
.
_contextService
=
new
WorkspaceContextService
(
initData
.
contextService
.
workspace
);
const
workspaceStoragePath
=
this
.
_getOrCreateWorkspaceStoragePath
();
const
threadService
=
new
ExtHostThreadService
(
remoteCom
);
...
...
src/vs/workbench/services/workspace/common/contextService.ts
浏览文件 @
3d3cda18
...
...
@@ -7,9 +7,9 @@
import
{
IOptions
}
from
'
vs/workbench/common/options
'
;
import
{
EventType
,
OptionsChangeEvent
}
from
'
vs/workbench/common/events
'
;
import
{
IEventService
}
from
'
vs/platform/event/common/event
'
;
import
{
IWorkspace
,
Base
WorkspaceContextService
}
from
'
vs/platform/workspace/common/workspace
'
;
import
{
IWorkspace
,
WorkspaceContextService
}
from
'
vs/platform/workspace/common/workspace
'
;
export
class
LegacyWorkspaceContextService
extends
Base
WorkspaceContextService
{
export
class
LegacyWorkspaceContextService
extends
WorkspaceContextService
{
constructor
(
private
eventService
:
IEventService
,
...
...
src/vs/workbench/test/browser/part.test.ts
浏览文件 @
3d3cda18
...
...
@@ -10,7 +10,7 @@ import {Build, Builder} from 'vs/base/browser/builder';
import
{
Part
}
from
'
vs/workbench/browser/part
'
;
import
*
as
Types
from
'
vs/base/common/types
'
;
import
*
as
TestUtils
from
'
vs/test/utils/servicesTestUtils
'
;
import
{
IWorkspaceContextService
,
Base
WorkspaceContextService
}
from
'
vs/platform/workspace/common/workspace
'
;
import
{
IWorkspaceContextService
,
WorkspaceContextService
}
from
'
vs/platform/workspace/common/workspace
'
;
import
{
IStorageService
}
from
'
vs/platform/storage/common/storage
'
;
import
{
Storage
,
InMemoryLocalStorage
}
from
'
vs/workbench/common/storage
'
;
...
...
@@ -104,7 +104,7 @@ suite('Workbench Part', () => {
fixture
=
document
.
createElement
(
'
div
'
);
fixture
.
id
=
fixtureId
;
document
.
body
.
appendChild
(
fixture
);
context
=
new
Base
WorkspaceContextService
(
TestUtils
.
TestWorkspace
);
context
=
new
WorkspaceContextService
(
TestUtils
.
TestWorkspace
);
storage
=
new
Storage
(
new
InMemoryLocalStorage
(),
null
,
context
);
});
...
...
src/vs/workbench/test/browser/parts/quickOpen/quickopen.perf.test.ts
浏览文件 @
3d3cda18
...
...
@@ -7,7 +7,7 @@
import
'
vs/workbench/parts/search/browser/search.contribution
'
;
// load contributions
import
*
as
assert
from
'
assert
'
;
import
{
Base
WorkspaceContextService
}
from
'
vs/platform/workspace/common/workspace
'
;
import
{
WorkspaceContextService
}
from
'
vs/platform/workspace/common/workspace
'
;
import
{
createSyncDescriptor
}
from
'
vs/platform/instantiation/common/descriptors
'
;
import
{
ensureStaticPlatformServices
,
IEditorOverrideServices
}
from
'
vs/editor/browser/standalone/standaloneServices
'
;
import
{
IEditorGroupService
}
from
'
vs/workbench/services/group/common/groupService
'
;
...
...
@@ -44,14 +44,7 @@ suite('QuickOpen performance', () => {
const
telemetryService
=
new
TestTelemetryService
();
const
overrides
:
IEditorOverrideServices
=
{
contextService
:
new
BaseWorkspaceContextService
({
resource
:
URI
.
file
(
testWorkspacePath
),
id
:
null
,
name
:
null
,
uid
:
null
,
mtime
:
null
}),
contextService
:
new
WorkspaceContextService
({
resource
:
URI
.
file
(
testWorkspacePath
)
}),
telemetryService
};
...
...
src/vs/workbench/test/common/memento.test.ts
浏览文件 @
3d3cda18
...
...
@@ -6,7 +6,7 @@
'
use strict
'
;
import
*
as
assert
from
'
assert
'
;
import
{
Base
WorkspaceContextService
}
from
'
vs/platform/workspace/common/workspace
'
;
import
{
WorkspaceContextService
}
from
'
vs/platform/workspace/common/workspace
'
;
import
{
StorageScope
}
from
'
vs/platform/storage/common/storage
'
;
import
*
as
TestUtils
from
'
vs/test/utils/servicesTestUtils
'
;
import
{
Memento
,
Scope
}
from
'
vs/workbench/common/memento
'
;
...
...
@@ -17,7 +17,7 @@ suite('Workbench Memento', () => {
let
storage
;
setup
(()
=>
{
context
=
new
Base
WorkspaceContextService
(
TestUtils
.
TestWorkspace
);
context
=
new
WorkspaceContextService
(
TestUtils
.
TestWorkspace
);
storage
=
new
Storage
(
new
InMemoryLocalStorage
(),
null
,
context
);
});
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录