Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
3d9b0a4b
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,发现更多精彩内容 >>
未验证
提交
3d9b0a4b
编写于
4月 01, 2019
作者:
S
Sandeep Somavarapu
提交者:
GitHub
4月 01, 2019
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #71551 from Microsoft/sandy081/fixEnteringWorkspace
fix entering workspace
上级
a2e8a03d
4600555b
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
23 addition
and
52 deletion
+23
-52
src/vs/workbench/services/configuration/node/configurationService.ts
...bench/services/configuration/node/configurationService.ts
+3
-5
src/vs/workbench/services/workspace/node/workspaceEditingService.ts
...kbench/services/workspace/node/workspaceEditingService.ts
+20
-47
未找到文件。
src/vs/workbench/services/configuration/node/configurationService.ts
浏览文件 @
3d9b0a4b
...
...
@@ -284,10 +284,10 @@ export class WorkspaceService extends Disposable implements IConfigurationServic
return
this
.
_configuration
.
keys
();
}
initialize
(
arg
:
IWorkspaceInitializationPayload
,
postInitialisationTask
:
()
=>
void
=
()
=>
null
):
Promise
<
any
>
{
initialize
(
arg
:
IWorkspaceInitializationPayload
):
Promise
<
any
>
{
mark
(
'
willInitWorkspaceService
'
);
return
this
.
createWorkspace
(
arg
)
.
then
(
workspace
=>
this
.
updateWorkspaceAndInitializeConfiguration
(
workspace
,
postInitialisationTask
)).
then
(()
=>
{
.
then
(
workspace
=>
this
.
updateWorkspaceAndInitializeConfiguration
(
workspace
)).
then
(()
=>
{
mark
(
'
didInitWorkspaceService
'
);
});
}
...
...
@@ -382,7 +382,7 @@ export class WorkspaceService extends Disposable implements IConfigurationServic
}
}
private
updateWorkspaceAndInitializeConfiguration
(
workspace
:
Workspace
,
postInitialisationTask
:
()
=>
void
):
Promise
<
void
>
{
private
updateWorkspaceAndInitializeConfiguration
(
workspace
:
Workspace
):
Promise
<
void
>
{
const
hasWorkspaceBefore
=
!!
this
.
workspace
;
let
previousState
:
WorkbenchState
;
let
previousWorkspacePath
:
string
|
undefined
;
...
...
@@ -399,8 +399,6 @@ export class WorkspaceService extends Disposable implements IConfigurationServic
return
this
.
initializeConfiguration
().
then
(()
=>
{
postInitialisationTask
();
// Post initialisation task should be run before triggering events.
// Trigger changes after configuration initialization so that configuration is up to date.
if
(
hasWorkspaceBefore
)
{
const
newState
=
this
.
getWorkbenchState
();
...
...
src/vs/workbench/services/workspace/node/workspaceEditingService.ts
浏览文件 @
3d9b0a4b
...
...
@@ -334,64 +334,37 @@ export class WorkspaceEditingService implements IWorkspaceEditingService {
);
}
enterWorkspace
(
path
:
URI
):
Promise
<
void
>
{
async
enterWorkspace
(
path
:
URI
):
Promise
<
void
>
{
if
(
!!
this
.
environmentService
.
extensionTestsLocationURI
)
{
return
Promise
.
reject
(
new
Error
(
'
Entering a new workspace is not possible in tests.
'
));
}
const
workspace
=
await
this
.
workspaceService
.
getWorkspaceIdentifier
(
path
);
// Settings migration (only if we come from a folder workspace)
if
(
this
.
contextService
.
getWorkbenchState
()
===
WorkbenchState
.
FOLDER
)
{
await
this
.
migrateWorkspaceSettings
(
workspace
);
}
const
workspaceImpl
=
this
.
contextService
as
WorkspaceService
;
await
workspaceImpl
.
initialize
(
workspace
);
// Restart extension host if first root folder changed (impact on deprecated workspace.rootPath API)
// Stop the extension host first to give extensions most time to shutdown
this
.
extensionService
.
stopExtensionHost
();
let
extensionHostStarted
:
boolean
=
false
;
const
startExtensionHost
=
()
=>
{
if
(
this
.
windowService
.
getConfiguration
().
remoteAuthority
)
{
this
.
windowService
.
reloadWindow
();
// TODO aeschli: workaround until restarting works
const
result
=
await
this
.
windowService
.
enterWorkspace
(
path
);
if
(
result
)
{
await
this
.
migrateStorage
(
result
.
workspace
);
// Reinitialize backup service
if
(
this
.
backupFileService
instanceof
BackupFileService
)
{
this
.
backupFileService
.
initialize
(
result
.
backupPath
!
);
}
}
if
(
this
.
windowService
.
getConfiguration
().
remoteAuthority
)
{
this
.
windowService
.
reloadWindow
();
// TODO aeschli: workaround until restarting works
}
else
{
this
.
extensionService
.
startExtensionHost
();
extensionHostStarted
=
true
;
};
return
this
.
windowService
.
enterWorkspace
(
path
).
then
(
result
=>
{
// Migrate storage and settings if we are to enter a workspace
if
(
result
)
{
return
this
.
migrate
(
result
.
workspace
).
then
(()
=>
{
// Reinitialize backup service
if
(
this
.
backupFileService
instanceof
BackupFileService
)
{
this
.
backupFileService
.
initialize
(
result
.
backupPath
!
);
}
// Reinitialize configuration service
const
workspaceImpl
=
this
.
contextService
as
WorkspaceService
;
return
workspaceImpl
.
initialize
(
result
.
workspace
,
startExtensionHost
);
});
}
return
Promise
.
resolve
();
}).
then
(
undefined
,
error
=>
{
if
(
!
extensionHostStarted
)
{
startExtensionHost
();
// start the extension host if not started
}
return
Promise
.
reject
(
error
);
});
}
private
migrate
(
toWorkspace
:
IWorkspaceIdentifier
):
Promise
<
void
>
{
// Storage migration
return
this
.
migrateStorage
(
toWorkspace
).
then
(()
=>
{
// Settings migration (only if we come from a folder workspace)
if
(
this
.
contextService
.
getWorkbenchState
()
===
WorkbenchState
.
FOLDER
)
{
return
this
.
migrateWorkspaceSettings
(
toWorkspace
);
}
return
undefined
;
});
}
}
private
migrateStorage
(
toWorkspace
:
IWorkspaceIdentifier
):
Promise
<
void
>
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录