Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
309b492c
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,发现更多精彩内容 >>
提交
309b492c
编写于
9月 03, 2019
作者:
B
Benjamin Pasero
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
debt - a bit more strict init
上级
02eb784a
变更
10
隐藏空白更改
内联
并排
Showing
10 changed file
with
44 addition
and
46 deletion
+44
-46
src/vs/workbench/browser/parts/editor/textEditor.ts
src/vs/workbench/browser/parts/editor/textEditor.ts
+1
-1
src/vs/workbench/browser/parts/notifications/notificationsList.ts
...orkbench/browser/parts/notifications/notificationsList.ts
+1
-1
src/vs/workbench/browser/parts/notifications/notificationsToasts.ts
...kbench/browser/parts/notifications/notificationsToasts.ts
+1
-1
src/vs/workbench/browser/parts/statusbar/statusbarPart.ts
src/vs/workbench/browser/parts/statusbar/statusbarPart.ts
+7
-7
src/vs/workbench/common/editor/editorGroup.ts
src/vs/workbench/common/editor/editorGroup.ts
+7
-7
src/vs/workbench/common/editor/textDiffEditorModel.ts
src/vs/workbench/common/editor/textDiffEditorModel.ts
+6
-6
src/vs/workbench/contrib/quickopen/browser/commandsHandler.ts
...vs/workbench/contrib/quickopen/browser/commandsHandler.ts
+1
-1
src/vs/workbench/contrib/search/browser/openAnythingHandler.ts
...s/workbench/contrib/search/browser/openAnythingHandler.ts
+2
-2
src/vs/workbench/contrib/welcome/overlay/browser/welcomeOverlay.ts
...rkbench/contrib/welcome/overlay/browser/welcomeOverlay.ts
+1
-1
src/vs/workbench/services/history/browser/history.ts
src/vs/workbench/services/history/browser/history.ts
+17
-19
未找到文件。
src/vs/workbench/browser/parts/editor/textEditor.ts
浏览文件 @
309b492c
...
...
@@ -39,7 +39,7 @@ export interface IEditorConfiguration {
export
abstract
class
BaseTextEditor
extends
BaseEditor
implements
ITextEditor
{
private
editorControl
:
IEditor
;
private
_editorContainer
:
HTMLElement
;
private
hasPendingConfigurationChange
:
boolean
;
private
hasPendingConfigurationChange
:
boolean
|
undefined
;
private
lastAppliedEditorOptions
?:
IEditorOptions
;
private
editorMemento
:
IEditorMemento
<
IEditorViewState
>
;
...
...
src/vs/workbench/browser/parts/notifications/notificationsList.ts
浏览文件 @
309b492c
...
...
@@ -21,7 +21,7 @@ export class NotificationsList extends Themable {
private
listContainer
:
HTMLElement
;
private
list
:
WorkbenchList
<
INotificationViewItem
>
;
private
viewModel
:
INotificationViewItem
[];
private
isVisible
:
boolean
;
private
isVisible
:
boolean
|
undefined
;
constructor
(
private
container
:
HTMLElement
,
...
...
src/vs/workbench/browser/parts/notifications/notificationsToasts.ts
浏览文件 @
309b492c
...
...
@@ -54,7 +54,7 @@ export class NotificationsToasts extends Themable {
private
notificationsToastsContainer
:
HTMLElement
;
private
workbenchDimensions
:
Dimension
;
private
isNotificationsCenterVisible
:
boolean
;
private
isNotificationsCenterVisible
:
boolean
|
undefined
;
private
mapNotificationToToast
:
Map
<
INotificationViewItem
,
INotificationToast
>
;
private
notificationsToastsVisibleContextKey
:
IContextKey
<
boolean
>
;
...
...
src/vs/workbench/browser/parts/statusbar/statusbarPart.ts
浏览文件 @
309b492c
...
...
@@ -57,7 +57,7 @@ class StatusbarViewModel extends Disposable {
private
readonly
_entries
:
IStatusbarViewModelEntry
[]
=
[];
get
entries
():
IStatusbarViewModelEntry
[]
{
return
this
.
_entries
;
}
private
hidden
:
Set
<
string
>
;
private
hidden
!
:
Set
<
string
>
;
constructor
(
private
storageService
:
IStorageService
)
{
super
();
...
...
@@ -334,14 +334,14 @@ export class StatusbarPart extends Part implements IStatusbarService {
//#endregion
private
styleElement
:
HTMLStyleElement
;
private
styleElement
!
:
HTMLStyleElement
;
private
pendingEntries
:
IPendingStatusbarEntry
[]
=
[];
private
readonly
viewModel
:
StatusbarViewModel
;
private
leftItemsContainer
:
HTMLElement
;
private
rightItemsContainer
:
HTMLElement
;
private
leftItemsContainer
!
:
HTMLElement
;
private
rightItemsContainer
!
:
HTMLElement
;
constructor
(
@
IInstantiationService
private
readonly
instantiationService
:
IInstantiationService
,
...
...
@@ -627,10 +627,10 @@ export class StatusbarPart extends Part implements IStatusbarService {
}
class
StatusbarEntryItem
extends
Disposable
{
private
entry
:
IStatusbarEntry
;
private
entry
!
:
IStatusbarEntry
;
private
labelContainer
:
HTMLElement
;
private
label
:
OcticonLabel
;
private
labelContainer
!
:
HTMLElement
;
private
label
!
:
OcticonLabel
;
private
readonly
foregroundListener
=
this
.
_register
(
new
MutableDisposable
());
private
readonly
backgroundListener
=
this
.
_register
(
new
MutableDisposable
());
...
...
src/vs/workbench/common/editor/editorGroup.ts
浏览文件 @
309b492c
...
...
@@ -88,7 +88,8 @@ export class EditorGroup extends Disposable {
//#endregion
private
_id
:
GroupIdentifier
;
private
_id
!
:
GroupIdentifier
;
get
id
():
GroupIdentifier
{
return
this
.
_id
;
}
private
editors
:
EditorInput
[]
=
[];
private
mru
:
EditorInput
[]
=
[];
...
...
@@ -97,8 +98,8 @@ export class EditorGroup extends Disposable {
private
preview
:
EditorInput
|
null
=
null
;
// editor in preview state
private
active
:
EditorInput
|
null
=
null
;
// editor in active state
private
editorOpenPositioning
:
'
left
'
|
'
right
'
|
'
first
'
|
'
last
'
;
private
focusRecentEditorAfterClose
:
boolean
;
private
editorOpenPositioning
:
(
'
left
'
|
'
right
'
|
'
first
'
|
'
last
'
)
|
undefined
;
private
focusRecentEditorAfterClose
:
boolean
|
undefined
;
constructor
(
labelOrSerializedGroup
:
ISerializedEditorGroup
,
...
...
@@ -126,10 +127,6 @@ export class EditorGroup extends Disposable {
this
.
focusRecentEditorAfterClose
=
this
.
configurationService
.
getValue
(
'
workbench.editor.focusRecentEditorAfterClose
'
);
}
get
id
():
GroupIdentifier
{
return
this
.
_id
;
}
get
count
():
number
{
return
this
.
editors
.
length
;
}
...
...
@@ -689,8 +686,11 @@ export class EditorGroup extends Disposable {
return
null
;
}));
this
.
mru
=
data
.
mru
.
map
(
i
=>
this
.
editors
[
i
]);
this
.
active
=
this
.
mru
[
0
];
if
(
typeof
data
.
preview
===
'
number
'
)
{
this
.
preview
=
this
.
editors
[
data
.
preview
];
}
...
...
src/vs/workbench/common/editor/textDiffEditorModel.ts
浏览文件 @
309b492c
...
...
@@ -14,8 +14,8 @@ import { DiffEditorModel } from 'vs/workbench/common/editor/diffEditorModel';
*/
export
class
TextDiffEditorModel
extends
DiffEditorModel
{
protected
readonly
_originalModel
:
BaseTextEditorModel
;
protected
readonly
_modifiedModel
:
BaseTextEditorModel
;
protected
readonly
_originalModel
:
BaseTextEditorModel
|
null
=
null
;
protected
readonly
_modifiedModel
:
BaseTextEditorModel
|
null
=
null
;
private
_textDiffEditorModel
:
IDiffEditorModel
|
null
=
null
;
...
...
@@ -25,11 +25,11 @@ export class TextDiffEditorModel extends DiffEditorModel {
this
.
updateTextDiffEditorModel
();
}
get
originalModel
():
BaseTextEditorModel
{
get
originalModel
():
BaseTextEditorModel
|
null
{
return
this
.
_originalModel
;
}
get
modifiedModel
():
BaseTextEditorModel
{
get
modifiedModel
():
BaseTextEditorModel
|
null
{
return
this
.
_modifiedModel
;
}
...
...
@@ -42,7 +42,7 @@ export class TextDiffEditorModel extends DiffEditorModel {
}
private
updateTextDiffEditorModel
():
void
{
if
(
this
.
originalModel
.
isResolved
()
&&
this
.
modifiedModel
.
isResolved
())
{
if
(
this
.
originalModel
&&
this
.
originalModel
.
isResolved
()
&&
this
.
modifiedModel
&&
this
.
modifiedModel
.
isResolved
())
{
// Create new
if
(
!
this
.
_textDiffEditorModel
)
{
...
...
@@ -69,7 +69,7 @@ export class TextDiffEditorModel extends DiffEditorModel {
}
isReadonly
():
boolean
{
return
this
.
modifiedModel
.
isReadonly
();
return
!!
this
.
modifiedModel
&&
this
.
modifiedModel
.
isReadonly
();
}
dispose
():
void
{
...
...
src/vs/workbench/contrib/quickopen/browser/commandsHandler.ts
浏览文件 @
309b492c
...
...
@@ -62,7 +62,7 @@ class CommandsHistory extends Disposable {
private
static
readonly
PREF_KEY_CACHE
=
'
commandPalette.mru.cache
'
;
private
static
readonly
PREF_KEY_COUNTER
=
'
commandPalette.mru.counter
'
;
private
commandHistoryLength
:
number
;
private
commandHistoryLength
!
:
number
;
constructor
(
@
IStorageService
private
readonly
storageService
:
IStorageService
,
...
...
src/vs/workbench/contrib/search/browser/openAnythingHandler.ts
浏览文件 @
309b492c
...
...
@@ -41,9 +41,9 @@ export class OpenAnythingHandler extends QuickOpenHandler {
private
openSymbolHandler
:
OpenSymbolHandler
;
private
openFileHandler
:
OpenFileHandler
;
private
searchDelayer
:
ThrottledDelayer
<
QuickOpenModel
|
null
>
;
private
isClosed
:
boolean
;
private
isClosed
:
boolean
|
undefined
;
private
scorerCache
:
ScorerCache
;
private
includeSymbols
:
boolean
;
private
includeSymbols
:
boolean
|
undefined
;
constructor
(
@
INotificationService
private
readonly
notificationService
:
INotificationService
,
...
...
src/vs/workbench/contrib/welcome/overlay/browser/welcomeOverlay.ts
浏览文件 @
309b492c
...
...
@@ -153,7 +153,7 @@ export class HideWelcomeOverlayAction extends Action {
class
WelcomeOverlay
extends
Disposable
{
private
_overlayVisible
:
IContextKey
<
boolean
>
;
private
_overlay
:
HTMLElement
;
private
_overlay
!
:
HTMLElement
;
constructor
(
@
IWorkbenchLayoutService
private
readonly
layoutService
:
IWorkbenchLayoutService
,
...
...
src/vs/workbench/services/history/browser/history.ts
浏览文件 @
309b492c
...
...
@@ -120,9 +120,8 @@ export class HistoryService extends Disposable implements IHistoryService {
private
lastEditLocation
:
IStackEntry
|
undefined
;
private
history
:
Array
<
IEditorInput
|
IResourceInput
>
;
private
history
:
Array
<
IEditorInput
|
IResourceInput
>
|
undefined
;
private
recentlyClosedFiles
:
IRecentlyClosedFile
[];
private
loaded
:
boolean
;
private
resourceFilter
:
ResourceGlobMatcher
;
private
fileInputFactory
:
IFileInputFactory
;
...
...
@@ -155,7 +154,6 @@ export class HistoryService extends Disposable implements IHistoryService {
this
.
lastIndex
=
-
1
;
this
.
stack
=
[];
this
.
recentlyClosedFiles
=
[];
this
.
loaded
=
false
;
this
.
resourceFilter
=
this
.
_register
(
instantiationService
.
createInstance
(
ResourceGlobMatcher
,
(
root
?:
URI
)
=>
this
.
getExcludes
(
root
),
...
...
@@ -489,17 +487,17 @@ export class HistoryService extends Disposable implements IHistoryService {
return
;
}
this
.
ensureHistoryLoaded
();
const
history
=
this
.
ensureHistoryLoaded
();
const
historyInput
=
this
.
preferResourceInput
(
input
);
// Remove any existing entry and add to the beginning
this
.
removeFromHistory
(
input
);
this
.
history
.
unshift
(
historyInput
);
history
.
unshift
(
historyInput
);
// Respect max entries setting
if
(
this
.
history
.
length
>
HistoryService
.
MAX_HISTORY_ITEMS
)
{
this
.
clearOnEditorDispose
(
this
.
history
.
pop
()
!
,
this
.
editorHistoryListeners
);
if
(
history
.
length
>
HistoryService
.
MAX_HISTORY_ITEMS
)
{
this
.
clearOnEditorDispose
(
history
.
pop
()
!
,
this
.
editorHistoryListeners
);
}
// Remove this from the history unless the history input is a resource
...
...
@@ -555,9 +553,9 @@ export class HistoryService extends Disposable implements IHistoryService {
}
private
removeExcludedFromHistory
():
void
{
this
.
ensureHistoryLoaded
();
const
history
=
this
.
ensureHistoryLoaded
();
this
.
history
=
this
.
history
.
filter
(
e
=>
{
this
.
history
=
history
.
filter
(
e
=>
{
const
include
=
this
.
include
(
e
);
// Cleanup any listeners associated with the input when removing from history
...
...
@@ -570,9 +568,9 @@ export class HistoryService extends Disposable implements IHistoryService {
}
private
removeFromHistory
(
arg1
:
IEditorInput
|
IResourceInput
|
FileChangesEvent
):
void
{
this
.
ensureHistoryLoaded
();
const
history
=
this
.
ensureHistoryLoaded
();
this
.
history
=
this
.
history
.
filter
(
e
=>
{
this
.
history
=
history
.
filter
(
e
=>
{
const
matches
=
this
.
matches
(
arg1
,
e
);
// Cleanup any listeners associated with the input when removing from history
...
...
@@ -849,17 +847,17 @@ export class HistoryService extends Disposable implements IHistoryService {
}
getHistory
():
Array
<
IEditorInput
|
IResourceInput
>
{
this
.
ensureHistoryLoaded
();
const
history
=
this
.
ensureHistoryLoaded
();
return
this
.
history
.
slice
(
0
);
return
history
.
slice
(
0
);
}
private
ensureHistoryLoaded
():
void
{
if
(
!
this
.
loaded
)
{
this
.
loadHistory
();
private
ensureHistoryLoaded
():
Array
<
IEditorInput
|
IResourceInput
>
{
if
(
!
this
.
history
)
{
this
.
history
=
this
.
loadHistory
();
}
this
.
loaded
=
true
;
return
this
.
history
;
}
private
saveState
():
void
{
...
...
@@ -893,7 +891,7 @@ export class HistoryService extends Disposable implements IHistoryService {
this
.
storageService
.
store
(
HistoryService
.
STORAGE_KEY
,
JSON
.
stringify
(
entries
),
StorageScope
.
WORKSPACE
);
}
private
loadHistory
():
void
{
private
loadHistory
():
Array
<
IEditorInput
|
IResourceInput
>
{
let
entries
:
ISerializedEditorHistoryEntry
[]
=
[];
const
entriesRaw
=
this
.
storageService
.
get
(
HistoryService
.
STORAGE_KEY
,
StorageScope
.
WORKSPACE
);
...
...
@@ -903,7 +901,7 @@ export class HistoryService extends Disposable implements IHistoryService {
const
registry
=
Registry
.
as
<
IEditorInputFactoryRegistry
>
(
EditorExtensions
.
EditorInputFactories
);
this
.
history
=
coalesce
(
entries
.
map
(
entry
=>
{
return
coalesce
(
entries
.
map
(
entry
=>
{
try
{
return
this
.
safeLoadHistoryEntry
(
registry
,
entry
);
}
catch
(
error
)
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录