Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
掘金者说
vscode
提交
3fa0bdbb
V
vscode
项目概览
掘金者说
/
vscode
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
V
vscode
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
3fa0bdbb
编写于
5月 23, 2018
作者:
B
Benjamin Pasero
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix #49587
上级
8fbfcb1c
变更
13
隐藏空白更改
内联
并排
Showing
13 changed file
with
40 addition
and
28 deletion
+40
-28
src/vs/code/electron-main/windows.ts
src/vs/code/electron-main/windows.ts
+6
-2
src/vs/platform/windows/common/windows.ts
src/vs/platform/windows/common/windows.ts
+2
-1
src/vs/platform/windows/common/windowsIpc.ts
src/vs/platform/windows/common/windowsIpc.ts
+4
-4
src/vs/platform/windows/electron-browser/windowService.ts
src/vs/platform/windows/electron-browser/windowService.ts
+4
-0
src/vs/platform/windows/electron-main/windows.ts
src/vs/platform/windows/electron-main/windows.ts
+1
-0
src/vs/platform/windows/electron-main/windowsService.ts
src/vs/platform/windows/electron-main/windowsService.ts
+2
-1
src/vs/workbench/browser/actions/workspaceActions.ts
src/vs/workbench/browser/actions/workspaceActions.ts
+3
-3
src/vs/workbench/browser/dnd.ts
src/vs/workbench/browser/dnd.ts
+1
-1
src/vs/workbench/electron-browser/actions.ts
src/vs/workbench/electron-browser/actions.ts
+3
-6
src/vs/workbench/parts/files/electron-browser/fileActions.ts
src/vs/workbench/parts/files/electron-browser/fileActions.ts
+3
-3
src/vs/workbench/parts/files/electron-browser/fileCommands.ts
...vs/workbench/parts/files/electron-browser/fileCommands.ts
+4
-3
src/vs/workbench/parts/welcome/page/electron-browser/welcomePage.ts
...kbench/parts/welcome/page/electron-browser/welcomePage.ts
+2
-3
src/vs/workbench/test/workbenchTestServices.ts
src/vs/workbench/test/workbenchTestServices.ts
+5
-1
未找到文件。
src/vs/code/electron-main/windows.ts
浏览文件 @
3fa0bdbb
...
@@ -716,7 +716,11 @@ export class WindowsManager implements IWindowsMainService {
...
@@ -716,7 +716,11 @@ export class WindowsManager implements IWindowsMainService {
return
window
;
return
window
;
}
}
private
doOpenFolderOrWorkspace
(
openConfig
:
IOpenConfiguration
,
folderOrWorkspace
:
IPathToOpen
,
openInNewWindow
:
boolean
,
filesToOpen
:
IPath
[],
filesToCreate
:
IPath
[],
filesToDiff
:
IPath
[],
filesToWait
:
IPathsToWaitFor
,
windowToUse
?:
ICodeWindow
):
ICodeWindow
{
private
doOpenFolderOrWorkspace
(
openConfig
:
IOpenConfiguration
,
folderOrWorkspace
:
IPathToOpen
,
forceNewWindow
:
boolean
,
filesToOpen
:
IPath
[],
filesToCreate
:
IPath
[],
filesToDiff
:
IPath
[],
filesToWait
:
IPathsToWaitFor
,
windowToUse
?:
ICodeWindow
):
ICodeWindow
{
if
(
!
forceNewWindow
&&
!
windowToUse
&&
typeof
openConfig
.
contextWindowId
===
'
number
'
)
{
windowToUse
=
this
.
getWindowById
(
openConfig
.
contextWindowId
);
// fix for https://github.com/Microsoft/vscode/issues/49587
}
const
browserWindow
=
this
.
openInBrowserWindow
({
const
browserWindow
=
this
.
openInBrowserWindow
({
userEnv
:
openConfig
.
userEnv
,
userEnv
:
openConfig
.
userEnv
,
cli
:
openConfig
.
cli
,
cli
:
openConfig
.
cli
,
...
@@ -727,7 +731,7 @@ export class WindowsManager implements IWindowsMainService {
...
@@ -727,7 +731,7 @@ export class WindowsManager implements IWindowsMainService {
filesToCreate
,
filesToCreate
,
filesToDiff
,
filesToDiff
,
filesToWait
,
filesToWait
,
forceNewWindow
:
openInNewWindow
,
forceNewWindow
,
windowToUse
windowToUse
});
});
...
...
src/vs/platform/windows/common/windows.ts
浏览文件 @
3fa0bdbb
...
@@ -151,7 +151,7 @@ export interface IWindowsService {
...
@@ -151,7 +151,7 @@ export interface IWindowsService {
toggleSharedProcess
():
TPromise
<
void
>
;
toggleSharedProcess
():
TPromise
<
void
>
;
// Global methods
// Global methods
openWindow
(
paths
:
string
[],
options
?:
{
forceNewWindow
?:
boolean
,
forceReuseWindow
?:
boolean
,
forceOpenWorkspaceAsFile
?:
boolean
;
}):
TPromise
<
void
>
;
openWindow
(
windowId
:
number
,
paths
:
string
[],
options
?:
{
forceNewWindow
?:
boolean
,
forceReuseWindow
?:
boolean
,
forceOpenWorkspaceAsFile
?:
boolean
;
}):
TPromise
<
void
>
;
openNewWindow
():
TPromise
<
void
>
;
openNewWindow
():
TPromise
<
void
>
;
showWindow
(
windowId
:
number
):
TPromise
<
void
>
;
showWindow
(
windowId
:
number
):
TPromise
<
void
>
;
getWindows
():
TPromise
<
{
id
:
number
;
workspace
?:
IWorkspaceIdentifier
;
folderPath
?:
string
;
title
:
string
;
filename
?:
string
;
}[]
>
;
getWindows
():
TPromise
<
{
id
:
number
;
workspace
?:
IWorkspaceIdentifier
;
folderPath
?:
string
;
title
:
string
;
filename
?:
string
;
}[]
>
;
...
@@ -200,6 +200,7 @@ export interface IWindowService {
...
@@ -200,6 +200,7 @@ export interface IWindowService {
getRecentlyOpened
():
TPromise
<
IRecentlyOpened
>
;
getRecentlyOpened
():
TPromise
<
IRecentlyOpened
>
;
focusWindow
():
TPromise
<
void
>
;
focusWindow
():
TPromise
<
void
>
;
closeWindow
():
TPromise
<
void
>
;
closeWindow
():
TPromise
<
void
>
;
openWindow
(
paths
:
string
[],
options
?:
{
forceNewWindow
?:
boolean
,
forceReuseWindow
?:
boolean
,
forceOpenWorkspaceAsFile
?:
boolean
;
}):
TPromise
<
void
>
;
isFocused
():
TPromise
<
boolean
>
;
isFocused
():
TPromise
<
boolean
>
;
setDocumentEdited
(
flag
:
boolean
):
TPromise
<
void
>
;
setDocumentEdited
(
flag
:
boolean
):
TPromise
<
void
>
;
onWindowTitleDoubleClick
():
TPromise
<
void
>
;
onWindowTitleDoubleClick
():
TPromise
<
void
>
;
...
...
src/vs/platform/windows/common/windowsIpc.ts
浏览文件 @
3fa0bdbb
...
@@ -52,7 +52,7 @@ export interface IWindowsChannel extends IChannel {
...
@@ -52,7 +52,7 @@ export interface IWindowsChannel extends IChannel {
call
(
command
:
'
onWindowTitleDoubleClick
'
,
arg
:
number
):
TPromise
<
void
>
;
call
(
command
:
'
onWindowTitleDoubleClick
'
,
arg
:
number
):
TPromise
<
void
>
;
call
(
command
:
'
setDocumentEdited
'
,
arg
:
[
number
,
boolean
]):
TPromise
<
void
>
;
call
(
command
:
'
setDocumentEdited
'
,
arg
:
[
number
,
boolean
]):
TPromise
<
void
>
;
call
(
command
:
'
quit
'
):
TPromise
<
void
>
;
call
(
command
:
'
quit
'
):
TPromise
<
void
>
;
call
(
command
:
'
openWindow
'
,
arg
:
[
string
[],
{
forceNewWindow
?:
boolean
,
forceReuseWindow
?:
boolean
,
forceOpenWorkspaceAsFile
?:
boolean
}]):
TPromise
<
void
>
;
call
(
command
:
'
openWindow
'
,
arg
:
[
number
,
string
[],
{
forceNewWindow
?:
boolean
,
forceReuseWindow
?:
boolean
,
forceOpenWorkspaceAsFile
?:
boolean
}]):
TPromise
<
void
>
;
call
(
command
:
'
openNewWindow
'
):
TPromise
<
void
>
;
call
(
command
:
'
openNewWindow
'
):
TPromise
<
void
>
;
call
(
command
:
'
showWindow
'
,
arg
:
number
):
TPromise
<
void
>
;
call
(
command
:
'
showWindow
'
,
arg
:
number
):
TPromise
<
void
>
;
call
(
command
:
'
getWindows
'
):
TPromise
<
{
id
:
number
;
workspace
?:
IWorkspaceIdentifier
;
folderPath
?:
string
;
title
:
string
;
filename
?:
string
;
}[]
>
;
call
(
command
:
'
getWindows
'
):
TPromise
<
{
id
:
number
;
workspace
?:
IWorkspaceIdentifier
;
folderPath
?:
string
;
title
:
string
;
filename
?:
string
;
}[]
>
;
...
@@ -131,7 +131,7 @@ export class WindowsChannel implements IWindowsChannel {
...
@@ -131,7 +131,7 @@ export class WindowsChannel implements IWindowsChannel {
case
'
unmaximizeWindow
'
:
return
this
.
service
.
unmaximizeWindow
(
arg
);
case
'
unmaximizeWindow
'
:
return
this
.
service
.
unmaximizeWindow
(
arg
);
case
'
onWindowTitleDoubleClick
'
:
return
this
.
service
.
onWindowTitleDoubleClick
(
arg
);
case
'
onWindowTitleDoubleClick
'
:
return
this
.
service
.
onWindowTitleDoubleClick
(
arg
);
case
'
setDocumentEdited
'
:
return
this
.
service
.
setDocumentEdited
(
arg
[
0
],
arg
[
1
]);
case
'
setDocumentEdited
'
:
return
this
.
service
.
setDocumentEdited
(
arg
[
0
],
arg
[
1
]);
case
'
openWindow
'
:
return
this
.
service
.
openWindow
(
arg
[
0
],
arg
[
1
]);
case
'
openWindow
'
:
return
this
.
service
.
openWindow
(
arg
[
0
],
arg
[
1
]
,
arg
[
2
]
);
case
'
openNewWindow
'
:
return
this
.
service
.
openNewWindow
();
case
'
openNewWindow
'
:
return
this
.
service
.
openNewWindow
();
case
'
showWindow
'
:
return
this
.
service
.
showWindow
(
arg
);
case
'
showWindow
'
:
return
this
.
service
.
showWindow
(
arg
);
case
'
getWindows
'
:
return
this
.
service
.
getWindows
();
case
'
getWindows
'
:
return
this
.
service
.
getWindows
();
...
@@ -309,8 +309,8 @@ export class WindowsChannelClient implements IWindowsService {
...
@@ -309,8 +309,8 @@ export class WindowsChannelClient implements IWindowsService {
return
this
.
channel
.
call
(
'
toggleSharedProcess
'
);
return
this
.
channel
.
call
(
'
toggleSharedProcess
'
);
}
}
openWindow
(
paths
:
string
[],
options
?:
{
forceNewWindow
?:
boolean
,
forceReuseWindow
?:
boolean
,
forceOpenWorkspaceAsFile
?:
boolean
}):
TPromise
<
void
>
{
openWindow
(
windowId
:
number
,
paths
:
string
[],
options
?:
{
forceNewWindow
?:
boolean
,
forceReuseWindow
?:
boolean
,
forceOpenWorkspaceAsFile
?:
boolean
}):
TPromise
<
void
>
{
return
this
.
channel
.
call
(
'
openWindow
'
,
[
paths
,
options
]);
return
this
.
channel
.
call
(
'
openWindow
'
,
[
windowId
,
paths
,
options
]);
}
}
openNewWindow
():
TPromise
<
void
>
{
openNewWindow
():
TPromise
<
void
>
{
...
...
src/vs/platform/windows/electron-browser/windowService.ts
浏览文件 @
3fa0bdbb
...
@@ -85,6 +85,10 @@ export class WindowService implements IWindowService {
...
@@ -85,6 +85,10 @@ export class WindowService implements IWindowService {
return
this
.
windowsService
.
saveAndEnterWorkspace
(
this
.
windowId
,
path
);
return
this
.
windowsService
.
saveAndEnterWorkspace
(
this
.
windowId
,
path
);
}
}
openWindow
(
paths
:
string
[],
options
?:
{
forceNewWindow
?:
boolean
,
forceReuseWindow
?:
boolean
,
forceOpenWorkspaceAsFile
?:
boolean
;
}):
TPromise
<
void
>
{
return
this
.
windowsService
.
openWindow
(
this
.
windowId
,
paths
,
options
);
}
closeWindow
():
TPromise
<
void
>
{
closeWindow
():
TPromise
<
void
>
{
return
this
.
windowsService
.
closeWindow
(
this
.
windowId
);
return
this
.
windowsService
.
closeWindow
(
this
.
windowId
);
}
}
...
...
src/vs/platform/windows/electron-main/windows.ts
浏览文件 @
3fa0bdbb
...
@@ -119,6 +119,7 @@ export interface IWindowsMainService {
...
@@ -119,6 +119,7 @@ export interface IWindowsMainService {
export
interface
IOpenConfiguration
{
export
interface
IOpenConfiguration
{
context
:
OpenContext
;
context
:
OpenContext
;
contextWindowId
?:
number
;
cli
:
ParsedArgs
;
cli
:
ParsedArgs
;
userEnv
?:
IProcessEnvironment
;
userEnv
?:
IProcessEnvironment
;
pathsToOpen
?:
string
[];
pathsToOpen
?:
string
[];
...
...
src/vs/platform/windows/electron-main/windowsService.ts
浏览文件 @
3fa0bdbb
...
@@ -360,7 +360,7 @@ export class WindowsService implements IWindowsService, IURLHandler, IDisposable
...
@@ -360,7 +360,7 @@ export class WindowsService implements IWindowsService, IURLHandler, IDisposable
return
TPromise
.
as
(
null
);
return
TPromise
.
as
(
null
);
}
}
openWindow
(
paths
:
string
[],
options
?:
{
forceNewWindow
?:
boolean
,
forceReuseWindow
?:
boolean
,
forceOpenWorkspaceAsFile
?:
boolean
}):
TPromise
<
void
>
{
openWindow
(
windowId
:
number
,
paths
:
string
[],
options
?:
{
forceNewWindow
?:
boolean
,
forceReuseWindow
?:
boolean
,
forceOpenWorkspaceAsFile
?:
boolean
}):
TPromise
<
void
>
{
this
.
logService
.
trace
(
'
windowsService#openWindow
'
);
this
.
logService
.
trace
(
'
windowsService#openWindow
'
);
if
(
!
paths
||
!
paths
.
length
)
{
if
(
!
paths
||
!
paths
.
length
)
{
return
TPromise
.
as
(
null
);
return
TPromise
.
as
(
null
);
...
@@ -368,6 +368,7 @@ export class WindowsService implements IWindowsService, IURLHandler, IDisposable
...
@@ -368,6 +368,7 @@ export class WindowsService implements IWindowsService, IURLHandler, IDisposable
this
.
windowsMainService
.
open
({
this
.
windowsMainService
.
open
({
context
:
OpenContext
.
API
,
context
:
OpenContext
.
API
,
contextWindowId
:
windowId
,
cli
:
this
.
environmentService
.
args
,
cli
:
this
.
environmentService
.
args
,
pathsToOpen
:
paths
,
pathsToOpen
:
paths
,
forceNewWindow
:
options
&&
options
.
forceNewWindow
,
forceNewWindow
:
options
&&
options
.
forceNewWindow
,
...
...
src/vs/workbench/browser/actions/workspaceActions.ts
浏览文件 @
3fa0bdbb
...
@@ -8,7 +8,7 @@
...
@@ -8,7 +8,7 @@
import
{
TPromise
}
from
'
vs/base/common/winjs.base
'
;
import
{
TPromise
}
from
'
vs/base/common/winjs.base
'
;
import
{
Action
}
from
'
vs/base/common/actions
'
;
import
{
Action
}
from
'
vs/base/common/actions
'
;
import
*
as
nls
from
'
vs/nls
'
;
import
*
as
nls
from
'
vs/nls
'
;
import
{
IWindowService
,
IWindowsService
}
from
'
vs/platform/windows/common/windows
'
;
import
{
IWindowService
}
from
'
vs/platform/windows/common/windows
'
;
import
{
ITelemetryData
}
from
'
vs/platform/telemetry/common/telemetry
'
;
import
{
ITelemetryData
}
from
'
vs/platform/telemetry/common/telemetry
'
;
import
{
IWorkspaceContextService
,
WorkbenchState
,
IWorkspaceFolder
}
from
'
vs/platform/workspace/common/workspace
'
;
import
{
IWorkspaceContextService
,
WorkbenchState
,
IWorkspaceFolder
}
from
'
vs/platform/workspace/common/workspace
'
;
import
{
IWorkspaceEditingService
}
from
'
vs/workbench/services/workspace/common/workspaceEditing
'
;
import
{
IWorkspaceEditingService
}
from
'
vs/workbench/services/workspace/common/workspaceEditing
'
;
...
@@ -228,7 +228,7 @@ export class DuplicateWorkspaceInNewWindowAction extends Action {
...
@@ -228,7 +228,7 @@ export class DuplicateWorkspaceInNewWindowAction extends Action {
label
:
string
,
label
:
string
,
@
IWorkspaceContextService
private
workspaceContextService
:
IWorkspaceContextService
,
@
IWorkspaceContextService
private
workspaceContextService
:
IWorkspaceContextService
,
@
IWorkspaceEditingService
private
workspaceEditingService
:
IWorkspaceEditingService
,
@
IWorkspaceEditingService
private
workspaceEditingService
:
IWorkspaceEditingService
,
@
IWindow
sService
private
windowsService
:
IWindows
Service
,
@
IWindow
Service
private
windowService
:
IWindow
Service
,
@
IWorkspacesService
private
workspacesService
:
IWorkspacesService
@
IWorkspacesService
private
workspacesService
:
IWorkspacesService
)
{
)
{
super
(
id
,
label
);
super
(
id
,
label
);
...
@@ -239,7 +239,7 @@ export class DuplicateWorkspaceInNewWindowAction extends Action {
...
@@ -239,7 +239,7 @@ export class DuplicateWorkspaceInNewWindowAction extends Action {
return
this
.
workspacesService
.
createWorkspace
(
folders
).
then
(
newWorkspace
=>
{
return
this
.
workspacesService
.
createWorkspace
(
folders
).
then
(
newWorkspace
=>
{
return
this
.
workspaceEditingService
.
copyWorkspaceSettings
(
newWorkspace
).
then
(()
=>
{
return
this
.
workspaceEditingService
.
copyWorkspaceSettings
(
newWorkspace
).
then
(()
=>
{
return
this
.
window
s
Service
.
openWindow
([
newWorkspace
.
configPath
],
{
forceNewWindow
:
true
});
return
this
.
windowService
.
openWindow
([
newWorkspace
.
configPath
],
{
forceNewWindow
:
true
});
});
});
});
});
}
}
...
...
src/vs/workbench/browser/dnd.ts
浏览文件 @
3fa0bdbb
...
@@ -299,7 +299,7 @@ export class ResourcesDropHandler {
...
@@ -299,7 +299,7 @@ export class ResourcesDropHandler {
// Open
// Open
workspacesToOpen
.
then
(
workspaces
=>
{
workspacesToOpen
.
then
(
workspaces
=>
{
this
.
window
s
Service
.
openWindow
(
workspaces
,
{
forceReuseWindow
:
true
});
this
.
windowService
.
openWindow
(
workspaces
,
{
forceReuseWindow
:
true
});
});
});
return
true
;
return
true
;
...
...
src/vs/workbench/electron-browser/actions.ts
浏览文件 @
3fa0bdbb
...
@@ -702,7 +702,6 @@ export abstract class BaseOpenRecentAction extends Action {
...
@@ -702,7 +702,6 @@ export abstract class BaseOpenRecentAction extends Action {
constructor
(
constructor
(
id
:
string
,
id
:
string
,
label
:
string
,
label
:
string
,
private
windowsService
:
IWindowsService
,
private
windowService
:
IWindowService
,
private
windowService
:
IWindowService
,
private
quickOpenService
:
IQuickOpenService
,
private
quickOpenService
:
IQuickOpenService
,
private
contextService
:
IWorkspaceContextService
,
private
contextService
:
IWorkspaceContextService
,
...
@@ -757,7 +756,7 @@ export abstract class BaseOpenRecentAction extends Action {
...
@@ -757,7 +756,7 @@ export abstract class BaseOpenRecentAction extends Action {
const
runPick
=
(
path
:
string
,
isFile
:
boolean
,
context
:
IEntryRunContext
)
=>
{
const
runPick
=
(
path
:
string
,
isFile
:
boolean
,
context
:
IEntryRunContext
)
=>
{
const
forceNewWindow
=
context
.
keymods
.
ctrlCmd
;
const
forceNewWindow
=
context
.
keymods
.
ctrlCmd
;
this
.
window
s
Service
.
openWindow
([
path
],
{
forceNewWindow
,
forceOpenWorkspaceAsFile
:
isFile
});
this
.
windowService
.
openWindow
([
path
],
{
forceNewWindow
,
forceOpenWorkspaceAsFile
:
isFile
});
};
};
const
workspacePicks
:
IFilePickOpenEntry
[]
=
recentWorkspaces
.
map
((
workspace
,
index
)
=>
toPick
(
workspace
,
index
===
0
?
{
label
:
nls
.
localize
(
'
workspaces
'
,
"
workspaces
"
)
}
:
void
0
,
isSingleFolderWorkspaceIdentifier
(
workspace
)
?
FileKind
.
FOLDER
:
FileKind
.
ROOT_FOLDER
,
this
.
environmentService
,
!
this
.
isQuickNavigate
()
?
this
.
removeAction
:
void
0
));
const
workspacePicks
:
IFilePickOpenEntry
[]
=
recentWorkspaces
.
map
((
workspace
,
index
)
=>
toPick
(
workspace
,
index
===
0
?
{
label
:
nls
.
localize
(
'
workspaces
'
,
"
workspaces
"
)
}
:
void
0
,
isSingleFolderWorkspaceIdentifier
(
workspace
)
?
FileKind
.
FOLDER
:
FileKind
.
ROOT_FOLDER
,
this
.
environmentService
,
!
this
.
isQuickNavigate
()
?
this
.
removeAction
:
void
0
));
...
@@ -812,7 +811,6 @@ export class OpenRecentAction extends BaseOpenRecentAction {
...
@@ -812,7 +811,6 @@ export class OpenRecentAction extends BaseOpenRecentAction {
constructor
(
constructor
(
id
:
string
,
id
:
string
,
label
:
string
,
label
:
string
,
@
IWindowsService
windowsService
:
IWindowsService
,
@
IWindowService
windowService
:
IWindowService
,
@
IWindowService
windowService
:
IWindowService
,
@
IQuickOpenService
quickOpenService
:
IQuickOpenService
,
@
IQuickOpenService
quickOpenService
:
IQuickOpenService
,
@
IWorkspaceContextService
contextService
:
IWorkspaceContextService
,
@
IWorkspaceContextService
contextService
:
IWorkspaceContextService
,
...
@@ -820,7 +818,7 @@ export class OpenRecentAction extends BaseOpenRecentAction {
...
@@ -820,7 +818,7 @@ export class OpenRecentAction extends BaseOpenRecentAction {
@
IKeybindingService
keybindingService
:
IKeybindingService
,
@
IKeybindingService
keybindingService
:
IKeybindingService
,
@
IInstantiationService
instantiationService
:
IInstantiationService
@
IInstantiationService
instantiationService
:
IInstantiationService
)
{
)
{
super
(
id
,
label
,
window
sService
,
window
Service
,
quickOpenService
,
contextService
,
environmentService
,
keybindingService
,
instantiationService
);
super
(
id
,
label
,
windowService
,
quickOpenService
,
contextService
,
environmentService
,
keybindingService
,
instantiationService
);
}
}
protected
isQuickNavigate
():
boolean
{
protected
isQuickNavigate
():
boolean
{
...
@@ -836,7 +834,6 @@ export class QuickOpenRecentAction extends BaseOpenRecentAction {
...
@@ -836,7 +834,6 @@ export class QuickOpenRecentAction extends BaseOpenRecentAction {
constructor
(
constructor
(
id
:
string
,
id
:
string
,
label
:
string
,
label
:
string
,
@
IWindowsService
windowsService
:
IWindowsService
,
@
IWindowService
windowService
:
IWindowService
,
@
IWindowService
windowService
:
IWindowService
,
@
IQuickOpenService
quickOpenService
:
IQuickOpenService
,
@
IQuickOpenService
quickOpenService
:
IQuickOpenService
,
@
IWorkspaceContextService
contextService
:
IWorkspaceContextService
,
@
IWorkspaceContextService
contextService
:
IWorkspaceContextService
,
...
@@ -844,7 +841,7 @@ export class QuickOpenRecentAction extends BaseOpenRecentAction {
...
@@ -844,7 +841,7 @@ export class QuickOpenRecentAction extends BaseOpenRecentAction {
@
IKeybindingService
keybindingService
:
IKeybindingService
,
@
IKeybindingService
keybindingService
:
IKeybindingService
,
@
IInstantiationService
instantiationService
:
IInstantiationService
@
IInstantiationService
instantiationService
:
IInstantiationService
)
{
)
{
super
(
id
,
label
,
window
sService
,
window
Service
,
quickOpenService
,
contextService
,
environmentService
,
keybindingService
,
instantiationService
);
super
(
id
,
label
,
windowService
,
quickOpenService
,
contextService
,
environmentService
,
keybindingService
,
instantiationService
);
}
}
protected
isQuickNavigate
():
boolean
{
protected
isQuickNavigate
():
boolean
{
...
...
src/vs/workbench/parts/files/electron-browser/fileActions.ts
浏览文件 @
3fa0bdbb
...
@@ -39,7 +39,7 @@ import { IUntitledResourceInput } from 'vs/platform/editor/common/editor';
...
@@ -39,7 +39,7 @@ import { IUntitledResourceInput } from 'vs/platform/editor/common/editor';
import
{
IInstantiationService
,
ServicesAccessor
,
IConstructorSignature2
}
from
'
vs/platform/instantiation/common/instantiation
'
;
import
{
IInstantiationService
,
ServicesAccessor
,
IConstructorSignature2
}
from
'
vs/platform/instantiation/common/instantiation
'
;
import
{
ITextModel
}
from
'
vs/editor/common/model
'
;
import
{
ITextModel
}
from
'
vs/editor/common/model
'
;
import
{
IBackupFileService
}
from
'
vs/workbench/services/backup/common/backup
'
;
import
{
IBackupFileService
}
from
'
vs/workbench/services/backup/common/backup
'
;
import
{
IWindow
s
Service
}
from
'
vs/platform/windows/common/windows
'
;
import
{
IWindowService
}
from
'
vs/platform/windows/common/windows
'
;
import
{
COPY_PATH_COMMAND_ID
,
REVEAL_IN_EXPLORER_COMMAND_ID
,
SAVE_ALL_COMMAND_ID
,
SAVE_ALL_LABEL
,
SAVE_ALL_IN_GROUP_COMMAND_ID
}
from
'
vs/workbench/parts/files/electron-browser/fileCommands
'
;
import
{
COPY_PATH_COMMAND_ID
,
REVEAL_IN_EXPLORER_COMMAND_ID
,
SAVE_ALL_COMMAND_ID
,
SAVE_ALL_LABEL
,
SAVE_ALL_IN_GROUP_COMMAND_ID
}
from
'
vs/workbench/parts/files/electron-browser/fileCommands
'
;
import
{
ITextModelService
,
ITextModelContentProvider
}
from
'
vs/editor/common/services/resolverService
'
;
import
{
ITextModelService
,
ITextModelContentProvider
}
from
'
vs/editor/common/services/resolverService
'
;
import
{
IConfigurationService
,
ConfigurationTarget
}
from
'
vs/platform/configuration/common/configuration
'
;
import
{
IConfigurationService
,
ConfigurationTarget
}
from
'
vs/platform/configuration/common/configuration
'
;
...
@@ -1380,7 +1380,7 @@ export class ShowOpenedFileInNewWindow extends Action {
...
@@ -1380,7 +1380,7 @@ export class ShowOpenedFileInNewWindow extends Action {
constructor
(
constructor
(
id
:
string
,
id
:
string
,
label
:
string
,
label
:
string
,
@
IWindow
sService
private
windowsService
:
IWindows
Service
,
@
IWindow
Service
private
windowService
:
IWindow
Service
,
@
IWorkbenchEditorService
private
editorService
:
IWorkbenchEditorService
,
@
IWorkbenchEditorService
private
editorService
:
IWorkbenchEditorService
,
@
INotificationService
private
notificationService
:
INotificationService
,
@
INotificationService
private
notificationService
:
INotificationService
,
)
{
)
{
...
@@ -1390,7 +1390,7 @@ export class ShowOpenedFileInNewWindow extends Action {
...
@@ -1390,7 +1390,7 @@ export class ShowOpenedFileInNewWindow extends Action {
public
run
():
TPromise
<
any
>
{
public
run
():
TPromise
<
any
>
{
const
fileResource
=
toResource
(
this
.
editorService
.
getActiveEditorInput
(),
{
supportSideBySide
:
true
,
filter
:
Schemas
.
file
/* todo@remote */
});
const
fileResource
=
toResource
(
this
.
editorService
.
getActiveEditorInput
(),
{
supportSideBySide
:
true
,
filter
:
Schemas
.
file
/* todo@remote */
});
if
(
fileResource
)
{
if
(
fileResource
)
{
this
.
window
s
Service
.
openWindow
([
fileResource
.
fsPath
],
{
forceNewWindow
:
true
,
forceOpenWorkspaceAsFile
:
true
});
this
.
windowService
.
openWindow
([
fileResource
.
fsPath
],
{
forceNewWindow
:
true
,
forceOpenWorkspaceAsFile
:
true
});
}
else
{
}
else
{
this
.
notificationService
.
info
(
nls
.
localize
(
'
openFileToShowInNewWindow
'
,
"
Open a file first to open in new window
"
));
this
.
notificationService
.
info
(
nls
.
localize
(
'
openFileToShowInNewWindow
'
,
"
Open a file first to open in new window
"
));
}
}
...
...
src/vs/workbench/parts/files/electron-browser/fileCommands.ts
浏览文件 @
3fa0bdbb
...
@@ -12,7 +12,7 @@ import * as labels from 'vs/base/common/labels';
...
@@ -12,7 +12,7 @@ import * as labels from 'vs/base/common/labels';
import
URI
from
'
vs/base/common/uri
'
;
import
URI
from
'
vs/base/common/uri
'
;
import
{
IWorkbenchEditorService
}
from
'
vs/workbench/services/editor/common/editorService
'
;
import
{
IWorkbenchEditorService
}
from
'
vs/workbench/services/editor/common/editorService
'
;
import
{
toResource
,
IEditorCommandsContext
}
from
'
vs/workbench/common/editor
'
;
import
{
toResource
,
IEditorCommandsContext
}
from
'
vs/workbench/common/editor
'
;
import
{
IWindowsService
}
from
'
vs/platform/windows/common/windows
'
;
import
{
IWindowsService
,
IWindowService
}
from
'
vs/platform/windows/common/windows
'
;
import
{
ServicesAccessor
,
IInstantiationService
}
from
'
vs/platform/instantiation/common/instantiation
'
;
import
{
ServicesAccessor
,
IInstantiationService
}
from
'
vs/platform/instantiation/common/instantiation
'
;
import
{
IViewletService
}
from
'
vs/workbench/services/viewlet/browser/viewlet
'
;
import
{
IViewletService
}
from
'
vs/workbench/services/viewlet/browser/viewlet
'
;
import
{
IWorkspaceContextService
}
from
'
vs/platform/workspace/common/workspace
'
;
import
{
IWorkspaceContextService
}
from
'
vs/platform/workspace/common/workspace
'
;
...
@@ -77,8 +77,9 @@ export const REMOVE_ROOT_FOLDER_COMMAND_ID = 'removeRootFolder';
...
@@ -77,8 +77,9 @@ export const REMOVE_ROOT_FOLDER_COMMAND_ID = 'removeRootFolder';
export
const
REMOVE_ROOT_FOLDER_LABEL
=
nls
.
localize
(
'
removeFolderFromWorkspace
'
,
"
Remove Folder from Workspace
"
);
export
const
REMOVE_ROOT_FOLDER_LABEL
=
nls
.
localize
(
'
removeFolderFromWorkspace
'
,
"
Remove Folder from Workspace
"
);
export
const
openWindowCommand
=
(
accessor
:
ServicesAccessor
,
paths
:
string
[],
forceNewWindow
:
boolean
)
=>
{
export
const
openWindowCommand
=
(
accessor
:
ServicesAccessor
,
paths
:
string
[],
forceNewWindow
:
boolean
)
=>
{
const
windowsService
=
accessor
.
get
(
IWindowsService
);
const
windowService
=
accessor
.
get
(
IWindowService
);
windowsService
.
openWindow
(
paths
,
{
forceNewWindow
});
windowService
.
openWindow
(
paths
,
{
forceNewWindow
});
};
};
function
save
(
resource
:
URI
,
isSaveAs
:
boolean
,
editorService
:
IWorkbenchEditorService
,
fileService
:
IFileService
,
untitledEditorService
:
IUntitledEditorService
,
function
save
(
resource
:
URI
,
isSaveAs
:
boolean
,
editorService
:
IWorkbenchEditorService
,
fileService
:
IFileService
,
untitledEditorService
:
IUntitledEditorService
,
...
...
src/vs/workbench/parts/welcome/page/electron-browser/welcomePage.ts
浏览文件 @
3fa0bdbb
...
@@ -14,7 +14,7 @@ import { IInstantiationService } from 'vs/platform/instantiation/common/instanti
...
@@ -14,7 +14,7 @@ import { IInstantiationService } from 'vs/platform/instantiation/common/instanti
import
{
IWorkbenchEditorService
}
from
'
vs/workbench/services/editor/common/editorService
'
;
import
{
IWorkbenchEditorService
}
from
'
vs/workbench/services/editor/common/editorService
'
;
import
{
Position
}
from
'
vs/platform/editor/common/editor
'
;
import
{
Position
}
from
'
vs/platform/editor/common/editor
'
;
import
{
onUnexpectedError
,
isPromiseCanceledError
}
from
'
vs/base/common/errors
'
;
import
{
onUnexpectedError
,
isPromiseCanceledError
}
from
'
vs/base/common/errors
'
;
import
{
IWindowService
,
IWindowsService
}
from
'
vs/platform/windows/common/windows
'
;
import
{
IWindowService
}
from
'
vs/platform/windows/common/windows
'
;
import
{
TPromise
}
from
'
vs/base/common/winjs.base
'
;
import
{
TPromise
}
from
'
vs/base/common/winjs.base
'
;
import
{
IWorkspaceContextService
}
from
'
vs/platform/workspace/common/workspace
'
;
import
{
IWorkspaceContextService
}
from
'
vs/platform/workspace/common/workspace
'
;
import
{
IConfigurationService
,
ConfigurationTarget
}
from
'
vs/platform/configuration/common/configuration
'
;
import
{
IConfigurationService
,
ConfigurationTarget
}
from
'
vs/platform/configuration/common/configuration
'
;
...
@@ -221,7 +221,6 @@ class WelcomePage {
...
@@ -221,7 +221,6 @@ class WelcomePage {
@
IWorkbenchEditorService
private
editorService
:
IWorkbenchEditorService
,
@
IWorkbenchEditorService
private
editorService
:
IWorkbenchEditorService
,
@
IInstantiationService
private
instantiationService
:
IInstantiationService
,
@
IInstantiationService
private
instantiationService
:
IInstantiationService
,
@
IWindowService
private
windowService
:
IWindowService
,
@
IWindowService
private
windowService
:
IWindowService
,
@
IWindowsService
private
windowsService
:
IWindowsService
,
@
IWorkspaceContextService
private
contextService
:
IWorkspaceContextService
,
@
IWorkspaceContextService
private
contextService
:
IWorkspaceContextService
,
@
IConfigurationService
private
configurationService
:
IConfigurationService
,
@
IConfigurationService
private
configurationService
:
IConfigurationService
,
@
IEnvironmentService
private
environmentService
:
IEnvironmentService
,
@
IEnvironmentService
private
environmentService
:
IEnvironmentService
,
...
@@ -317,7 +316,7 @@ class WelcomePage {
...
@@ -317,7 +316,7 @@ class WelcomePage {
id
:
'
openRecentFolder
'
,
id
:
'
openRecentFolder
'
,
from
:
telemetryFrom
from
:
telemetryFrom
});
});
this
.
window
s
Service
.
openWindow
([
wsPath
],
{
forceNewWindow
:
e
.
ctrlKey
||
e
.
metaKey
});
this
.
windowService
.
openWindow
([
wsPath
],
{
forceNewWindow
:
e
.
ctrlKey
||
e
.
metaKey
});
e
.
preventDefault
();
e
.
preventDefault
();
e
.
stopPropagation
();
e
.
stopPropagation
();
});
});
...
...
src/vs/workbench/test/workbenchTestServices.ts
浏览文件 @
3fa0bdbb
...
@@ -938,6 +938,10 @@ export class TestWindowService implements IWindowService {
...
@@ -938,6 +938,10 @@ export class TestWindowService implements IWindowService {
return
TPromise
.
as
(
void
0
);
return
TPromise
.
as
(
void
0
);
}
}
openWindow
(
paths
:
string
[],
options
?:
{
forceNewWindow
?:
boolean
,
forceReuseWindow
?:
boolean
,
forceOpenWorkspaceAsFile
?:
boolean
}):
TPromise
<
void
>
{
return
TPromise
.
as
(
void
0
);
}
closeWindow
():
TPromise
<
void
>
{
closeWindow
():
TPromise
<
void
>
{
return
TPromise
.
as
(
void
0
);
return
TPromise
.
as
(
void
0
);
}
}
...
@@ -1125,7 +1129,7 @@ export class TestWindowsService implements IWindowsService {
...
@@ -1125,7 +1129,7 @@ export class TestWindowsService implements IWindowsService {
}
}
// Global methods
// Global methods
openWindow
(
paths
:
string
[],
options
?:
{
forceNewWindow
?:
boolean
,
forceReuseWindow
?:
boolean
,
forceOpenWorkspaceAsFile
?:
boolean
}):
TPromise
<
void
>
{
openWindow
(
windowId
:
number
,
paths
:
string
[],
options
?:
{
forceNewWindow
?:
boolean
,
forceReuseWindow
?:
boolean
,
forceOpenWorkspaceAsFile
?:
boolean
}):
TPromise
<
void
>
{
return
TPromise
.
as
(
void
0
);
return
TPromise
.
as
(
void
0
);
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录