Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
475cb9ea
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 搜索 >>
提交
475cb9ea
编写于
1月 26, 2019
作者:
M
Martin Aeschlimann
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
revive IWorkspaceIdentifier
上级
b5b21ead
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
28 addition
and
9 deletion
+28
-9
src/vs/platform/windows/node/windowsIpc.ts
src/vs/platform/windows/node/windowsIpc.ts
+17
-5
src/vs/platform/workspaces/common/workspaces.ts
src/vs/platform/workspaces/common/workspaces.ts
+5
-1
src/vs/platform/workspaces/node/workspacesIpc.ts
src/vs/platform/workspaces/node/workspacesIpc.ts
+2
-2
src/vs/workbench/electron-browser/main.ts
src/vs/workbench/electron-browser/main.ts
+4
-1
未找到文件。
src/vs/platform/windows/node/windowsIpc.ts
浏览文件 @
475cb9ea
...
...
@@ -6,7 +6,7 @@
import
{
Event
}
from
'
vs/base/common/event
'
;
import
{
IChannel
,
IServerChannel
}
from
'
vs/base/parts/ipc/node/ipc
'
;
import
{
IWindowsService
,
INativeOpenDialogOptions
,
IEnterWorkspaceResult
,
CrashReporterStartOptions
,
IMessageBoxResult
,
MessageBoxOptions
,
SaveDialogOptions
,
OpenDialogOptions
,
IDevToolsOptions
,
INewWindowOptions
}
from
'
vs/platform/windows/common/windows
'
;
import
{
IWorkspaceIdentifier
,
ISingleFolderWorkspaceIdentifier
,
isWorkspaceIdentifier
}
from
'
vs/platform/workspaces/common/workspaces
'
;
import
{
IWorkspaceIdentifier
,
ISingleFolderWorkspaceIdentifier
,
isWorkspaceIdentifier
,
reviveWorkspaceIdentifier
}
from
'
vs/platform/workspaces/common/workspaces
'
;
import
{
IRecentlyOpened
}
from
'
vs/platform/history/common/history
'
;
import
{
ISerializableCommandAction
}
from
'
vs/platform/actions/common/actions
'
;
import
{
URI
}
from
'
vs/base/common/uri
'
;
...
...
@@ -63,7 +63,7 @@ export class WindowsChannel implements IServerChannel {
case
'
removeFromRecentlyOpened
'
:
{
let
paths
:
Array
<
IWorkspaceIdentifier
|
ISingleFolderWorkspaceIdentifier
|
URI
|
string
>
=
arg
;
if
(
Array
.
isArray
(
paths
))
{
paths
=
paths
.
map
(
path
=>
isWorkspaceIdentifier
(
path
)
||
typeof
path
===
'
string
'
?
path
:
URI
.
revive
(
path
));
paths
=
paths
.
map
(
path
=>
isWorkspaceIdentifier
(
path
)
?
reviveWorkspaceIdentifier
(
path
)
:
typeof
path
===
'
string
'
?
path
:
URI
.
revive
(
path
));
}
return
this
.
service
.
removeFromRecentlyOpened
(
paths
);
}
...
...
@@ -165,7 +165,9 @@ export class WindowsChannelClient implements IWindowsService {
}
enterWorkspace
(
windowId
:
number
,
path
:
URI
):
Promise
<
IEnterWorkspaceResult
>
{
return
this
.
channel
.
call
(
'
enterWorkspace
'
,
[
windowId
,
path
]);
return
this
.
channel
.
call
(
'
enterWorkspace
'
,
[
windowId
,
path
]).
then
((
result
:
IEnterWorkspaceResult
)
=>
{
return
{
backupPath
:
result
.
backupPath
,
workspace
:
reviveWorkspaceIdentifier
(
result
.
workspace
)
};
});
}
toggleFullScreen
(
windowId
:
number
):
Promise
<
void
>
{
...
...
@@ -191,7 +193,7 @@ export class WindowsChannelClient implements IWindowsService {
getRecentlyOpened
(
windowId
:
number
):
Promise
<
IRecentlyOpened
>
{
return
this
.
channel
.
call
(
'
getRecentlyOpened
'
,
windowId
)
.
then
((
recentlyOpened
:
IRecentlyOpened
)
=>
{
recentlyOpened
.
workspaces
=
recentlyOpened
.
workspaces
.
map
(
workspace
=>
isWorkspaceIdentifier
(
workspace
)
?
workspace
:
URI
.
revive
(
workspace
));
recentlyOpened
.
workspaces
=
recentlyOpened
.
workspaces
.
map
(
workspace
=>
isWorkspaceIdentifier
(
workspace
)
?
reviveWorkspaceIdentifier
(
workspace
)
:
URI
.
revive
(
workspace
));
recentlyOpened
.
files
=
recentlyOpened
.
files
.
map
(
URI
.
revive
);
return
recentlyOpened
;
});
...
...
@@ -286,7 +288,17 @@ export class WindowsChannelClient implements IWindowsService {
}
getWindows
():
Promise
<
{
id
:
number
;
workspace
?:
IWorkspaceIdentifier
;
folderUri
?:
ISingleFolderWorkspaceIdentifier
;
title
:
string
;
filename
?:
string
;
}[]
>
{
return
this
.
channel
.
call
<
{
id
:
number
;
workspace
?:
IWorkspaceIdentifier
;
folderUri
?:
ISingleFolderWorkspaceIdentifier
;
title
:
string
;
filename
?:
string
;
}[]
>
(
'
getWindows
'
).
then
(
result
=>
{
result
.
forEach
(
win
=>
win
.
folderUri
=
win
.
folderUri
?
URI
.
revive
(
win
.
folderUri
)
:
win
.
folderUri
);
return
result
;
});
return
this
.
channel
.
call
<
{
id
:
number
;
workspace
?:
IWorkspaceIdentifier
;
folderUri
?:
ISingleFolderWorkspaceIdentifier
;
title
:
string
;
filename
?:
string
;
}[]
>
(
'
getWindows
'
).
then
(
result
=>
{
for
(
const
win
of
result
)
{
if
(
win
.
folderUri
)
{
win
.
folderUri
=
URI
.
revive
(
win
.
folderUri
);
}
if
(
win
.
workspace
)
{
win
.
workspace
=
reviveWorkspaceIdentifier
(
win
.
workspace
);
}
}
return
result
;
});
}
getWindowCount
():
Promise
<
number
>
{
...
...
src/vs/platform/workspaces/common/workspaces.ts
浏览文件 @
475cb9ea
...
...
@@ -7,7 +7,7 @@ import { createDecorator } from 'vs/platform/instantiation/common/instantiation'
import
{
localize
}
from
'
vs/nls
'
;
import
{
Event
}
from
'
vs/base/common/event
'
;
import
{
IWorkspaceFolder
,
IWorkspace
}
from
'
vs/platform/workspace/common/workspace
'
;
import
{
URI
}
from
'
vs/base/common/uri
'
;
import
{
URI
,
UriComponents
}
from
'
vs/base/common/uri
'
;
export
const
IWorkspacesMainService
=
createDecorator
<
IWorkspacesMainService
>
(
'
workspacesMainService
'
);
export
const
IWorkspacesService
=
createDecorator
<
IWorkspacesService
>
(
'
workspacesService
'
);
...
...
@@ -26,6 +26,10 @@ export interface IWorkspaceIdentifier {
configPath
:
URI
;
}
export
function
reviveWorkspaceIdentifier
(
workspace
:
{
id
:
string
,
configPath
:
UriComponents
;
})
{
return
{
id
:
workspace
.
id
,
configPath
:
URI
.
revive
(
workspace
.
configPath
)
};
}
export
function
isStoredWorkspaceFolder
(
thing
:
any
):
thing
is
IStoredWorkspaceFolder
{
return
isRawFileWorkspaceFolder
(
thing
)
||
isRawUriWorkspaceFolder
(
thing
);
}
...
...
src/vs/platform/workspaces/node/workspacesIpc.ts
浏览文件 @
475cb9ea
...
...
@@ -4,7 +4,7 @@
*--------------------------------------------------------------------------------------------*/
import
{
IChannel
,
IServerChannel
}
from
'
vs/base/parts/ipc/node/ipc
'
;
import
{
IWorkspacesService
,
IWorkspaceIdentifier
,
IWorkspaceFolderCreationData
,
IWorkspacesMainService
}
from
'
vs/platform/workspaces/common/workspaces
'
;
import
{
IWorkspacesService
,
IWorkspaceIdentifier
,
IWorkspaceFolderCreationData
,
IWorkspacesMainService
,
reviveWorkspaceIdentifier
}
from
'
vs/platform/workspaces/common/workspaces
'
;
import
{
URI
}
from
'
vs/base/common/uri
'
;
import
{
Event
}
from
'
vs/base/common/event
'
;
...
...
@@ -45,6 +45,6 @@ export class WorkspacesChannelClient implements IWorkspacesService {
constructor
(
private
channel
:
IChannel
)
{
}
createUntitledWorkspace
(
folders
?:
IWorkspaceFolderCreationData
[]):
Promise
<
IWorkspaceIdentifier
>
{
return
this
.
channel
.
call
(
'
createUntitledWorkspace
'
,
folders
);
return
this
.
channel
.
call
(
'
createUntitledWorkspace
'
,
folders
)
.
then
(
reviveWorkspaceIdentifier
)
;
}
}
src/vs/workbench/electron-browser/main.ts
浏览文件 @
475cb9ea
...
...
@@ -29,7 +29,7 @@ import { IUpdateService } from 'vs/platform/update/common/update';
import
{
URLHandlerChannel
,
URLServiceChannelClient
}
from
'
vs/platform/url/node/urlIpc
'
;
import
{
IURLService
}
from
'
vs/platform/url/common/url
'
;
import
{
WorkspacesChannelClient
}
from
'
vs/platform/workspaces/node/workspacesIpc
'
;
import
{
IWorkspacesService
,
ISingleFolderWorkspaceIdentifier
,
IWorkspaceInitializationPayload
,
IMultiFolderWorkspaceInitializationPayload
,
IEmptyWorkspaceInitializationPayload
,
ISingleFolderWorkspaceInitializationPayload
}
from
'
vs/platform/workspaces/common/workspaces
'
;
import
{
IWorkspacesService
,
ISingleFolderWorkspaceIdentifier
,
IWorkspaceInitializationPayload
,
IMultiFolderWorkspaceInitializationPayload
,
IEmptyWorkspaceInitializationPayload
,
ISingleFolderWorkspaceInitializationPayload
,
reviveWorkspaceIdentifier
}
from
'
vs/platform/workspaces/common/workspaces
'
;
import
{
createSpdLogService
}
from
'
vs/platform/log/node/spdlogService
'
;
import
*
as
fs
from
'
fs
'
;
import
{
ConsoleLogService
,
MultiplexLogService
,
ILogService
}
from
'
vs/platform/log/common/log
'
;
...
...
@@ -87,6 +87,9 @@ function revive(workbench: IWindowConfiguration) {
if
(
workbench
.
folderUri
)
{
workbench
.
folderUri
=
uri
.
revive
(
workbench
.
folderUri
);
}
if
(
workbench
.
workspace
)
{
workbench
.
workspace
=
reviveWorkspaceIdentifier
(
workbench
.
workspace
);
}
const
filesToWaitPaths
=
workbench
.
filesToWait
&&
workbench
.
filesToWait
.
paths
;
[
filesToWaitPaths
,
workbench
.
filesToOpen
,
workbench
.
filesToCreate
,
workbench
.
filesToDiff
].
forEach
(
paths
=>
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录