Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
f5902b5a
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,发现更多精彩内容 >>
提交
f5902b5a
编写于
7月 12, 2017
作者:
B
Benjamin Pasero
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
adopt workspace for getWindows() call
上级
e4b90c2b
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
24 addition
and
13 deletion
+24
-13
src/vs/code/electron-main/app.ts
src/vs/code/electron-main/app.ts
+0
-2
src/vs/code/electron-main/main.ts
src/vs/code/electron-main/main.ts
+3
-0
src/vs/platform/windows/common/windows.ts
src/vs/platform/windows/common/windows.ts
+1
-1
src/vs/platform/windows/common/windowsIpc.ts
src/vs/platform/windows/common/windowsIpc.ts
+2
-2
src/vs/platform/windows/electron-main/windowsService.ts
src/vs/platform/windows/electron-main/windowsService.ts
+2
-2
src/vs/workbench/electron-browser/actions.ts
src/vs/workbench/electron-browser/actions.ts
+15
-5
src/vs/workbench/test/workbenchTestServices.ts
src/vs/workbench/test/workbenchTestServices.ts
+1
-1
未找到文件。
src/vs/code/electron-main/app.ts
浏览文件 @
f5902b5a
...
...
@@ -53,7 +53,6 @@ import { KeyboardLayoutMonitor } from "vs/code/electron-main/keyboard";
import
URI
from
'
vs/base/common/uri
'
;
import
{
WorkspacesChannel
}
from
"
vs/platform/workspaces/common/workspacesIpc
"
;
import
{
IWorkspacesMainService
}
from
"
vs/platform/workspaces/common/workspaces
"
;
import
{
WorkspacesMainService
}
from
"
vs/platform/workspaces/electron-main/workspacesMainService
"
;
export
class
CodeApplication
{
private
toDispose
:
IDisposable
[];
...
...
@@ -290,7 +289,6 @@ export class CodeApplication {
services
.
set
(
IWindowsMainService
,
new
SyncDescriptor
(
WindowsManager
));
services
.
set
(
IWindowsService
,
new
SyncDescriptor
(
WindowsService
,
this
.
sharedProcess
));
services
.
set
(
ILaunchService
,
new
SyncDescriptor
(
LaunchService
));
services
.
set
(
IWorkspacesMainService
,
new
SyncDescriptor
(
WorkspacesMainService
));
// Telemtry
if
(
this
.
environmentService
.
isBuilt
&&
!
this
.
environmentService
.
isExtensionDevelopment
&&
!!
product
.
enableTelemetry
)
{
...
...
src/vs/code/electron-main/main.ts
浏览文件 @
f5902b5a
...
...
@@ -35,12 +35,15 @@ import * as fs from 'original-fs';
import
{
CodeApplication
}
from
"
vs/code/electron-main/app
"
;
import
{
HistoryMainService
}
from
"
vs/platform/history/electron-main/historyMainService
"
;
import
{
IHistoryMainService
}
from
"
vs/platform/history/common/history
"
;
import
{
WorkspacesMainService
}
from
"
vs/platform/workspaces/electron-main/workspacesMainService
"
;
import
{
IWorkspacesMainService
}
from
"
vs/platform/workspaces/common/workspaces
"
;
function
createServices
(
args
:
ParsedArgs
):
IInstantiationService
{
const
services
=
new
ServiceCollection
();
services
.
set
(
IEnvironmentService
,
new
SyncDescriptor
(
EnvironmentService
,
args
,
process
.
execPath
));
services
.
set
(
ILogService
,
new
SyncDescriptor
(
LogMainService
));
services
.
set
(
IWorkspacesMainService
,
new
SyncDescriptor
(
WorkspacesMainService
));
services
.
set
(
IHistoryMainService
,
new
SyncDescriptor
(
HistoryMainService
));
services
.
set
(
ILifecycleService
,
new
SyncDescriptor
(
LifecycleService
));
services
.
set
(
IStorageService
,
new
SyncDescriptor
(
StorageService
));
...
...
src/vs/platform/windows/common/windows.ts
浏览文件 @
f5902b5a
...
...
@@ -56,7 +56,7 @@ export interface IWindowsService {
openWindow
(
paths
:
string
[],
options
?:
{
forceNewWindow
?:
boolean
,
forceReuseWindow
?:
boolean
}):
TPromise
<
void
>
;
openNewWindow
():
TPromise
<
void
>
;
showWindow
(
windowId
:
number
):
TPromise
<
void
>
;
getWindows
():
TPromise
<
{
id
:
number
;
path
:
string
;
title
:
string
;
filename
?:
string
;
}[]
>
;
getWindows
():
TPromise
<
{
id
:
number
;
workspace
?:
IWorkspaceIdentifier
;
folderPath
?
:
string
;
title
:
string
;
filename
?:
string
;
}[]
>
;
getWindowCount
():
TPromise
<
number
>
;
log
(
severity
:
string
,
...
messages
:
string
[]):
TPromise
<
void
>
;
// TODO@joao: what?
...
...
src/vs/platform/windows/common/windowsIpc.ts
浏览文件 @
f5902b5a
...
...
@@ -41,7 +41,7 @@ export interface IWindowsChannel extends IChannel {
call
(
command
:
'
openWindow
'
,
arg
:
[
string
[],
{
forceNewWindow
?:
boolean
,
forceReuseWindow
?:
boolean
}]):
TPromise
<
void
>
;
call
(
command
:
'
openNewWindow
'
):
TPromise
<
void
>
;
call
(
command
:
'
showWindow
'
,
arg
:
number
):
TPromise
<
void
>
;
call
(
command
:
'
getWindows
'
):
TPromise
<
{
id
:
number
;
path
:
string
;
title
:
string
;
}[]
>
;
call
(
command
:
'
getWindows
'
):
TPromise
<
{
id
:
number
;
workspace
?:
IWorkspaceIdentifier
;
folderPath
?:
string
;
title
:
string
;
filename
?
:
string
;
}[]
>
;
call
(
command
:
'
getWindowCount
'
):
TPromise
<
number
>
;
call
(
command
:
'
relaunch
'
,
arg
:
{
addArgs
?:
string
[],
removeArgs
?:
string
[]
}):
TPromise
<
number
>
;
call
(
command
:
'
whenSharedProcessReady
'
):
TPromise
<
void
>
;
...
...
@@ -237,7 +237,7 @@ export class WindowsChannelClient implements IWindowsService {
return
this
.
channel
.
call
(
'
showWindow
'
,
windowId
);
}
getWindows
():
TPromise
<
{
id
:
number
;
path
:
string
;
title
:
string
;
}[]
>
{
getWindows
():
TPromise
<
{
id
:
number
;
workspace
?:
IWorkspaceIdentifier
;
folderPath
?:
string
;
title
:
string
;
filename
?
:
string
;
}[]
>
{
return
this
.
channel
.
call
(
'
getWindows
'
);
}
...
...
src/vs/platform/windows/electron-main/windowsService.ts
浏览文件 @
f5902b5a
...
...
@@ -274,9 +274,9 @@ export class WindowsService implements IWindowsService, IDisposable {
return
TPromise
.
as
(
null
);
}
getWindows
():
TPromise
<
{
id
:
number
;
path
:
string
;
title
:
string
;
}[]
>
{
getWindows
():
TPromise
<
{
id
:
number
;
workspace
?:
IWorkspaceIdentifier
;
folderPath
?:
string
;
title
:
string
;
filename
?
:
string
;
}[]
>
{
const
windows
=
this
.
windowsMainService
.
getWindows
();
const
result
=
windows
.
map
(
w
=>
({
path
:
w
.
openedFolderPath
,
title
:
w
.
win
.
getTitle
(),
id
:
w
.
id
,
filename
:
w
.
getRepresentedFilename
()
}));
const
result
=
windows
.
map
(
w
=>
({
id
:
w
.
id
,
workspace
:
w
.
openedWorkspace
,
openedFolderPath
:
w
.
openedFolderPath
,
title
:
w
.
win
.
getTitle
()
,
filename
:
w
.
getRepresentedFilename
()
}));
return
TPromise
.
as
(
result
);
}
...
...
src/vs/workbench/electron-browser/actions.ts
浏览文件 @
f5902b5a
...
...
@@ -576,11 +576,11 @@ export abstract class BaseSwitchWindow extends Action {
public
run
():
TPromise
<
void
>
{
const
currentWindowId
=
this
.
windowService
.
getCurrentWindowId
();
return
this
.
windowsService
.
getWindows
().
then
(
w
orkspace
s
=>
{
return
this
.
windowsService
.
getWindows
().
then
(
w
indow
s
=>
{
const
placeHolder
=
nls
.
localize
(
'
switchWindowPlaceHolder
'
,
"
Select a window to switch to
"
);
const
picks
=
w
orkspace
s
.
map
(
win
=>
({
resource
:
win
.
filename
?
URI
.
file
(
win
.
filename
)
:
win
.
path
,
isFolder
:
!
win
.
filename
&&
!!
win
.
p
ath
,
const
picks
=
w
indow
s
.
map
(
win
=>
({
resource
:
win
.
filename
?
URI
.
file
(
win
.
filename
)
:
win
.
folderPath
?
URI
.
file
(
win
.
folderPath
)
:
win
.
workspace
?
URI
.
file
(
win
.
workspace
.
configPath
)
:
void
0
,
isFolder
:
!
win
.
workspace
&&
!
win
.
filename
&&
!!
win
.
folderP
ath
,
label
:
win
.
title
,
description
:
(
currentWindowId
===
win
.
id
)
?
nls
.
localize
(
'
current
'
,
"
Current Window
"
)
:
void
0
,
run
:
()
=>
{
...
...
@@ -702,9 +702,19 @@ export abstract class BaseOpenRecentAction extends Action {
const
hasWorkspace
=
this
.
contextService
.
hasWorkspace
();
let
autoFocusFirstEntry
=
!
hasWorkspace
;
let
autoFocusSecondEntry
=
!
autoFocusFirstEntry
;
if
(
workspacePicks
.
length
>
0
&&
folderPicks
.
length
>
0
)
{
// if we show both workspace picks and folder picks, we can no longer make any smart
// auto focus choice because the list is no longer in pure MRU order. In this case
// we simply do not focus any entry.
autoFocusFirstEntry
=
false
;
autoFocusSecondEntry
=
false
;
}
this
.
quickOpenService
.
pick
([...
workspacePicks
,
...
folderPicks
,
...
filePicks
],
{
contextKey
:
inRecentFilesPickerContextKey
,
autoFocus
:
{
autoFocusFirstEntry
:
!
hasWorkspace
,
autoFocusSecondEntry
:
hasWorkspace
},
autoFocus
:
{
autoFocusFirstEntry
,
autoFocusSecondEntry
},
placeHolder
:
isMacintosh
?
nls
.
localize
(
'
openRecentPlaceHolderMac
'
,
"
Select to open (hold Cmd-key to open in new window)
"
)
:
nls
.
localize
(
'
openRecentPlaceHolder
'
,
"
Select to open (hold Ctrl-key to open in new window)
"
),
matchOnDescription
:
true
,
quickNavigateConfiguration
:
this
.
isQuickNavigate
()
?
{
keybindings
:
this
.
keybindingService
.
lookupKeybindings
(
this
.
id
)
}
:
void
0
...
...
src/vs/workbench/test/workbenchTestServices.ts
浏览文件 @
f5902b5a
...
...
@@ -1092,7 +1092,7 @@ export class TestWindowsService implements IWindowsService {
return
TPromise
.
as
(
void
0
);
}
getWindows
():
TPromise
<
{
id
:
number
;
path
:
string
;
title
:
string
;
}[]
>
{
getWindows
():
TPromise
<
{
id
:
number
;
workspace
?:
IWorkspaceIdentifier
;
folderPath
?:
string
;
title
:
string
;
filename
?
:
string
;
}[]
>
{
return
TPromise
.
as
(
void
0
);
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录