Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
ccb76ec0
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,发现更多精彩内容 >>
提交
ccb76ec0
编写于
12月 31, 2016
作者:
B
Benjamin Pasero
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
support forceReuseWindow in openWindow API
上级
7610159a
变更
10
隐藏空白更改
内联
并排
Showing
10 changed file
with
16 addition
and
17 deletion
+16
-17
src/vs/platform/windows/common/windows.ts
src/vs/platform/windows/common/windows.ts
+2
-2
src/vs/platform/windows/common/windowsIpc.ts
src/vs/platform/windows/common/windowsIpc.ts
+4
-4
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
+2
-2
src/vs/workbench/electron-browser/window.ts
src/vs/workbench/electron-browser/window.ts
+1
-1
src/vs/workbench/parts/files/electron-browser/electronFileActions.ts
...bench/parts/files/electron-browser/electronFileActions.ts
+1
-1
src/vs/workbench/parts/files/electron-browser/files.electron.contribution.ts
...rts/files/electron-browser/files.electron.contribution.ts
+1
-1
src/vs/workbench/parts/git/electron-browser/gitActions.ts
src/vs/workbench/parts/git/electron-browser/gitActions.ts
+1
-1
src/vs/workbench/parts/snippets/electron-browser/snippets.contribution.ts
.../parts/snippets/electron-browser/snippets.contribution.ts
+1
-1
src/vs/workbench/test/workbenchTestServices.ts
src/vs/workbench/test/workbenchTestServices.ts
+1
-2
未找到文件。
src/vs/platform/windows/common/windows.ts
浏览文件 @
ccb76ec0
...
...
@@ -25,6 +25,7 @@ export interface IWindowsService {
openDevTools
(
windowId
:
number
):
TPromise
<
void
>
;
toggleDevTools
(
windowId
:
number
):
TPromise
<
void
>
;
// TODO@joao: rename, shouldn't this be closeWindow?
// @ben: no, this actually leaves the window open but changes it to have no workspace opened
closeFolder
(
windowId
:
number
):
TPromise
<
void
>
;
toggleFullScreen
(
windowId
:
number
):
TPromise
<
void
>
;
setRepresentedFilename
(
windowId
:
number
,
fileName
:
string
):
TPromise
<
void
>
;
...
...
@@ -40,8 +41,7 @@ export interface IWindowsService {
quit
():
TPromise
<
void
>
;
// Global methods
// TODO@joao: rename, shouldn't this be openWindow?
windowOpen
(
paths
:
string
[],
forceNewWindow
?:
boolean
):
TPromise
<
void
>
;
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
;
}[]
>
;
...
...
src/vs/platform/windows/common/windowsIpc.ts
浏览文件 @
ccb76ec0
...
...
@@ -31,7 +31,7 @@ export interface IWindowsChannel extends IChannel {
call
(
command
:
'
setDocumentEdited
'
,
arg
:
[
number
,
boolean
]):
TPromise
<
void
>
;
call
(
command
:
'
toggleMenuBar
'
,
arg
:
number
):
TPromise
<
void
>
;
call
(
command
:
'
quit
'
):
TPromise
<
void
>
;
call
(
command
:
'
windowOpen
'
,
arg
:
[
string
[],
boolean
]):
TPromise
<
void
>
;
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
;
}[]
>
;
...
...
@@ -76,7 +76,7 @@ export class WindowsChannel implements IWindowsChannel {
case
'
unmaximizeWindow
'
:
return
this
.
service
.
unmaximizeWindow
(
arg
);
case
'
setDocumentEdited
'
:
return
this
.
service
.
setDocumentEdited
(
arg
[
0
],
arg
[
1
]);
case
'
toggleMenuBar
'
:
return
this
.
service
.
toggleMenuBar
(
arg
);
case
'
windowOpen
'
:
return
this
.
service
.
windowOpen
(
arg
[
0
],
arg
[
1
]);
case
'
openWindow
'
:
return
this
.
service
.
openWindow
(
arg
[
0
],
arg
[
1
]);
case
'
openNewWindow
'
:
return
this
.
service
.
openNewWindow
();
case
'
showWindow
'
:
return
this
.
service
.
showWindow
(
arg
);
case
'
getWindows
'
:
return
this
.
service
.
getWindows
();
...
...
@@ -179,8 +179,8 @@ export class WindowsChannelClient implements IWindowsService {
return
this
.
channel
.
call
(
'
quit
'
);
}
windowOpen
(
paths
:
string
[],
forceNewWindow
?:
boolean
):
TPromise
<
void
>
{
return
this
.
channel
.
call
(
'
windowOpen
'
,
[
paths
,
forceNewWindow
]);
openWindow
(
paths
:
string
[],
options
?:
{
forceNewWindow
?:
boolean
,
forceReuseWindow
?:
boolean
}
):
TPromise
<
void
>
{
return
this
.
channel
.
call
(
'
openWindow
'
,
[
paths
,
options
]);
}
openNewWindow
():
TPromise
<
void
>
{
...
...
src/vs/platform/windows/electron-main/windowsService.ts
浏览文件 @
ccb76ec0
...
...
@@ -198,12 +198,12 @@ export class WindowsService implements IWindowsService, IDisposable {
return
TPromise
.
as
(
null
);
}
windowOpen
(
paths
:
string
[],
forceNewWindow
?:
boolean
):
TPromise
<
void
>
{
openWindow
(
paths
:
string
[],
options
?:
{
forceNewWindow
?:
boolean
,
forceReuseWindow
?:
boolean
}
):
TPromise
<
void
>
{
if
(
!
paths
||
!
paths
.
length
)
{
return
TPromise
.
as
(
null
);
}
this
.
windowsMainService
.
open
({
context
:
OpenContext
.
OTHER
,
cli
:
this
.
environmentService
.
args
,
pathsToOpen
:
paths
,
forceNewWindow
});
this
.
windowsMainService
.
open
({
context
:
OpenContext
.
OTHER
,
cli
:
this
.
environmentService
.
args
,
pathsToOpen
:
paths
,
forceNewWindow
:
options
&&
options
.
forceNewWindow
,
forceReuseWindow
:
options
&&
options
.
forceReuseWindow
});
return
TPromise
.
as
(
null
);
}
...
...
src/vs/workbench/electron-browser/actions.ts
浏览文件 @
ccb76ec0
...
...
@@ -588,8 +588,8 @@ export class OpenRecentAction extends Action {
}
const
runPick
=
(
path
:
string
,
context
:
IEntryRunContext
)
=>
{
const
n
ewWindow
=
context
.
keymods
.
indexOf
(
KeyMod
.
CtrlCmd
)
>=
0
;
this
.
windowsService
.
windowOpen
([
path
],
newWindow
);
const
forceN
ewWindow
=
context
.
keymods
.
indexOf
(
KeyMod
.
CtrlCmd
)
>=
0
;
this
.
windowsService
.
openWindow
([
path
],
{
forceNewWindow
}
);
};
const
folderPicks
:
IFilePickOpenEntry
[]
=
recentFolders
.
map
((
p
,
index
)
=>
toPick
(
p
,
index
===
0
?
{
label
:
nls
.
localize
(
'
folders
'
,
"
folders
"
)
}
:
void
0
,
true
));
...
...
src/vs/workbench/electron-browser/window.ts
浏览文件 @
ccb76ec0
...
...
@@ -137,7 +137,7 @@ export class ElectronWindow {
DOM
.
EventHelper
.
stop
(
e
,
true
);
this
.
focus
();
// make sure this window has focus so that the open call reaches the right window!
this
.
windowsService
.
windowOpen
(
draggedExternalResources
.
map
(
r
=>
r
.
fsPath
)
);
this
.
windowsService
.
openWindow
(
draggedExternalResources
.
map
(
r
=>
r
.
fsPath
),
{
forceReuseWindow
:
true
}
);
cleanUp
();
})
...
...
src/vs/workbench/parts/files/electron-browser/electronFileActions.ts
浏览文件 @
ccb76ec0
...
...
@@ -154,7 +154,7 @@ export class ShowOpenedFileInNewWindow extends Action {
public
run
():
TPromise
<
any
>
{
const
fileResource
=
toResource
(
this
.
editorService
.
getActiveEditorInput
(),
{
supportSideBySide
:
true
,
filter
:
'
file
'
});
if
(
fileResource
)
{
this
.
windowsService
.
windowOpen
([
fileResource
.
fsPath
],
true
);
this
.
windowsService
.
openWindow
([
fileResource
.
fsPath
],
{
forceNewWindow
:
true
}
);
}
else
{
this
.
messageService
.
show
(
severity
.
Info
,
nls
.
localize
(
'
openFileToShow
'
,
"
Open a file first to open in new window
"
));
}
...
...
src/vs/workbench/parts/files/electron-browser/files.electron.contribution.ts
浏览文件 @
ccb76ec0
...
...
@@ -92,7 +92,7 @@ CommandsRegistry.registerCommand('_files.openFolderPicker', (accessor: ServicesA
CommandsRegistry
.
registerCommand
(
'
_files.windowOpen
'
,
(
accessor
:
ServicesAccessor
,
paths
:
string
[],
forceNewWindow
:
boolean
)
=>
{
const
windowsService
=
accessor
.
get
(
IWindowsService
);
windowsService
.
windowOpen
(
paths
,
forceNewWindow
);
windowsService
.
openWindow
(
paths
,
{
forceNewWindow
}
);
});
CommandsRegistry
.
registerCommand
(
'
workbench.action.files.openFileInNewWindow
'
,
(
accessor
:
ServicesAccessor
)
=>
{
...
...
src/vs/workbench/parts/git/electron-browser/gitActions.ts
浏览文件 @
ccb76ec0
...
...
@@ -70,7 +70,7 @@ export class CloneAction extends Action {
return
clone
.
then
(
path
=>
{
const
forceNewWindow
=
this
.
workspaceService
.
hasWorkspace
();
return
this
.
windowsService
.
windowOpen
([
path
],
forceNewWindow
);
return
this
.
windowsService
.
openWindow
([
path
],
{
forceNewWindow
,
forceReuseWindow
:
!
forceNewWindow
}
);
}).
then
<
void
>
(
null
,
e
=>
{
if
(
/already exists and is not an empty directory/
.
test
(
e
.
stderr
||
''
))
{
...
...
src/vs/workbench/parts/snippets/electron-browser/snippets.contribution.ts
浏览文件 @
ccb76ec0
...
...
@@ -40,7 +40,7 @@ class OpenSnippetsAction extends actions.Action {
}
private
openFile
(
filePath
:
string
):
winjs
.
TPromise
<
void
>
{
return
this
.
windowsService
.
windowOpen
([
filePath
]
);
return
this
.
windowsService
.
openWindow
([
filePath
],
{
forceReuseWindow
:
true
}
);
}
public
run
():
winjs
.
Promise
{
...
...
src/vs/workbench/test/workbenchTestServices.ts
浏览文件 @
ccb76ec0
...
...
@@ -887,8 +887,7 @@ export class TestWindowsService implements IWindowsService {
}
// Global methods
// TODO@joao: rename, shouldn't this be openWindow?
windowOpen
(
paths
:
string
[],
forceNewWindow
?:
boolean
):
TPromise
<
void
>
{
openWindow
(
paths
:
string
[],
options
?:
{
forceNewWindow
?:
boolean
,
forceReuseWindow
?:
boolean
}):
TPromise
<
void
>
{
return
TPromise
.
as
(
void
0
);
}
openNewWindow
():
TPromise
<
void
>
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录