Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
a704725e
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,发现更多精彩内容 >>
提交
a704725e
编写于
7月 25, 2018
作者:
S
Sandeep Somavarapu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix #54994
上级
7fd6f1b1
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
16 addition
and
18 deletion
+16
-18
src/vs/platform/windows/common/windowsIpc.ts
src/vs/platform/windows/common/windowsIpc.ts
+8
-2
src/vs/workbench/electron-browser/actions.ts
src/vs/workbench/electron-browser/actions.ts
+8
-16
未找到文件。
src/vs/platform/windows/common/windowsIpc.ts
浏览文件 @
a704725e
...
...
@@ -9,7 +9,7 @@ import { TPromise } from 'vs/base/common/winjs.base';
import
{
Event
,
buffer
}
from
'
vs/base/common/event
'
;
import
{
IChannel
}
from
'
vs/base/parts/ipc/common/ipc
'
;
import
{
IWindowsService
,
INativeOpenDialogOptions
,
IEnterWorkspaceResult
,
CrashReporterStartOptions
,
IMessageBoxResult
,
MessageBoxOptions
,
SaveDialogOptions
,
OpenDialogOptions
,
IDevToolsOptions
}
from
'
vs/platform/windows/common/windows
'
;
import
{
IWorkspaceIdentifier
,
IWorkspaceFolderCreationData
,
isSingleFolderWorkspaceIdentifier
,
ISingleFolderWorkspaceIdentifier
,
isWorkspaceIdentifier
}
from
'
vs/platform/workspaces/common/workspaces
'
;
import
{
IWorkspaceIdentifier
,
IWorkspaceFolderCreationData
,
ISingleFolderWorkspaceIdentifier
,
isWorkspaceIdentifier
}
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
'
;
...
...
@@ -140,7 +140,13 @@ export class WindowsChannel implements IWindowsChannel {
case
'
toggleFullScreen
'
:
return
this
.
service
.
toggleFullScreen
(
arg
);
case
'
setRepresentedFilename
'
:
return
this
.
service
.
setRepresentedFilename
(
arg
[
0
],
arg
[
1
]);
case
'
addRecentlyOpened
'
:
return
this
.
service
.
addRecentlyOpened
(
arg
);
case
'
removeFromRecentlyOpened
'
:
return
this
.
service
.
removeFromRecentlyOpened
(
isSingleFolderWorkspaceIdentifier
(
arg
)
?
URI
.
revive
(
arg
)
:
arg
);
case
'
removeFromRecentlyOpened
'
:
{
let
paths
:
(
IWorkspaceIdentifier
|
ISingleFolderWorkspaceIdentifier
|
string
)[]
=
arg
;
if
(
Array
.
isArray
(
paths
))
{
paths
=
paths
.
map
(
path
=>
isWorkspaceIdentifier
(
path
)
||
typeof
path
===
'
string
'
?
path
:
URI
.
revive
(
path
));
}
return
this
.
service
.
removeFromRecentlyOpened
(
paths
);
}
case
'
clearRecentlyOpened
'
:
return
this
.
service
.
clearRecentlyOpened
();
case
'
showPreviousWindowTab
'
:
return
this
.
service
.
showPreviousWindowTab
();
case
'
showNextWindowTab
'
:
return
this
.
service
.
showNextWindowTab
();
...
...
src/vs/workbench/electron-browser/actions.ts
浏览文件 @
a704725e
...
...
@@ -9,7 +9,7 @@ import 'vs/css!./media/actions';
import
URI
from
'
vs/base/common/uri
'
;
import
{
TPromise
}
from
'
vs/base/common/winjs.base
'
;
import
{
Action
}
from
'
vs/base/common/actions
'
;
import
{
Action
,
IAction
}
from
'
vs/base/common/actions
'
;
import
{
IWindowService
,
IWindowsService
,
MenuBarVisibility
}
from
'
vs/platform/windows/common/windows
'
;
import
*
as
nls
from
'
vs/nls
'
;
import
product
from
'
vs/platform/node/product
'
;
...
...
@@ -697,7 +697,6 @@ export class QuickSwitchWindow extends BaseSwitchWindow {
export
const
inRecentFilesPickerContextKey
=
'
inRecentFilesPicker
'
;
export
abstract
class
BaseOpenRecentAction
extends
Action
{
private
removeAction
:
RemoveFromRecentlyOpened
;
constructor
(
id
:
string
,
...
...
@@ -707,11 +706,9 @@ export abstract class BaseOpenRecentAction extends Action {
private
contextService
:
IWorkspaceContextService
,
private
environmentService
:
IEnvironmentService
,
private
keybindingService
:
IKeybindingService
,
instantiationService
:
IInstantiationService
private
instantiationService
:
IInstantiationService
)
{
super
(
id
,
label
);
this
.
removeAction
=
instantiationService
.
createInstance
(
RemoveFromRecentlyOpened
);
}
protected
abstract
isQuickNavigate
():
boolean
;
...
...
@@ -723,7 +720,7 @@ export abstract class BaseOpenRecentAction extends Action {
private
openRecent
(
recentWorkspaces
:
(
IWorkspaceIdentifier
|
ISingleFolderWorkspaceIdentifier
)[],
recentFiles
:
string
[]):
void
{
function
toPick
(
workspace
:
IWorkspaceIdentifier
|
ISingleFolderWorkspaceIdentifier
|
string
,
separator
:
ISeparator
,
fileKind
:
FileKind
,
environmentService
:
IEnvironmentService
,
removeAction
?:
RemoveFromRecentlyOpened
):
IFilePickOpenEntry
{
function
toPick
(
workspace
:
IWorkspaceIdentifier
|
ISingleFolderWorkspaceIdentifier
|
string
,
separator
:
ISeparator
,
fileKind
:
FileKind
,
environmentService
:
IEnvironmentService
,
action
:
IAction
):
IFilePickOpenEntry
{
let
resource
:
URI
;
let
label
:
string
;
let
description
:
string
;
...
...
@@ -754,7 +751,7 @@ export abstract class BaseOpenRecentAction extends Action {
runPick
(
resource
,
fileKind
===
FileKind
.
FILE
,
context
);
});
},
action
:
removeAction
action
};
}
...
...
@@ -763,8 +760,8 @@ export abstract class BaseOpenRecentAction extends Action {
this
.
windowService
.
openWindow
([
resource
],
{
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
filePicks
:
IFilePickOpenEntry
[]
=
recentFiles
.
map
((
p
,
index
)
=>
toPick
(
p
,
index
===
0
?
{
label
:
nls
.
localize
(
'
files
'
,
"
files
"
),
border
:
true
}
:
void
0
,
FileKind
.
FILE
,
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
.
instantiationService
.
createInstance
(
RemoveFromRecentlyOpened
,
workspace
)
:
void
0
));
const
filePicks
:
IFilePickOpenEntry
[]
=
recentFiles
.
map
((
p
,
index
)
=>
toPick
(
p
,
index
===
0
?
{
label
:
nls
.
localize
(
'
files
'
,
"
files
"
),
border
:
true
}
:
void
0
,
FileKind
.
FILE
,
this
.
environmentService
,
!
this
.
isQuickNavigate
()
?
this
.
instantiationService
.
createInstance
(
RemoveFromRecentlyOpened
,
p
)
:
void
0
));
// focus second entry if the first recent workspace is the current workspace
let
autoFocusSecondEntry
:
boolean
=
recentWorkspaces
[
0
]
&&
this
.
contextService
.
isCurrentWorkspace
(
recentWorkspaces
[
0
]);
...
...
@@ -777,12 +774,6 @@ export abstract class BaseOpenRecentAction extends Action {
quickNavigateConfiguration
:
this
.
isQuickNavigate
()
?
{
keybindings
:
this
.
keybindingService
.
lookupKeybindings
(
this
.
id
)
}
:
void
0
}).
done
(
null
,
errors
.
onUnexpectedError
);
}
dispose
():
void
{
super
.
dispose
();
this
.
removeAction
.
dispose
();
}
}
class
RemoveFromRecentlyOpened
extends
Action
implements
IPickOpenAction
{
...
...
@@ -791,6 +782,7 @@ class RemoveFromRecentlyOpened extends Action implements IPickOpenAction {
static
readonly
LABEL
=
nls
.
localize
(
'
remove
'
,
"
Remove from Recently Opened
"
);
constructor
(
private
path
:
(
IWorkspaceIdentifier
|
ISingleFolderWorkspaceIdentifier
|
string
),
@
IWindowsService
private
windowsService
:
IWindowsService
)
{
super
(
RemoveFromRecentlyOpened
.
ID
,
RemoveFromRecentlyOpened
.
LABEL
);
...
...
@@ -799,7 +791,7 @@ class RemoveFromRecentlyOpened extends Action implements IPickOpenAction {
}
run
(
item
:
IPickOpenItem
):
TPromise
<
boolean
>
{
return
this
.
windowsService
.
removeFromRecentlyOpened
([
item
.
getResource
().
fsP
ath
]).
then
(()
=>
{
return
this
.
windowsService
.
removeFromRecentlyOpened
([
this
.
p
ath
]).
then
(()
=>
{
item
.
remove
();
return
true
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录