Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
掘金者说
vscode
提交
5e8cd0e9
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,发现更多精彩内容 >>
提交
5e8cd0e9
编写于
7月 03, 2017
作者:
B
Benjamin Pasero
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
debt - shuffle some windows service methods around
上级
f82aaac1
变更
11
隐藏空白更改
内联
并排
Showing
11 changed file
with
26 addition
and
36 deletion
+26
-36
src/vs/code/electron-main/windows.ts
src/vs/code/electron-main/windows.ts
+2
-2
src/vs/platform/windows/common/windows.ts
src/vs/platform/windows/common/windows.ts
+1
-3
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
+1
-9
src/vs/platform/windows/electron-main/windows.ts
src/vs/platform/windows/electron-main/windows.ts
+1
-1
src/vs/platform/windows/electron-main/windowsService.ts
src/vs/platform/windows/electron-main/windowsService.ts
+4
-2
src/vs/workbench/browser/actions/fileActions.ts
src/vs/workbench/browser/actions/fileActions.ts
+4
-0
src/vs/workbench/browser/parts/editor/editorGroupsControl.ts
src/vs/workbench/browser/parts/editor/editorGroupsControl.ts
+3
-2
src/vs/workbench/browser/parts/editor/tabsTitleControl.ts
src/vs/workbench/browser/parts/editor/tabsTitleControl.ts
+3
-2
src/vs/workbench/services/history/browser/history.ts
src/vs/workbench/services/history/browser/history.ts
+2
-2
src/vs/workbench/test/workbenchTestServices.ts
src/vs/workbench/test/workbenchTestServices.ts
+1
-9
未找到文件。
src/vs/code/electron-main/windows.ts
浏览文件 @
5e8cd0e9
...
...
@@ -1181,9 +1181,9 @@ export class WindowsManager implements IWindowsMainService {
this
.
fileDialog
.
pickAndOpen
({
pickFolders
:
true
,
forceNewWindow
,
window
,
title
:
nls
.
localize
(
'
openFolder
'
,
"
Open Folder
"
)
},
'
openFolder
'
,
data
);
}
public
pickFolder
(
options
?:
{
buttonLabel
:
string
;
title
:
string
;
}):
TPromise
<
string
[]
>
{
public
pickFolder
(
window
?:
CodeWindow
,
options
?:
{
buttonLabel
:
string
;
title
:
string
;
}):
TPromise
<
string
[]
>
{
return
new
TPromise
((
c
,
e
)
=>
{
this
.
fileDialog
.
getFileOrFolderPaths
({
pickFolders
:
true
,
buttonLabel
:
options
&&
options
.
buttonLabel
},
folders
=>
{
this
.
fileDialog
.
getFileOrFolderPaths
({
pickFolders
:
true
,
window
,
buttonLabel
:
options
&&
options
.
buttonLabel
},
folders
=>
{
c
(
folders
||
[]);
});
});
...
...
src/vs/platform/windows/common/windows.ts
浏览文件 @
5e8cd0e9
...
...
@@ -24,7 +24,7 @@ export interface IWindowsService {
pickFileFolderAndOpen
(
windowId
:
number
,
forceNewWindow
?:
boolean
,
data
?:
ITelemetryData
):
TPromise
<
void
>
;
pickFileAndOpen
(
windowId
:
number
,
forceNewWindow
?:
boolean
,
path
?:
string
,
data
?:
ITelemetryData
):
TPromise
<
void
>
;
pickFolderAndOpen
(
windowId
:
number
,
forceNewWindow
?:
boolean
,
data
?:
ITelemetryData
):
TPromise
<
void
>
;
pickFolder
(
options
?:
{
buttonLabel
:
string
;
title
:
string
;
}):
TPromise
<
string
[]
>
;
pickFolder
(
windowId
:
number
,
options
?:
{
buttonLabel
:
string
;
title
:
string
;
}):
TPromise
<
string
[]
>
;
reloadWindow
(
windowId
:
number
):
TPromise
<
void
>
;
openDevTools
(
windowId
:
number
):
TPromise
<
void
>
;
toggleDevTools
(
windowId
:
number
):
TPromise
<
void
>
;
...
...
@@ -86,8 +86,6 @@ export interface IWindowService {
closeFolder
():
TPromise
<
void
>
;
toggleFullScreen
():
TPromise
<
void
>
;
setRepresentedFilename
(
fileName
:
string
):
TPromise
<
void
>
;
addToRecentlyOpen
(
paths
:
{
path
:
string
,
isFile
?:
boolean
}[]):
TPromise
<
void
>
;
removeFromRecentlyOpen
(
paths
:
string
[]):
TPromise
<
void
>
;
getRecentlyOpen
():
TPromise
<
{
files
:
string
[];
folders
:
string
[];
}
>
;
focusWindow
():
TPromise
<
void
>
;
closeWindow
():
TPromise
<
void
>
;
...
...
src/vs/platform/windows/common/windowsIpc.ts
浏览文件 @
5e8cd0e9
...
...
@@ -17,7 +17,7 @@ export interface IWindowsChannel extends IChannel {
call
(
command
:
'
pickFileFolderAndOpen
'
,
arg
:
[
number
,
boolean
,
ITelemetryData
]):
TPromise
<
void
>
;
call
(
command
:
'
pickFileAndOpen
'
,
arg
:
[
number
,
boolean
,
string
,
ITelemetryData
]):
TPromise
<
void
>
;
call
(
command
:
'
pickFolderAndOpen
'
,
arg
:
[
number
,
boolean
,
ITelemetryData
]):
TPromise
<
void
>
;
call
(
command
:
'
pickFolder
'
,
arg
:
{
buttonLabel
:
string
;
title
:
string
;
}
):
TPromise
<
string
[]
>
;
call
(
command
:
'
pickFolder
'
,
arg
:
[
number
,
{
buttonLabel
:
string
;
title
:
string
;
}]
):
TPromise
<
string
[]
>
;
call
(
command
:
'
reloadWindow
'
,
arg
:
number
):
TPromise
<
void
>
;
call
(
command
:
'
toggleDevTools
'
,
arg
:
number
):
TPromise
<
void
>
;
call
(
command
:
'
closeFolder
'
,
arg
:
number
):
TPromise
<
void
>
;
...
...
@@ -69,7 +69,7 @@ export class WindowsChannel implements IWindowsChannel {
case
'
pickFileFolderAndOpen
'
:
return
this
.
service
.
pickFileFolderAndOpen
(
arg
[
0
],
arg
[
1
],
arg
[
2
]);
case
'
pickFileAndOpen
'
:
return
this
.
service
.
pickFileAndOpen
(
arg
[
0
],
arg
[
1
],
arg
[
2
],
arg
[
3
]);
case
'
pickFolderAndOpen
'
:
return
this
.
service
.
pickFolderAndOpen
(
arg
[
0
],
arg
[
1
],
arg
[
2
]);
case
'
pickFolder
'
:
return
this
.
service
.
pickFolder
(
arg
);
case
'
pickFolder
'
:
return
this
.
service
.
pickFolder
(
arg
[
0
],
arg
[
1
]
);
case
'
reloadWindow
'
:
return
this
.
service
.
reloadWindow
(
arg
);
case
'
openDevTools
'
:
return
this
.
service
.
openDevTools
(
arg
);
case
'
toggleDevTools
'
:
return
this
.
service
.
toggleDevTools
(
arg
);
...
...
@@ -131,8 +131,8 @@ export class WindowsChannelClient implements IWindowsService {
return
this
.
channel
.
call
(
'
pickFolderAndOpen
'
,
[
windowId
,
forceNewWindow
,
data
]);
}
pickFolder
(
options
?:
{
buttonLabel
:
string
;
title
:
string
;
}):
TPromise
<
string
[]
>
{
return
this
.
channel
.
call
(
'
pickFolder
'
,
options
);
pickFolder
(
windowId
:
number
,
options
?:
{
buttonLabel
:
string
;
title
:
string
;
}):
TPromise
<
string
[]
>
{
return
this
.
channel
.
call
(
'
pickFolder
'
,
[
windowId
,
options
]
);
}
reloadWindow
(
windowId
:
number
):
TPromise
<
void
>
{
...
...
src/vs/platform/windows/electron-browser/windowService.ts
浏览文件 @
5e8cd0e9
...
...
@@ -35,7 +35,7 @@ export class WindowService implements IWindowService {
}
pickFolder
(
options
?:
{
buttonLabel
:
string
;
title
:
string
;
}):
TPromise
<
string
[]
>
{
return
this
.
windowsService
.
pickFolder
(
options
);
return
this
.
windowsService
.
pickFolder
(
this
.
windowId
,
options
);
}
reloadWindow
():
TPromise
<
void
>
{
...
...
@@ -66,14 +66,6 @@ export class WindowService implements IWindowService {
return
this
.
windowsService
.
setRepresentedFilename
(
this
.
windowId
,
fileName
);
}
addToRecentlyOpen
(
paths
:
{
path
:
string
,
isFile
?:
boolean
}[]):
TPromise
<
void
>
{
return
this
.
windowsService
.
addToRecentlyOpen
(
paths
);
}
removeFromRecentlyOpen
(
paths
:
string
[]):
TPromise
<
void
>
{
return
this
.
windowsService
.
removeFromRecentlyOpen
(
paths
);
}
getRecentlyOpen
():
TPromise
<
{
files
:
string
[];
folders
:
string
[];
}
>
{
return
this
.
windowsService
.
getRecentlyOpen
(
this
.
windowId
);
}
...
...
src/vs/platform/windows/electron-main/windows.ts
浏览文件 @
5e8cd0e9
...
...
@@ -52,7 +52,7 @@ export interface IWindowsMainService {
pickFileFolderAndOpen
(
forceNewWindow
?:
boolean
,
data
?:
ITelemetryData
):
void
;
pickFileAndOpen
(
forceNewWindow
?:
boolean
,
path
?:
string
,
window
?:
ICodeWindow
,
data
?:
ITelemetryData
):
void
;
pickFolderAndOpen
(
forceNewWindow
?:
boolean
,
window
?:
ICodeWindow
,
data
?:
ITelemetryData
):
void
;
pickFolder
(
options
?:
{
buttonLabel
:
string
;
title
:
string
;
}):
TPromise
<
string
[]
>
;
pickFolder
(
window
?:
ICodeWindow
,
options
?:
{
buttonLabel
:
string
;
title
:
string
;
}):
TPromise
<
string
[]
>
;
focusLastActive
(
cli
:
ParsedArgs
,
context
:
OpenContext
):
ICodeWindow
;
getLastActiveWindow
():
ICodeWindow
;
waitForWindowClose
(
windowId
:
number
):
TPromise
<
void
>
;
...
...
src/vs/platform/windows/electron-main/windowsService.ts
浏览文件 @
5e8cd0e9
...
...
@@ -67,8 +67,10 @@ export class WindowsService implements IWindowsService, IDisposable {
return
TPromise
.
as
(
null
);
}
pickFolder
(
options
?:
{
buttonLabel
:
string
;
title
:
string
;
}):
TPromise
<
string
[]
>
{
return
this
.
windowsMainService
.
pickFolder
(
options
);
pickFolder
(
windowId
:
number
,
options
?:
{
buttonLabel
:
string
;
title
:
string
;
}):
TPromise
<
string
[]
>
{
const
codeWindow
=
this
.
windowsMainService
.
getWindowById
(
windowId
);
return
this
.
windowsMainService
.
pickFolder
(
codeWindow
,
options
);
}
reloadWindow
(
windowId
:
number
):
TPromise
<
void
>
{
...
...
src/vs/workbench/browser/actions/fileActions.ts
浏览文件 @
5e8cd0e9
...
...
@@ -73,6 +73,10 @@ export class AddRootFolderAction extends Action {
}
return
this
.
windowService
.
pickFolder
({
buttonLabel
:
nls
.
localize
(
'
add
'
,
"
Add
"
),
title
:
nls
.
localize
(
'
addFolderToWorkspaceTitle
'
,
"
Add Folder to Workspace
"
)
}).
then
(
folders
=>
{
if
(
!
folders
.
length
)
{
return
TPromise
.
as
(
null
);
}
return
this
.
workspaceEditingService
.
addRoots
(
folders
.
map
(
folder
=>
URI
.
file
(
folder
))).
then
(()
=>
{
return
this
.
viewletService
.
openViewlet
(
this
.
viewletService
.
getDefaultViewletId
(),
true
);
});
...
...
src/vs/workbench/browser/parts/editor/editorGroupsControl.ts
浏览文件 @
5e8cd0e9
...
...
@@ -31,7 +31,7 @@ import { TitleControl, ITitleAreaControl } from 'vs/workbench/browser/parts/edit
import
{
NoTabsTitleControl
}
from
'
vs/workbench/browser/parts/editor/noTabsTitleControl
'
;
import
{
IEditorStacksModel
,
IStacksModelChangeEvent
,
IEditorGroup
,
EditorOptions
,
TextEditorOptions
,
IEditorIdentifier
}
from
'
vs/workbench/common/editor
'
;
import
{
extractResources
}
from
'
vs/base/browser/dnd
'
;
import
{
IWindowService
}
from
'
vs/platform/windows/common/windows
'
;
import
{
IWindowService
,
IWindowsService
}
from
'
vs/platform/windows/common/windows
'
;
import
{
getCodeEditor
}
from
'
vs/editor/common/services/codeEditorService
'
;
import
{
IThemeService
}
from
'
vs/platform/theme/common/themeService
'
;
import
{
editorBackground
,
contrastBorder
,
activeContrastBorder
}
from
'
vs/platform/theme/common/colorRegistry
'
;
...
...
@@ -147,6 +147,7 @@ export class EditorGroupsControl extends Themable implements IEditorGroupsContro
@
IExtensionService
private
extensionService
:
IExtensionService
,
@
IInstantiationService
private
instantiationService
:
IInstantiationService
,
@
IWindowService
private
windowService
:
IWindowService
,
@
IWindowsService
private
windowsService
:
IWindowsService
,
@
IThemeService
themeService
:
IThemeService
)
{
super
(
themeService
);
...
...
@@ -1117,7 +1118,7 @@ export class EditorGroupsControl extends Themable implements IEditorGroupsContro
// Add external ones to recently open list
const
externalResources
=
droppedResources
.
filter
(
d
=>
d
.
isExternal
).
map
(
d
=>
d
.
resource
);
if
(
externalResources
.
length
)
{
$this
.
windowService
.
addToRecentlyOpen
(
externalResources
.
map
(
resource
=>
{
$this
.
window
s
Service
.
addToRecentlyOpen
(
externalResources
.
map
(
resource
=>
{
return
{
path
:
resource
.
fsPath
,
isFile
:
true
...
...
src/vs/workbench/browser/parts/editor/tabsTitleControl.ts
浏览文件 @
5e8cd0e9
...
...
@@ -29,7 +29,7 @@ import { IInstantiationService } from 'vs/platform/instantiation/common/instanti
import
{
IKeybindingService
}
from
'
vs/platform/keybinding/common/keybinding
'
;
import
{
IContextKeyService
}
from
'
vs/platform/contextkey/common/contextkey
'
;
import
{
IMenuService
}
from
'
vs/platform/actions/common/actions
'
;
import
{
IWindowService
}
from
'
vs/platform/windows/common/windows
'
;
import
{
IWindowService
,
IWindowsService
}
from
'
vs/platform/windows/common/windows
'
;
import
{
TitleControl
}
from
'
vs/workbench/browser/parts/editor/titleControl
'
;
import
{
IQuickOpenService
}
from
'
vs/platform/quickOpen/common/quickOpen
'
;
import
{
IDisposable
,
dispose
,
combinedDisposable
}
from
'
vs/base/common/lifecycle
'
;
...
...
@@ -72,6 +72,7 @@ export class TabsTitleControl extends TitleControl {
@
IMenuService
menuService
:
IMenuService
,
@
IQuickOpenService
quickOpenService
:
IQuickOpenService
,
@
IWindowService
private
windowService
:
IWindowService
,
@
IWindowsService
private
windowsService
:
IWindowsService
,
@
IThemeService
themeService
:
IThemeService
)
{
super
(
contextMenuService
,
instantiationService
,
editorService
,
editorGroupService
,
contextKeyService
,
keybindingService
,
telemetryService
,
messageService
,
menuService
,
quickOpenService
,
themeService
);
...
...
@@ -690,7 +691,7 @@ export class TabsTitleControl extends TitleControl {
// Add external ones to recently open list
const
externalResources
=
resources
.
filter
(
d
=>
d
.
isExternal
).
map
(
d
=>
d
.
resource
);
if
(
externalResources
.
length
)
{
this
.
windowService
.
addToRecentlyOpen
(
externalResources
.
map
(
resource
=>
{
this
.
window
s
Service
.
addToRecentlyOpen
(
externalResources
.
map
(
resource
=>
{
return
{
path
:
resource
.
fsPath
,
isFile
:
true
...
...
src/vs/workbench/services/history/browser/history.ts
浏览文件 @
5e8cd0e9
...
...
@@ -23,7 +23,7 @@ import { Registry } from 'vs/platform/registry/common/platform';
import
{
once
}
from
'
vs/base/common/event
'
;
import
{
IConfigurationService
}
from
'
vs/platform/configuration/common/configuration
'
;
import
{
IEditorGroupService
}
from
'
vs/workbench/services/group/common/groupService
'
;
import
{
IWindowService
}
from
'
vs/platform/windows/common/windows
'
;
import
{
IWindow
s
Service
}
from
'
vs/platform/windows/common/windows
'
;
import
{
getCodeEditor
}
from
'
vs/editor/common/services/codeEditorService
'
;
import
{
getExcludes
,
ISearchConfiguration
}
from
'
vs/platform/search/common/search
'
;
import
{
parse
,
IExpression
}
from
'
vs/base/common/glob
'
;
...
...
@@ -166,7 +166,7 @@ export class HistoryService extends BaseHistoryService implements IHistoryServic
@
IConfigurationService
private
configurationService
:
IConfigurationService
,
@
ILifecycleService
private
lifecycleService
:
ILifecycleService
,
@
IFileService
private
fileService
:
IFileService
,
@
IWindow
Service
private
windowService
:
IWindow
Service
,
@
IWindow
sService
private
windowService
:
IWindows
Service
,
@
IInstantiationService
private
instantiationService
:
IInstantiationService
,
)
{
super
(
editorGroupService
,
editorService
);
...
...
src/vs/workbench/test/workbenchTestServices.ts
浏览文件 @
5e8cd0e9
...
...
@@ -881,14 +881,6 @@ export class TestWindowService implements IWindowService {
return
TPromise
.
as
(
void
0
);
}
addToRecentlyOpen
(
paths
:
{
path
:
string
,
isFile
?:
boolean
}[]):
TPromise
<
void
>
{
return
TPromise
.
as
(
void
0
);
}
removeFromRecentlyOpen
(
paths
:
string
[]):
TPromise
<
void
>
{
return
TPromise
.
as
(
void
0
);
}
getRecentlyOpen
():
TPromise
<
{
files
:
string
[];
folders
:
string
[];
}
>
{
return
TPromise
.
as
(
void
0
);
}
...
...
@@ -980,7 +972,7 @@ export class TestWindowsService implements IWindowsService {
return
TPromise
.
as
(
void
0
);
}
pickFolder
(
options
?:
{
buttonLabel
:
string
;
title
:
string
;
}):
TPromise
<
string
[]
>
{
pickFolder
(
windowId
:
number
,
options
?:
{
buttonLabel
:
string
;
title
:
string
;
}):
TPromise
<
string
[]
>
{
return
TPromise
.
as
([]);
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录