Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
掘金者说
vscode
提交
2a18cb8e
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,发现更多精彩内容 >>
提交
2a18cb8e
编写于
7月 12, 2017
作者:
B
Benjamin Pasero
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
recently opened: some renames
上级
0373d29d
变更
15
隐藏空白更改
内联
并排
Showing
15 changed file
with
81 addition
and
82 deletion
+81
-82
src/vs/code/electron-main/app.ts
src/vs/code/electron-main/app.ts
+1
-1
src/vs/code/electron-main/menus.ts
src/vs/code/electron-main/menus.ts
+3
-3
src/vs/code/electron-main/windows.ts
src/vs/code/electron-main/windows.ts
+5
-5
src/vs/platform/history/electron-main/historyMainService.ts
src/vs/platform/history/electron-main/historyMainService.ts
+28
-29
src/vs/platform/windows/common/windows.ts
src/vs/platform/windows/common/windows.ts
+5
-5
src/vs/platform/windows/common/windowsIpc.ts
src/vs/platform/windows/common/windowsIpc.ts
+16
-16
src/vs/platform/windows/electron-browser/windowService.ts
src/vs/platform/windows/electron-browser/windowService.ts
+2
-2
src/vs/platform/windows/electron-main/windowsService.ts
src/vs/platform/windows/electron-main/windowsService.ts
+8
-8
src/vs/workbench/browser/parts/editor/editorActions.ts
src/vs/workbench/browser/parts/editor/editorActions.ts
+1
-1
src/vs/workbench/browser/parts/editor/editorGroupsControl.ts
src/vs/workbench/browser/parts/editor/editorGroupsControl.ts
+1
-1
src/vs/workbench/browser/parts/editor/tabsTitleControl.ts
src/vs/workbench/browser/parts/editor/tabsTitleControl.ts
+1
-1
src/vs/workbench/electron-browser/actions.ts
src/vs/workbench/electron-browser/actions.ts
+1
-1
src/vs/workbench/parts/welcome/page/electron-browser/welcomePage.ts
...kbench/parts/welcome/page/electron-browser/welcomePage.ts
+1
-1
src/vs/workbench/services/history/browser/history.ts
src/vs/workbench/services/history/browser/history.ts
+3
-3
src/vs/workbench/test/workbenchTestServices.ts
src/vs/workbench/test/workbenchTestServices.ts
+5
-5
未找到文件。
src/vs/code/electron-main/app.ts
浏览文件 @
2a18cb8e
...
...
@@ -385,7 +385,7 @@ export class CodeApplication {
// Jump List
this
.
historyService
.
updateWindowsJumpList
();
this
.
historyService
.
onRecent
Paths
Change
(()
=>
this
.
historyService
.
updateWindowsJumpList
());
this
.
historyService
.
onRecent
lyOpened
Change
(()
=>
this
.
historyService
.
updateWindowsJumpList
());
// Start shared process here
this
.
sharedProcess
.
spawn
();
...
...
src/vs/code/electron-main/menus.ts
浏览文件 @
2a18cb8e
...
...
@@ -100,7 +100,7 @@ export class CodeMenu {
// Listen to some events from window service
this
.
windowsService
.
onPathsOpen
(
paths
=>
this
.
updateMenu
());
this
.
historyService
.
onRecent
Paths
Change
(
paths
=>
this
.
updateMenu
());
this
.
historyService
.
onRecent
lyOpened
Change
(
paths
=>
this
.
updateMenu
());
this
.
windowsService
.
onWindowClose
(
_
=>
this
.
onClose
(
this
.
windowsService
.
getWindowCount
()));
// Listen to extension viewlets
...
...
@@ -428,7 +428,7 @@ export class CodeMenu {
private
setOpenRecentMenu
(
openRecentMenu
:
Electron
.
Menu
):
void
{
openRecentMenu
.
append
(
this
.
createMenuItem
(
nls
.
localize
({
key
:
'
miReopenClosedEditor
'
,
comment
:
[
'
&& denotes a mnemonic
'
]
},
"
&&Reopen Closed Editor
"
),
'
workbench.action.reopenClosedEditor
'
));
const
{
folders
,
files
}
=
this
.
historyService
.
getRecent
PathsList
();
const
{
folders
,
files
}
=
this
.
historyService
.
getRecent
lyOpened
();
// Folders
if
(
folders
.
length
>
0
)
{
...
...
@@ -462,7 +462,7 @@ export class CodeMenu {
const
openInNewWindow
=
this
.
isOptionClick
(
event
);
const
success
=
this
.
windowsService
.
open
({
context
:
OpenContext
.
MENU
,
cli
:
this
.
environmentService
.
args
,
pathsToOpen
:
[
path
],
forceNewWindow
:
openInNewWindow
}).
length
>
0
;
if
(
!
success
)
{
this
.
historyService
.
removeFromRecent
PathsList
(
path
);
this
.
historyService
.
removeFromRecent
lyOpened
(
path
);
}
}
},
false
));
...
...
src/vs/code/electron-main/windows.ts
浏览文件 @
2a18cb8e
...
...
@@ -343,16 +343,16 @@ export class WindowsManager implements IWindowsMainService {
// Remember in recent document list (unless this opens for extension development)
// Also do not add paths when files are opened for diffing, only if opened individually
if
(
!
usedWindows
.
some
(
w
=>
w
.
isExtensionDevelopmentHost
)
&&
!
openConfig
.
cli
.
diff
)
{
const
recent
Paths
:
{
path
:
string
;
isFile
?:
boolean
;
}[]
=
[];
const
recent
lyOpened
:
{
path
:
string
;
isFile
?:
boolean
;
}[]
=
[];
windowsToOpen
.
forEach
(
win
=>
{
if
(
win
.
filePath
||
win
.
folderPath
)
{
recent
Paths
.
push
({
path
:
win
.
filePath
||
win
.
folderPath
,
isFile
:
!!
win
.
filePath
});
recent
lyOpened
.
push
({
path
:
win
.
filePath
||
win
.
folderPath
,
isFile
:
!!
win
.
filePath
});
}
});
if
(
recent
Paths
.
length
)
{
this
.
historyService
.
addToRecent
PathsList
(
recentPaths
);
if
(
recent
lyOpened
.
length
)
{
this
.
historyService
.
addToRecent
lyOpened
(
recentlyOpened
);
}
}
...
...
@@ -777,7 +777,7 @@ export class WindowsManager implements IWindowsMainService {
};
}
}
catch
(
error
)
{
this
.
historyService
.
removeFromRecent
PathsList
(
candidate
);
// since file does not seem to exist anymore, remove from recent
this
.
historyService
.
removeFromRecent
lyOpened
(
candidate
);
// since file does not seem to exist anymore, remove from recent
if
(
ignoreFileNotFound
)
{
return
{
filePath
:
candidate
,
createFilePath
:
true
};
// assume this is a file that does not yet exist
...
...
src/vs/platform/history/electron-main/historyMainService.ts
浏览文件 @
2a18cb8e
...
...
@@ -20,7 +20,7 @@ import { isWindows, isMacintosh, isLinux } from 'vs/base/common/platform';
export
const
IHistoryMainService
=
createDecorator
<
IHistoryMainService
>
(
'
historyMainService
'
);
export
interface
IRecent
PathsList
{
export
interface
IRecent
lyOpened
{
folders
:
string
[];
files
:
string
[];
}
...
...
@@ -29,15 +29,14 @@ export interface IHistoryMainService {
_serviceBrand
:
any
;
// events
onRecent
Paths
Change
:
CommonEvent
<
void
>
;
onRecent
lyOpened
Change
:
CommonEvent
<
void
>
;
// methods
addToRecentPathsList
(
paths
:
{
path
:
string
;
isFile
?:
boolean
;
}[]):
void
;
getRecentPathsList
(
folderPath
?:
string
,
filesToOpen
?:
IPath
[]):
IRecentPathsList
;
removeFromRecentPathsList
(
path
:
string
):
void
;
removeFromRecentPathsList
(
paths
:
string
[]):
void
;
clearRecentPathsList
():
void
;
addToRecentlyOpened
(
paths
:
{
path
:
string
;
isFile
?:
boolean
;
}[]):
void
;
getRecentlyOpened
(
folderPath
?:
string
,
filesToOpen
?:
IPath
[]):
IRecentlyOpened
;
removeFromRecentlyOpened
(
path
:
string
):
void
;
removeFromRecentlyOpened
(
paths
:
string
[]):
void
;
clearRecentlyOpened
():
void
;
updateWindowsJumpList
():
void
;
}
...
...
@@ -45,12 +44,12 @@ export class HistoryMainService implements IHistoryMainService {
private
static
MAX_TOTAL_RECENT_ENTRIES
=
100
;
private
static
recent
PathsList
StorageKey
=
'
openedPathsList
'
;
private
static
recent
lyOpened
StorageKey
=
'
openedPathsList
'
;
_serviceBrand
:
any
;
private
_onRecent
Paths
Change
=
new
Emitter
<
void
>
();
onRecent
PathsChange
:
CommonEvent
<
void
>
=
this
.
_onRecentPaths
Change
.
event
;
private
_onRecent
lyOpened
Change
=
new
Emitter
<
void
>
();
onRecent
lyOpenedChange
:
CommonEvent
<
void
>
=
this
.
_onRecentlyOpened
Change
.
event
;
constructor
(
@
IStorageService
private
storageService
:
IStorageService
,
...
...
@@ -58,12 +57,12 @@ export class HistoryMainService implements IHistoryMainService {
)
{
}
public
addToRecent
PathsList
(
paths
:
{
path
:
string
;
isFile
?:
boolean
;
}[]):
void
{
public
addToRecent
lyOpened
(
paths
:
{
path
:
string
;
isFile
?:
boolean
;
}[]):
void
{
if
(
!
paths
||
!
paths
.
length
)
{
return
;
}
const
mru
=
this
.
getRecent
PathsList
();
const
mru
=
this
.
getRecent
lyOpened
();
paths
.
forEach
(
p
=>
{
const
{
path
,
isFile
}
=
p
;
...
...
@@ -85,13 +84,13 @@ export class HistoryMainService implements IHistoryMainService {
}
});
this
.
storageService
.
setItem
(
HistoryMainService
.
recent
PathsList
StorageKey
,
mru
);
this
.
_onRecent
Paths
Change
.
fire
();
this
.
storageService
.
setItem
(
HistoryMainService
.
recent
lyOpened
StorageKey
,
mru
);
this
.
_onRecent
lyOpened
Change
.
fire
();
}
public
removeFromRecent
PathsList
(
path
:
string
):
void
;
public
removeFromRecent
PathsList
(
paths
:
string
[]):
void
;
public
removeFromRecent
PathsList
(
arg1
:
any
):
void
{
public
removeFromRecent
lyOpened
(
path
:
string
):
void
;
public
removeFromRecent
lyOpened
(
paths
:
string
[]):
void
;
public
removeFromRecent
lyOpened
(
arg1
:
any
):
void
{
let
paths
:
string
[];
if
(
Array
.
isArray
(
arg1
))
{
paths
=
arg1
;
...
...
@@ -99,7 +98,7 @@ export class HistoryMainService implements IHistoryMainService {
paths
=
[
arg1
];
}
const
mru
=
this
.
getRecent
PathsList
();
const
mru
=
this
.
getRecent
lyOpened
();
let
update
=
false
;
paths
.
forEach
(
path
=>
{
...
...
@@ -117,25 +116,25 @@ export class HistoryMainService implements IHistoryMainService {
});
if
(
update
)
{
this
.
storageService
.
setItem
(
HistoryMainService
.
recent
PathsList
StorageKey
,
mru
);
this
.
_onRecent
Paths
Change
.
fire
();
this
.
storageService
.
setItem
(
HistoryMainService
.
recent
lyOpened
StorageKey
,
mru
);
this
.
_onRecent
lyOpened
Change
.
fire
();
}
}
public
clearRecent
PathsList
():
void
{
this
.
storageService
.
setItem
(
HistoryMainService
.
recent
PathsList
StorageKey
,
{
folders
:
[],
files
:
[]
});
public
clearRecent
lyOpened
():
void
{
this
.
storageService
.
setItem
(
HistoryMainService
.
recent
lyOpened
StorageKey
,
{
folders
:
[],
files
:
[]
});
app
.
clearRecentDocuments
();
// Event
this
.
_onRecent
Paths
Change
.
fire
();
this
.
_onRecent
lyOpened
Change
.
fire
();
}
public
getRecent
PathsList
(
folderPath
?:
string
,
filesToOpen
?:
IPath
[]):
IRecentPathsList
{
public
getRecent
lyOpened
(
folderPath
?:
string
,
filesToOpen
?:
IPath
[]):
IRecentlyOpened
{
let
files
:
string
[];
let
folders
:
string
[];
// Get from storage
const
storedRecents
=
this
.
storageService
.
getItem
<
IRecent
PathsList
>
(
HistoryMainService
.
recentPathsList
StorageKey
);
const
storedRecents
=
this
.
storageService
.
getItem
<
IRecent
lyOpened
>
(
HistoryMainService
.
recentlyOpened
StorageKey
);
if
(
storedRecents
)
{
files
=
storedRecents
.
files
||
[];
folders
=
storedRecents
.
folders
||
[];
...
...
@@ -185,19 +184,19 @@ export class HistoryMainService implements IHistoryMainService {
});
// Recent Folders
if
(
this
.
getRecent
PathsList
().
folders
.
length
>
0
)
{
if
(
this
.
getRecent
lyOpened
().
folders
.
length
>
0
)
{
// The user might have meanwhile removed items from the jump list and we have to respect that
// so we need to update our list of recent paths with the choice of the user to not add them again
// Also: Windows will not show our custom category at all if there is any entry which was removed
// by the user! See https://github.com/Microsoft/vscode/issues/15052
this
.
removeFromRecent
PathsList
(
app
.
getJumpListSettings
().
removedItems
.
map
(
r
=>
trim
(
r
.
args
,
'
"
'
)));
this
.
removeFromRecent
lyOpened
(
app
.
getJumpListSettings
().
removedItems
.
map
(
r
=>
trim
(
r
.
args
,
'
"
'
)));
// Add entries
jumpList
.
push
({
type
:
'
custom
'
,
name
:
nls
.
localize
(
'
recentFolders
'
,
"
Recent Folders
"
),
items
:
this
.
getRecent
PathsList
().
folders
.
slice
(
0
,
7
/* limit number of entries here */
).
map
(
folder
=>
{
items
:
this
.
getRecent
lyOpened
().
folders
.
slice
(
0
,
7
/* limit number of entries here */
).
map
(
folder
=>
{
return
<
Electron
.
JumpListItem
>
{
type
:
'
task
'
,
title
:
path
.
basename
(
folder
)
||
folder
,
// use the base name to show shorter entries in the list
...
...
src/vs/platform/windows/common/windows.ts
浏览文件 @
2a18cb8e
...
...
@@ -32,10 +32,10 @@ export interface IWindowsService {
closeFolder
(
windowId
:
number
):
TPromise
<
void
>
;
toggleFullScreen
(
windowId
:
number
):
TPromise
<
void
>
;
setRepresentedFilename
(
windowId
:
number
,
fileName
:
string
):
TPromise
<
void
>
;
addToRecentlyOpen
(
paths
:
{
path
:
string
,
isFile
?:
boolean
}[]):
TPromise
<
void
>
;
removeFromRecentlyOpen
(
paths
:
string
[]):
TPromise
<
void
>
;
clearRecent
PathsList
():
TPromise
<
void
>
;
getRecentlyOpen
(
windowId
:
number
):
TPromise
<
{
files
:
string
[];
folders
:
string
[];
}
>
;
addToRecentlyOpen
ed
(
paths
:
{
path
:
string
,
isFile
?:
boolean
}[]):
TPromise
<
void
>
;
removeFromRecentlyOpen
ed
(
paths
:
string
[]):
TPromise
<
void
>
;
clearRecent
lyOpened
():
TPromise
<
void
>
;
getRecentlyOpen
ed
(
windowId
:
number
):
TPromise
<
{
files
:
string
[];
folders
:
string
[];
}
>
;
focusWindow
(
windowId
:
number
):
TPromise
<
void
>
;
closeWindow
(
windowId
:
number
):
TPromise
<
void
>
;
isFocused
(
windowId
:
number
):
TPromise
<
boolean
>
;
...
...
@@ -87,7 +87,7 @@ export interface IWindowService {
closeFolder
():
TPromise
<
void
>
;
toggleFullScreen
():
TPromise
<
void
>
;
setRepresentedFilename
(
fileName
:
string
):
TPromise
<
void
>
;
getRecentlyOpen
():
TPromise
<
{
files
:
string
[];
folders
:
string
[];
}
>
;
getRecentlyOpen
ed
():
TPromise
<
{
files
:
string
[];
folders
:
string
[];
}
>
;
focusWindow
():
TPromise
<
void
>
;
closeWindow
():
TPromise
<
void
>
;
isFocused
():
TPromise
<
boolean
>
;
...
...
src/vs/platform/windows/common/windowsIpc.ts
浏览文件 @
2a18cb8e
...
...
@@ -23,10 +23,10 @@ export interface IWindowsChannel extends IChannel {
call
(
command
:
'
closeFolder
'
,
arg
:
number
):
TPromise
<
void
>
;
call
(
command
:
'
toggleFullScreen
'
,
arg
:
number
):
TPromise
<
void
>
;
call
(
command
:
'
setRepresentedFilename
'
,
arg
:
[
number
,
string
]):
TPromise
<
void
>
;
call
(
command
:
'
addToRecentlyOpen
'
,
arg
:
{
path
:
string
,
isFile
?:
boolean
}[]):
TPromise
<
void
>
;
call
(
command
:
'
removeFromRecentlyOpen
'
,
arg
:
string
[]):
TPromise
<
void
>
;
call
(
command
:
'
clearRecent
PathsList
'
):
TPromise
<
void
>
;
call
(
command
:
'
getRecentlyOpen
'
,
arg
:
number
):
TPromise
<
{
files
:
string
[];
folders
:
string
[];
}
>
;
call
(
command
:
'
addToRecentlyOpen
ed
'
,
arg
:
{
path
:
string
,
isFile
?:
boolean
}[]):
TPromise
<
void
>
;
call
(
command
:
'
removeFromRecentlyOpen
ed
'
,
arg
:
string
[]):
TPromise
<
void
>
;
call
(
command
:
'
clearRecent
lyOpened
'
):
TPromise
<
void
>
;
call
(
command
:
'
getRecentlyOpen
ed
'
,
arg
:
number
):
TPromise
<
{
files
:
string
[];
folders
:
string
[];
}
>
;
call
(
command
:
'
focusWindow
'
,
arg
:
number
):
TPromise
<
void
>
;
call
(
command
:
'
closeWindow
'
,
arg
:
number
):
TPromise
<
void
>
;
call
(
command
:
'
isFocused
'
,
arg
:
number
):
TPromise
<
boolean
>
;
...
...
@@ -76,10 +76,10 @@ export class WindowsChannel implements IWindowsChannel {
case
'
closeFolder
'
:
return
this
.
service
.
closeFolder
(
arg
);
case
'
toggleFullScreen
'
:
return
this
.
service
.
toggleFullScreen
(
arg
);
case
'
setRepresentedFilename
'
:
return
this
.
service
.
setRepresentedFilename
(
arg
[
0
],
arg
[
1
]);
case
'
addToRecentlyOpen
'
:
return
this
.
service
.
addToRecentlyOpen
(
arg
);
case
'
removeFromRecentlyOpen
'
:
return
this
.
service
.
removeFromRecentlyOpen
(
arg
);
case
'
clearRecent
PathsList
'
:
return
this
.
service
.
clearRecentPathsList
();
case
'
getRecentlyOpen
'
:
return
this
.
service
.
getRecentlyOpen
(
arg
);
case
'
addToRecentlyOpen
ed
'
:
return
this
.
service
.
addToRecentlyOpened
(
arg
);
case
'
removeFromRecentlyOpen
ed
'
:
return
this
.
service
.
removeFromRecentlyOpened
(
arg
);
case
'
clearRecent
lyOpened
'
:
return
this
.
service
.
clearRecentlyOpened
();
case
'
getRecentlyOpen
ed
'
:
return
this
.
service
.
getRecentlyOpened
(
arg
);
case
'
focusWindow
'
:
return
this
.
service
.
focusWindow
(
arg
);
case
'
closeWindow
'
:
return
this
.
service
.
closeWindow
(
arg
);
case
'
isFocused
'
:
return
this
.
service
.
isFocused
(
arg
);
...
...
@@ -159,20 +159,20 @@ export class WindowsChannelClient implements IWindowsService {
return
this
.
channel
.
call
(
'
setRepresentedFilename
'
,
[
windowId
,
fileName
]);
}
addToRecentlyOpen
(
paths
:
{
path
:
string
,
isFile
?:
boolean
}[]):
TPromise
<
void
>
{
return
this
.
channel
.
call
(
'
addToRecentlyOpen
'
,
paths
);
addToRecentlyOpen
ed
(
paths
:
{
path
:
string
,
isFile
?:
boolean
}[]):
TPromise
<
void
>
{
return
this
.
channel
.
call
(
'
addToRecentlyOpen
ed
'
,
paths
);
}
removeFromRecentlyOpen
(
paths
:
string
[]):
TPromise
<
void
>
{
return
this
.
channel
.
call
(
'
removeFromRecentlyOpen
'
,
paths
);
removeFromRecentlyOpen
ed
(
paths
:
string
[]):
TPromise
<
void
>
{
return
this
.
channel
.
call
(
'
removeFromRecentlyOpen
ed
'
,
paths
);
}
clearRecent
PathsList
():
TPromise
<
void
>
{
return
this
.
channel
.
call
(
'
clearRecent
PathsList
'
);
clearRecent
lyOpened
():
TPromise
<
void
>
{
return
this
.
channel
.
call
(
'
clearRecent
lyOpened
'
);
}
getRecentlyOpen
(
windowId
:
number
):
TPromise
<
{
files
:
string
[];
folders
:
string
[];
}
>
{
return
this
.
channel
.
call
(
'
getRecentlyOpen
'
,
windowId
);
getRecentlyOpen
ed
(
windowId
:
number
):
TPromise
<
{
files
:
string
[];
folders
:
string
[];
}
>
{
return
this
.
channel
.
call
(
'
getRecentlyOpen
ed
'
,
windowId
);
}
focusWindow
(
windowId
:
number
):
TPromise
<
void
>
{
...
...
src/vs/platform/windows/electron-browser/windowService.ts
浏览文件 @
2a18cb8e
...
...
@@ -67,8 +67,8 @@ export class WindowService implements IWindowService {
return
this
.
windowsService
.
setRepresentedFilename
(
this
.
windowId
,
fileName
);
}
getRecentlyOpen
():
TPromise
<
{
files
:
string
[];
folders
:
string
[];
}
>
{
return
this
.
windowsService
.
getRecentlyOpen
(
this
.
windowId
);
getRecentlyOpen
ed
():
TPromise
<
{
files
:
string
[];
folders
:
string
[];
}
>
{
return
this
.
windowsService
.
getRecentlyOpen
ed
(
this
.
windowId
);
}
focusWindow
():
TPromise
<
void
>
{
...
...
src/vs/platform/windows/electron-main/windowsService.ts
浏览文件 @
2a18cb8e
...
...
@@ -139,28 +139,28 @@ export class WindowsService implements IWindowsService, IDisposable {
return
TPromise
.
as
(
null
);
}
addToRecentlyOpen
(
paths
:
{
path
:
string
,
isFile
?:
boolean
}[]):
TPromise
<
void
>
{
this
.
historyService
.
addToRecent
PathsList
(
paths
);
addToRecentlyOpen
ed
(
paths
:
{
path
:
string
,
isFile
?:
boolean
}[]):
TPromise
<
void
>
{
this
.
historyService
.
addToRecent
lyOpened
(
paths
);
return
TPromise
.
as
(
null
);
}
removeFromRecentlyOpen
(
paths
:
string
[]):
TPromise
<
void
>
{
this
.
historyService
.
removeFromRecent
PathsList
(
paths
);
removeFromRecentlyOpen
ed
(
paths
:
string
[]):
TPromise
<
void
>
{
this
.
historyService
.
removeFromRecent
lyOpened
(
paths
);
return
TPromise
.
as
(
null
);
}
clearRecent
PathsList
():
TPromise
<
void
>
{
this
.
historyService
.
clearRecent
PathsList
();
clearRecent
lyOpened
():
TPromise
<
void
>
{
this
.
historyService
.
clearRecent
lyOpened
();
return
TPromise
.
as
(
null
);
}
getRecentlyOpen
(
windowId
:
number
):
TPromise
<
{
files
:
string
[];
folders
:
string
[];
}
>
{
getRecentlyOpen
ed
(
windowId
:
number
):
TPromise
<
{
files
:
string
[];
folders
:
string
[];
}
>
{
const
codeWindow
=
this
.
windowsMainService
.
getWindowById
(
windowId
);
if
(
codeWindow
)
{
const
{
files
,
folders
}
=
this
.
historyService
.
getRecent
PathsList
(
codeWindow
.
config
.
folderPath
,
codeWindow
.
config
.
filesToOpen
);
const
{
files
,
folders
}
=
this
.
historyService
.
getRecent
lyOpened
(
codeWindow
.
config
.
folderPath
,
codeWindow
.
config
.
filesToOpen
);
return
TPromise
.
as
({
files
,
folders
});
}
...
...
src/vs/workbench/browser/parts/editor/editorActions.ts
浏览文件 @
2a18cb8e
...
...
@@ -1150,7 +1150,7 @@ export class ClearRecentFilesAction extends Action {
}
public
run
():
TPromise
<
any
>
{
this
.
windowsService
.
clearRecent
PathsList
();
this
.
windowsService
.
clearRecent
lyOpened
();
return
TPromise
.
as
(
false
);
}
...
...
src/vs/workbench/browser/parts/editor/editorGroupsControl.ts
浏览文件 @
2a18cb8e
...
...
@@ -1118,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
.
windowsService
.
addToRecentlyOpen
(
externalResources
.
map
(
resource
=>
{
$this
.
windowsService
.
addToRecentlyOpen
ed
(
externalResources
.
map
(
resource
=>
{
return
{
path
:
resource
.
fsPath
,
isFile
:
true
...
...
src/vs/workbench/browser/parts/editor/tabsTitleControl.ts
浏览文件 @
2a18cb8e
...
...
@@ -691,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
.
windowsService
.
addToRecentlyOpen
(
externalResources
.
map
(
resource
=>
{
this
.
windowsService
.
addToRecentlyOpen
ed
(
externalResources
.
map
(
resource
=>
{
return
{
path
:
resource
.
fsPath
,
isFile
:
true
...
...
src/vs/workbench/electron-browser/actions.ts
浏览文件 @
2a18cb8e
...
...
@@ -663,7 +663,7 @@ export abstract class BaseOpenRecentAction extends Action {
protected
abstract
isQuickNavigate
():
boolean
;
public
run
():
TPromise
<
void
>
{
return
this
.
windowService
.
getRecentlyOpen
()
return
this
.
windowService
.
getRecentlyOpen
ed
()
.
then
(({
files
,
folders
})
=>
this
.
openRecent
(
files
,
folders
));
}
...
...
src/vs/workbench/parts/welcome/page/electron-browser/welcomePage.ts
浏览文件 @
2a18cb8e
...
...
@@ -188,7 +188,7 @@ class WelcomePage {
}
private
create
()
{
const
recentlyOpened
=
this
.
windowService
.
getRecentlyOpen
();
const
recentlyOpened
=
this
.
windowService
.
getRecentlyOpen
ed
();
const
installedExtensions
=
this
.
instantiationService
.
invokeFunction
(
getInstalledExtensions
);
const
uri
=
URI
.
parse
(
require
.
toUrl
(
'
./vs_code_welcome_page
'
))
.
with
({
...
...
src/vs/workbench/services/history/browser/history.ts
浏览文件 @
2a18cb8e
...
...
@@ -395,7 +395,7 @@ export class HistoryService extends BaseHistoryService implements IHistoryServic
this
.
removeFromHistory
(
arg1
);
this
.
removeFromStack
(
arg1
);
this
.
removeFromRecentlyClosedFiles
(
arg1
);
this
.
removeFromRecentlyOpen
(
arg1
);
this
.
removeFromRecentlyOpen
ed
(
arg1
);
}
private
removeExcludedFromHistory
():
void
{
...
...
@@ -568,14 +568,14 @@ export class HistoryService extends BaseHistoryService implements IHistoryServic
this
.
recentlyClosedFiles
=
this
.
recentlyClosedFiles
.
filter
(
e
=>
!
this
.
matchesFile
(
e
.
resource
,
arg1
));
}
private
removeFromRecentlyOpen
(
arg1
:
IEditorInput
|
IResourceInput
|
FileChangesEvent
):
void
{
private
removeFromRecentlyOpen
ed
(
arg1
:
IEditorInput
|
IResourceInput
|
FileChangesEvent
):
void
{
if
(
arg1
instanceof
EditorInput
||
arg1
instanceof
FileChangesEvent
)
{
return
;
// for now do not delete from file events since recently open are likely out of workspace files for which there are no delete events
}
const
input
=
arg1
as
IResourceInput
;
this
.
windowService
.
removeFromRecentlyOpen
([
input
.
resource
.
fsPath
]);
this
.
windowService
.
removeFromRecentlyOpen
ed
([
input
.
resource
.
fsPath
]);
}
private
isFileOpened
(
resource
:
URI
,
group
:
IEditorGroup
):
boolean
{
...
...
src/vs/workbench/test/workbenchTestServices.ts
浏览文件 @
2a18cb8e
...
...
@@ -889,7 +889,7 @@ export class TestWindowService implements IWindowService {
return
TPromise
.
as
(
void
0
);
}
getRecentlyOpen
():
TPromise
<
{
files
:
string
[];
folders
:
string
[];
}
>
{
getRecentlyOpen
ed
():
TPromise
<
{
files
:
string
[];
folders
:
string
[];
}
>
{
return
TPromise
.
as
(
void
0
);
}
...
...
@@ -1017,19 +1017,19 @@ export class TestWindowsService implements IWindowsService {
return
TPromise
.
as
(
void
0
);
}
addToRecentlyOpen
(
paths
:
{
path
:
string
,
isFile
?:
boolean
}[]):
TPromise
<
void
>
{
addToRecentlyOpen
ed
(
paths
:
{
path
:
string
,
isFile
?:
boolean
}[]):
TPromise
<
void
>
{
return
TPromise
.
as
(
void
0
);
}
removeFromRecentlyOpen
(
paths
:
string
[]):
TPromise
<
void
>
{
removeFromRecentlyOpen
ed
(
paths
:
string
[]):
TPromise
<
void
>
{
return
TPromise
.
as
(
void
0
);
}
clearRecent
PathsList
():
TPromise
<
void
>
{
clearRecent
lyOpened
():
TPromise
<
void
>
{
return
TPromise
.
as
(
void
0
);
}
getRecentlyOpen
(
windowId
:
number
):
TPromise
<
{
files
:
string
[];
folders
:
string
[];
}
>
{
getRecentlyOpen
ed
(
windowId
:
number
):
TPromise
<
{
files
:
string
[];
folders
:
string
[];
}
>
{
return
TPromise
.
as
(
void
0
);
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录