Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
bb2d2a0b
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 搜索 >>
提交
bb2d2a0b
编写于
9月 19, 2017
作者:
B
Benjamin Pasero
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
enter workspace: update backup path properly
上级
26d2e951
变更
9
隐藏空白更改
内联
并排
Showing
9 changed file
with
66 addition
and
46 deletion
+66
-46
src/vs/code/electron-main/windows.ts
src/vs/code/electron-main/windows.ts
+12
-12
src/vs/platform/windows/common/windows.ts
src/vs/platform/windows/common/windows.ts
+9
-4
src/vs/platform/windows/common/windowsIpc.ts
src/vs/platform/windows/common/windowsIpc.ts
+5
-5
src/vs/platform/windows/electron-browser/windowService.ts
src/vs/platform/windows/electron-browser/windowService.ts
+3
-4
src/vs/platform/windows/electron-main/windows.ts
src/vs/platform/windows/electron-main/windows.ts
+3
-3
src/vs/platform/windows/electron-main/windowsService.ts
src/vs/platform/windows/electron-main/windowsService.ts
+3
-3
src/vs/workbench/services/backup/node/backupFileService.ts
src/vs/workbench/services/backup/node/backupFileService.ts
+11
-2
src/vs/workbench/services/workspace/node/workspaceEditingService.ts
...kbench/services/workspace/node/workspaceEditingService.ts
+15
-8
src/vs/workbench/test/workbenchTestServices.ts
src/vs/workbench/test/workbenchTestServices.ts
+5
-5
未找到文件。
src/vs/code/electron-main/windows.ts
浏览文件 @
bb2d2a0b
...
...
@@ -19,7 +19,7 @@ import { IPathWithLineAndColumn, parseLineAndColumnAware } from 'vs/code/node/pa
import
{
ILifecycleService
,
UnloadReason
,
IWindowUnloadEvent
}
from
'
vs/platform/lifecycle/electron-main/lifecycleMain
'
;
import
{
IConfigurationService
}
from
'
vs/platform/configuration/common/configuration
'
;
import
{
ILogService
}
from
'
vs/platform/log/common/log
'
;
import
{
IWindowSettings
,
OpenContext
,
IPath
,
IWindowConfiguration
,
INativeOpenDialogOptions
,
ReadyState
,
IPathsToWaitFor
}
from
'
vs/platform/windows/common/windows
'
;
import
{
IWindowSettings
,
OpenContext
,
IPath
,
IWindowConfiguration
,
INativeOpenDialogOptions
,
ReadyState
,
IPathsToWaitFor
,
IEnterWorkspaceResult
}
from
'
vs/platform/windows/common/windows
'
;
import
{
getLastActiveWindow
,
findBestWindowOrFolderForFile
,
findWindowOnWorkspace
,
findWindowOnExtensionDevelopmentPath
,
findWindowOnWorkspaceOrFolderPath
}
from
'
vs/code/node/windowsFinder
'
;
import
CommonEvent
,
{
Emitter
}
from
'
vs/base/common/event
'
;
import
product
from
'
vs/platform/node/product
'
;
...
...
@@ -1294,23 +1294,23 @@ export class WindowsManager implements IWindowsMainService {
});
}
public
saveAndEnterWorkspace
(
win
:
CodeWindow
,
path
:
string
):
TPromise
<
I
WorkspaceIdentifier
>
{
return
this
.
workspacesManager
.
saveAndEnterWorkspace
(
win
,
path
).
then
(
workspace
=>
this
.
doEnterWorkspace
(
win
,
workspace
));
public
saveAndEnterWorkspace
(
win
:
CodeWindow
,
path
:
string
):
TPromise
<
I
EnterWorkspaceResult
>
{
return
this
.
workspacesManager
.
saveAndEnterWorkspace
(
win
,
path
).
then
(
result
=>
this
.
doEnterWorkspace
(
win
,
result
));
}
public
createAndEnterWorkspace
(
win
:
CodeWindow
,
folders
?:
string
[],
path
?:
string
):
TPromise
<
I
WorkspaceIdentifier
>
{
return
this
.
workspacesManager
.
createAndEnterWorkspace
(
win
,
folders
,
path
).
then
(
workspace
=>
this
.
doEnterWorkspace
(
win
,
workspace
));
public
createAndEnterWorkspace
(
win
:
CodeWindow
,
folders
?:
string
[],
path
?:
string
):
TPromise
<
I
EnterWorkspaceResult
>
{
return
this
.
workspacesManager
.
createAndEnterWorkspace
(
win
,
folders
,
path
).
then
(
result
=>
this
.
doEnterWorkspace
(
win
,
result
));
}
private
doEnterWorkspace
(
win
:
CodeWindow
,
workspace
:
IWorkspaceIdentifier
):
IWorkspaceIdentifier
{
private
doEnterWorkspace
(
win
:
CodeWindow
,
result
:
IEnterWorkspaceResult
):
IEnterWorkspaceResult
{
// Mark as recently opened
this
.
historyService
.
addRecentlyOpened
([
workspace
],
[]);
this
.
historyService
.
addRecentlyOpened
([
result
.
workspace
],
[]);
// Trigger Eevent to indicate load of workspace into window
this
.
_onWindowReady
.
fire
(
win
);
return
workspace
;
return
result
;
}
public
openWorkspace
(
win
?:
CodeWindow
):
void
{
...
...
@@ -1648,7 +1648,7 @@ class WorkspacesManager {
)
{
}
public
saveAndEnterWorkspace
(
window
:
CodeWindow
,
path
:
string
):
TPromise
<
I
WorkspaceIdentifier
>
{
public
saveAndEnterWorkspace
(
window
:
CodeWindow
,
path
:
string
):
TPromise
<
I
EnterWorkspaceResult
>
{
if
(
!
window
||
!
window
.
win
||
window
.
readyState
!==
ReadyState
.
READY
||
!
window
.
openedWorkspace
||
!
path
||
!
this
.
isValidTargetWorkspacePath
(
window
,
path
))
{
return
TPromise
.
as
(
null
);
// return early if the window is not ready or disposed or does not have a workspace
}
...
...
@@ -1656,7 +1656,7 @@ class WorkspacesManager {
return
this
.
doSaveAndOpenWorkspace
(
window
,
window
.
openedWorkspace
,
path
);
}
public
createAndEnterWorkspace
(
window
:
CodeWindow
,
folders
?:
string
[],
path
?:
string
):
TPromise
<
I
WorkspaceIdentifier
>
{
public
createAndEnterWorkspace
(
window
:
CodeWindow
,
folders
?:
string
[],
path
?:
string
):
TPromise
<
I
EnterWorkspaceResult
>
{
if
(
!
window
||
!
window
.
win
||
window
.
readyState
!==
ReadyState
.
READY
||
!
this
.
isValidTargetWorkspacePath
(
window
,
path
))
{
return
TPromise
.
as
(
null
);
// return early if the window is not ready or disposed
}
...
...
@@ -1699,7 +1699,7 @@ class WorkspacesManager {
return
true
;
// OK
}
private
doSaveAndOpenWorkspace
(
window
:
CodeWindow
,
workspace
:
IWorkspaceIdentifier
,
path
?:
string
):
TPromise
<
I
WorkspaceIdentifier
>
{
private
doSaveAndOpenWorkspace
(
window
:
CodeWindow
,
workspace
:
IWorkspaceIdentifier
,
path
?:
string
):
TPromise
<
I
EnterWorkspaceResult
>
{
let
savePromise
:
TPromise
<
IWorkspaceIdentifier
>
;
if
(
path
)
{
savePromise
=
this
.
workspacesService
.
saveWorkspace
(
workspace
,
path
);
...
...
@@ -1721,7 +1721,7 @@ class WorkspacesManager {
window
.
config
.
workspace
=
workspace
;
window
.
config
.
backupPath
=
backupPath
;
return
workspace
;
return
{
workspace
,
backupPath
}
;
});
}
...
...
src/vs/platform/windows/common/windows.ts
浏览文件 @
bb2d2a0b
...
...
@@ -27,6 +27,11 @@ export interface INativeOpenDialogOptions {
telemetryExtraData
?:
ITelemetryData
;
}
export
interface
IEnterWorkspaceResult
{
workspace
:
IWorkspaceIdentifier
;
backupPath
:
string
;
}
export
interface
IWindowsService
{
_serviceBrand
:
any
;
...
...
@@ -43,8 +48,8 @@ export interface IWindowsService {
toggleDevTools
(
windowId
:
number
):
TPromise
<
void
>
;
closeWorkspace
(
windowId
:
number
):
TPromise
<
void
>
;
openWorkspace
(
windowId
:
number
):
TPromise
<
void
>
;
createAndEnterWorkspace
(
windowId
:
number
,
folders
?:
string
[],
path
?:
string
):
TPromise
<
I
WorkspaceIdentifier
>
;
saveAndEnterWorkspace
(
windowId
:
number
,
path
:
string
):
TPromise
<
I
WorkspaceIdentifier
>
;
createAndEnterWorkspace
(
windowId
:
number
,
folders
?:
string
[],
path
?:
string
):
TPromise
<
I
EnterWorkspaceResult
>
;
saveAndEnterWorkspace
(
windowId
:
number
,
path
:
string
):
TPromise
<
I
EnterWorkspaceResult
>
;
toggleFullScreen
(
windowId
:
number
):
TPromise
<
void
>
;
setRepresentedFilename
(
windowId
:
number
,
fileName
:
string
):
TPromise
<
void
>
;
addRecentlyOpened
(
files
:
string
[]):
TPromise
<
void
>
;
...
...
@@ -111,8 +116,8 @@ export interface IWindowService {
closeWorkspace
():
TPromise
<
void
>
;
openWorkspace
():
TPromise
<
void
>
;
updateTouchBar
(
items
:
ICommandAction
[][]):
TPromise
<
void
>
;
createAndEnterWorkspace
(
folders
?:
string
[],
path
?:
string
):
TPromise
<
I
WorkspaceIdentifier
>
;
saveAndEnterWorkspace
(
path
:
string
):
TPromise
<
I
WorkspaceIdentifier
>
;
createAndEnterWorkspace
(
folders
?:
string
[],
path
?:
string
):
TPromise
<
I
EnterWorkspaceResult
>
;
saveAndEnterWorkspace
(
path
:
string
):
TPromise
<
I
EnterWorkspaceResult
>
;
toggleFullScreen
():
TPromise
<
void
>
;
setRepresentedFilename
(
fileName
:
string
):
TPromise
<
void
>
;
getRecentlyOpened
():
TPromise
<
IRecentlyOpened
>
;
...
...
src/vs/platform/windows/common/windowsIpc.ts
浏览文件 @
bb2d2a0b
...
...
@@ -8,7 +8,7 @@
import
{
TPromise
}
from
'
vs/base/common/winjs.base
'
;
import
Event
,
{
buffer
}
from
'
vs/base/common/event
'
;
import
{
IChannel
,
eventToCall
,
eventFromCall
}
from
'
vs/base/parts/ipc/common/ipc
'
;
import
{
IWindowsService
,
INativeOpenDialogOptions
}
from
'
./windows
'
;
import
{
IWindowsService
,
INativeOpenDialogOptions
,
IEnterWorkspaceResult
}
from
'
./windows
'
;
import
{
IWorkspaceIdentifier
,
ISingleFolderWorkspaceIdentifier
}
from
'
vs/platform/workspaces/common/workspaces
'
;
import
{
IRecentlyOpened
}
from
'
vs/platform/history/common/history
'
;
import
{
ICommandAction
}
from
'
vs/platform/actions/common/actions
'
;
...
...
@@ -24,8 +24,8 @@ export interface IWindowsChannel extends IChannel {
call
(
command
:
'
toggleDevTools
'
,
arg
:
number
):
TPromise
<
void
>
;
call
(
command
:
'
closeWorkspace
'
,
arg
:
number
):
TPromise
<
void
>
;
call
(
command
:
'
openWorkspace
'
,
arg
:
number
):
TPromise
<
void
>
;
call
(
command
:
'
createAndEnterWorkspace
'
,
arg
:
[
number
,
string
[],
string
]):
TPromise
<
I
WorkspaceIdentifier
>
;
call
(
command
:
'
saveAndEnterWorkspace
'
,
arg
:
[
number
,
string
]):
TPromise
<
I
WorkspaceIdentifier
>
;
call
(
command
:
'
createAndEnterWorkspace
'
,
arg
:
[
number
,
string
[],
string
]):
TPromise
<
I
EnterWorkspaceResult
>
;
call
(
command
:
'
saveAndEnterWorkspace
'
,
arg
:
[
number
,
string
]):
TPromise
<
I
EnterWorkspaceResult
>
;
call
(
command
:
'
toggleFullScreen
'
,
arg
:
number
):
TPromise
<
void
>
;
call
(
command
:
'
setRepresentedFilename
'
,
arg
:
[
number
,
string
]):
TPromise
<
void
>
;
call
(
command
:
'
addRecentlyOpened
'
,
arg
:
string
[]):
TPromise
<
void
>
;
...
...
@@ -174,11 +174,11 @@ export class WindowsChannelClient implements IWindowsService {
return
this
.
channel
.
call
(
'
openWorkspace
'
,
windowId
);
}
createAndEnterWorkspace
(
windowId
:
number
,
folders
?:
string
[],
path
?:
string
):
TPromise
<
I
WorkspaceIdentifier
>
{
createAndEnterWorkspace
(
windowId
:
number
,
folders
?:
string
[],
path
?:
string
):
TPromise
<
I
EnterWorkspaceResult
>
{
return
this
.
channel
.
call
(
'
createAndEnterWorkspace
'
,
[
windowId
,
folders
,
path
]);
}
saveAndEnterWorkspace
(
windowId
:
number
,
path
:
string
):
TPromise
<
I
WorkspaceIdentifier
>
{
saveAndEnterWorkspace
(
windowId
:
number
,
path
:
string
):
TPromise
<
I
EnterWorkspaceResult
>
{
return
this
.
channel
.
call
(
'
saveAndEnterWorkspace
'
,
[
windowId
,
path
]);
}
...
...
src/vs/platform/windows/electron-browser/windowService.ts
浏览文件 @
bb2d2a0b
...
...
@@ -7,11 +7,10 @@
import
Event
,
{
filterEvent
,
mapEvent
,
any
}
from
'
vs/base/common/event
'
;
import
{
TPromise
}
from
'
vs/base/common/winjs.base
'
;
import
{
IWindowService
,
IWindowsService
,
INativeOpenDialogOptions
}
from
'
vs/platform/windows/common/windows
'
;
import
{
IWindowService
,
IWindowsService
,
INativeOpenDialogOptions
,
IEnterWorkspaceResult
}
from
'
vs/platform/windows/common/windows
'
;
import
{
remote
}
from
'
electron
'
;
import
{
IRecentlyOpened
}
from
'
vs/platform/history/common/history
'
;
import
{
ICommandAction
}
from
'
vs/platform/actions/common/actions
'
;
import
{
IWorkspaceIdentifier
}
from
'
vs/platform/workspaces/common/workspaces
'
;
export
class
WindowService
implements
IWindowService
{
...
...
@@ -70,11 +69,11 @@ export class WindowService implements IWindowService {
return
this
.
windowsService
.
openWorkspace
(
this
.
windowId
);
}
createAndEnterWorkspace
(
folders
?:
string
[],
path
?:
string
):
TPromise
<
I
WorkspaceIdentifier
>
{
createAndEnterWorkspace
(
folders
?:
string
[],
path
?:
string
):
TPromise
<
I
EnterWorkspaceResult
>
{
return
this
.
windowsService
.
createAndEnterWorkspace
(
this
.
windowId
,
folders
,
path
);
}
saveAndEnterWorkspace
(
path
:
string
):
TPromise
<
I
WorkspaceIdentifier
>
{
saveAndEnterWorkspace
(
path
:
string
):
TPromise
<
I
EnterWorkspaceResult
>
{
return
this
.
windowsService
.
saveAndEnterWorkspace
(
this
.
windowId
,
path
);
}
...
...
src/vs/platform/windows/electron-main/windows.ts
浏览文件 @
bb2d2a0b
...
...
@@ -6,7 +6,7 @@
'
use strict
'
;
import
{
TPromise
}
from
'
vs/base/common/winjs.base
'
;
import
{
OpenContext
,
IWindowConfiguration
,
ReadyState
,
INativeOpenDialogOptions
}
from
'
vs/platform/windows/common/windows
'
;
import
{
OpenContext
,
IWindowConfiguration
,
ReadyState
,
INativeOpenDialogOptions
,
IEnterWorkspaceResult
}
from
'
vs/platform/windows/common/windows
'
;
import
{
ParsedArgs
}
from
'
vs/platform/environment/common/environment
'
;
import
Event
from
'
vs/base/common/event
'
;
import
{
createDecorator
}
from
'
vs/platform/instantiation/common/instantiation
'
;
...
...
@@ -61,8 +61,8 @@ export interface IWindowsMainService {
ready
(
initialUserEnv
:
IProcessEnvironment
):
void
;
reload
(
win
:
ICodeWindow
,
cli
?:
ParsedArgs
):
void
;
openWorkspace
(
win
?:
ICodeWindow
):
void
;
createAndEnterWorkspace
(
win
:
ICodeWindow
,
folders
?:
string
[],
path
?:
string
):
TPromise
<
I
WorkspaceIdentifier
>
;
saveAndEnterWorkspace
(
win
:
ICodeWindow
,
path
:
string
):
TPromise
<
I
WorkspaceIdentifier
>
;
createAndEnterWorkspace
(
win
:
ICodeWindow
,
folders
?:
string
[],
path
?:
string
):
TPromise
<
I
EnterWorkspaceResult
>
;
saveAndEnterWorkspace
(
win
:
ICodeWindow
,
path
:
string
):
TPromise
<
I
EnterWorkspaceResult
>
;
closeWorkspace
(
win
:
ICodeWindow
):
void
;
open
(
openConfig
:
IOpenConfiguration
):
ICodeWindow
[];
openExtensionDevelopmentHostWindow
(
openConfig
:
IOpenConfiguration
):
void
;
...
...
src/vs/platform/windows/electron-main/windowsService.ts
浏览文件 @
bb2d2a0b
...
...
@@ -9,7 +9,7 @@ import { TPromise } from 'vs/base/common/winjs.base';
import
{
IDisposable
,
dispose
}
from
'
vs/base/common/lifecycle
'
;
import
{
assign
}
from
'
vs/base/common/objects
'
;
import
URI
from
'
vs/base/common/uri
'
;
import
{
IWindowsService
,
OpenContext
,
INativeOpenDialogOptions
}
from
'
vs/platform/windows/common/windows
'
;
import
{
IWindowsService
,
OpenContext
,
INativeOpenDialogOptions
,
IEnterWorkspaceResult
}
from
'
vs/platform/windows/common/windows
'
;
import
{
IEnvironmentService
}
from
'
vs/platform/environment/common/environment
'
;
import
{
shell
,
crashReporter
,
app
,
Menu
}
from
'
electron
'
;
import
Event
,
{
chain
}
from
'
vs/base/common/event
'
;
...
...
@@ -135,7 +135,7 @@ export class WindowsService implements IWindowsService, IDisposable {
return
TPromise
.
as
(
null
);
}
createAndEnterWorkspace
(
windowId
:
number
,
folders
?:
string
[],
path
?:
string
):
TPromise
<
I
WorkspaceIdentifier
>
{
createAndEnterWorkspace
(
windowId
:
number
,
folders
?:
string
[],
path
?:
string
):
TPromise
<
I
EnterWorkspaceResult
>
{
const
codeWindow
=
this
.
windowsMainService
.
getWindowById
(
windowId
);
if
(
codeWindow
)
{
...
...
@@ -145,7 +145,7 @@ export class WindowsService implements IWindowsService, IDisposable {
return
TPromise
.
as
(
null
);
}
saveAndEnterWorkspace
(
windowId
:
number
,
path
:
string
):
TPromise
<
I
WorkspaceIdentifier
>
{
saveAndEnterWorkspace
(
windowId
:
number
,
path
:
string
):
TPromise
<
I
EnterWorkspaceResult
>
{
const
codeWindow
=
this
.
windowsMainService
.
getWindowById
(
windowId
);
if
(
codeWindow
)
{
...
...
src/vs/workbench/services/backup/node/backupFileService.ts
浏览文件 @
bb2d2a0b
...
...
@@ -87,20 +87,29 @@ export class BackupFilesModel implements IBackupFilesModel {
export
class
BackupFileService
implements
IBackupFileService
{
private
static
readonly
META_MARKER
=
'
\n
'
;
public
_serviceBrand
:
any
;
private
static
readonly
META_MARKER
=
'
\n
'
;
private
backupWorkspacePath
:
string
;
private
isShuttingDown
:
boolean
;
private
ready
:
TPromise
<
IBackupFilesModel
>
;
private
ioOperationQueues
:
ResourceQueue
<
void
>
;
// queue IO operations to ensure write order
constructor
(
private
backupWorkspacePath
:
string
,
backupWorkspacePath
:
string
,
@
IFileService
private
fileService
:
IFileService
)
{
this
.
isShuttingDown
=
false
;
this
.
ioOperationQueues
=
new
ResourceQueue
<
void
>
();
this
.
initialize
(
backupWorkspacePath
);
}
public
initialize
(
backupWorkspacePath
:
string
):
void
{
this
.
backupWorkspacePath
=
backupWorkspacePath
;
this
.
ready
=
this
.
init
();
}
...
...
src/vs/workbench/services/workspace/node/workspaceEditingService.ts
浏览文件 @
bb2d2a0b
...
...
@@ -9,7 +9,7 @@ import { IWorkspaceEditingService } from 'vs/workbench/services/workspace/common
import
URI
from
'
vs/base/common/uri
'
;
import
{
TPromise
}
from
'
vs/base/common/winjs.base
'
;
import
{
IWorkspaceContextService
,
WorkbenchState
}
from
'
vs/platform/workspace/common/workspace
'
;
import
{
IWindowsService
,
IWindowService
}
from
'
vs/platform/windows/common/windows
'
;
import
{
IWindowsService
,
IWindowService
,
IEnterWorkspaceResult
}
from
'
vs/platform/windows/common/windows
'
;
import
{
IEnvironmentService
}
from
'
vs/platform/environment/common/environment
'
;
import
{
IJSONEditingService
}
from
'
vs/workbench/services/configuration/common/jsonEditing
'
;
import
{
IWorkspacesService
,
IStoredWorkspaceFolder
,
IWorkspaceIdentifier
}
from
'
vs/platform/workspaces/common/workspaces
'
;
...
...
@@ -24,6 +24,8 @@ import { StorageService } from 'vs/platform/storage/common/storageService';
import
{
ConfigurationScope
,
IConfigurationRegistry
,
Extensions
as
ConfigurationExtensions
}
from
'
vs/platform/configuration/common/configurationRegistry
'
;
import
{
Registry
}
from
'
vs/platform/registry/common/platform
'
;
import
{
IExtensionService
}
from
'
vs/platform/extensions/common/extensions
'
;
import
{
IBackupFileService
}
from
'
vs/workbench/services/backup/common/backup
'
;
import
{
BackupFileService
}
from
'
vs/workbench/services/backup/node/backupFileService
'
;
export
class
WorkspaceEditingService
implements
IWorkspaceEditingService
{
...
...
@@ -38,7 +40,8 @@ export class WorkspaceEditingService implements IWorkspaceEditingService {
@
IWorkspacesService
private
workspacesService
:
IWorkspacesService
,
@
IWorkspaceConfigurationService
private
workspaceConfigurationService
:
IWorkspaceConfigurationService
,
@
IStorageService
private
storageService
:
IStorageService
,
@
IExtensionService
private
extensionService
:
IExtensionService
@
IExtensionService
private
extensionService
:
IExtensionService
,
@
IBackupFileService
private
backupFileService
:
IBackupFileService
)
{
}
...
...
@@ -133,21 +136,25 @@ export class WorkspaceEditingService implements IWorkspaceEditingService {
return
this
.
doEnterWorkspace
(()
=>
this
.
windowService
.
saveAndEnterWorkspace
(
path
));
}
private
doEnterWorkspace
(
mainSidePromise
:
()
=>
TPromise
<
I
WorkspaceIdentifier
>
):
TPromise
<
void
>
{
private
doEnterWorkspace
(
mainSidePromise
:
()
=>
TPromise
<
I
EnterWorkspaceResult
>
):
TPromise
<
void
>
{
// Stop the extension host first to give extensions most time to shutdown
this
.
extensionService
.
stopExtensionHost
();
return
mainSidePromise
().
then
(
workspace
=>
{
return
mainSidePromise
().
then
(
result
=>
{
let
enterWorkspacePromise
:
TPromise
<
void
>
=
TPromise
.
as
(
void
0
);
if
(
workspace
)
{
if
(
result
)
{
// Migrate storage and settings
enterWorkspacePromise
=
this
.
migrate
(
workspace
).
then
(()
=>
{
enterWorkspacePromise
=
this
.
migrate
(
result
.
workspace
).
then
(()
=>
{
// Initialize configuration service
// Reinitialize backup service
const
backupFileService
=
this
.
backupFileService
as
BackupFileService
;
// TODO@Ben ugly cast
backupFileService
.
initialize
(
result
.
backupPath
);
// Reinitialize configuration service
const
workspaceImpl
=
this
.
contextService
as
WorkspaceService
;
// TODO@Ben TODO@Sandeep ugly cast
return
workspaceImpl
.
initialize
(
workspace
);
return
workspaceImpl
.
initialize
(
result
.
workspace
);
});
}
...
...
src/vs/workbench/test/workbenchTestServices.ts
浏览文件 @
bb2d2a0b
...
...
@@ -46,7 +46,7 @@ import { IWorkbenchEditorService } from 'vs/workbench/services/editor/common/edi
import
{
IHistoryService
}
from
'
vs/workbench/services/history/common/history
'
;
import
{
IInstantiationService
,
ServicesAccessor
}
from
'
vs/platform/instantiation/common/instantiation
'
;
import
{
TestConfigurationService
}
from
'
vs/platform/configuration/test/common/testConfigurationService
'
;
import
{
IWindowsService
,
IWindowService
,
INativeOpenDialogOptions
}
from
'
vs/platform/windows/common/windows
'
;
import
{
IWindowsService
,
IWindowService
,
INativeOpenDialogOptions
,
IEnterWorkspaceResult
}
from
'
vs/platform/windows/common/windows
'
;
import
{
TestWorkspace
}
from
'
vs/platform/workspace/test/common/testWorkspace
'
;
import
{
RawTextSource
,
IRawTextSource
}
from
'
vs/editor/common/model/textSource
'
;
import
{
IEnvironmentService
}
from
'
vs/platform/environment/common/environment
'
;
...
...
@@ -903,11 +903,11 @@ export class TestWindowService implements IWindowService {
return
TPromise
.
as
(
void
0
);
}
createAndEnterWorkspace
(
folders
?:
string
[],
path
?:
string
):
TPromise
<
I
WorkspaceIdentifier
>
{
createAndEnterWorkspace
(
folders
?:
string
[],
path
?:
string
):
TPromise
<
I
EnterWorkspaceResult
>
{
return
TPromise
.
as
(
void
0
);
}
saveAndEnterWorkspace
(
path
:
string
):
TPromise
<
I
WorkspaceIdentifier
>
{
saveAndEnterWorkspace
(
path
:
string
):
TPromise
<
I
EnterWorkspaceResult
>
{
return
TPromise
.
as
(
void
0
);
}
...
...
@@ -1051,11 +1051,11 @@ export class TestWindowsService implements IWindowsService {
return
TPromise
.
as
(
void
0
);
}
createAndEnterWorkspace
(
windowId
:
number
,
folders
?:
string
[],
path
?:
string
):
TPromise
<
I
WorkspaceIdentifier
>
{
createAndEnterWorkspace
(
windowId
:
number
,
folders
?:
string
[],
path
?:
string
):
TPromise
<
I
EnterWorkspaceResult
>
{
return
TPromise
.
as
(
void
0
);
}
saveAndEnterWorkspace
(
windowId
:
number
,
path
:
string
):
TPromise
<
I
WorkspaceIdentifier
>
{
saveAndEnterWorkspace
(
windowId
:
number
,
path
:
string
):
TPromise
<
I
EnterWorkspaceResult
>
{
return
TPromise
.
as
(
void
0
);
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录