Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
掘金者说
vscode
提交
c283296b
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,发现更多精彩内容 >>
提交
c283296b
编写于
2月 15, 2019
作者:
M
Matt Bierner
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Strict null work
上级
597e6dc4
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
42 addition
and
20 deletion
+42
-20
src/vs/base/browser/ui/breadcrumbs/breadcrumbsWidget.ts
src/vs/base/browser/ui/breadcrumbs/breadcrumbsWidget.ts
+4
-4
src/vs/workbench/browser/parts/activitybar/activitybarActions.ts
...workbench/browser/parts/activitybar/activitybarActions.ts
+1
-1
src/vs/workbench/browser/parts/editor/breadcrumbsControl.ts
src/vs/workbench/browser/parts/editor/breadcrumbsControl.ts
+29
-8
src/vs/workbench/browser/parts/editor/editorActions.ts
src/vs/workbench/browser/parts/editor/editorActions.ts
+1
-1
src/vs/workbench/contrib/markers/electron-browser/markersPanel.ts
...orkbench/contrib/markers/electron-browser/markersPanel.ts
+6
-5
src/vs/workbench/contrib/scm/electron-browser/scm.contribution.ts
...orkbench/contrib/scm/electron-browser/scm.contribution.ts
+1
-1
未找到文件。
src/vs/base/browser/ui/breadcrumbs/breadcrumbsWidget.ts
浏览文件 @
c283296b
...
...
@@ -200,8 +200,8 @@ export class BreadcrumbsWidget {
return
this
.
_items
[
this
.
_focusedItemIdx
];
}
setFocused
(
item
:
BreadcrumbsItem
,
payload
?:
any
):
void
{
this
.
_focus
(
this
.
_items
.
indexOf
(
item
),
payload
);
setFocused
(
item
:
BreadcrumbsItem
|
undefined
,
payload
?:
any
):
void
{
this
.
_focus
(
this
.
_items
.
indexOf
(
item
!
),
payload
);
}
focusPrev
(
payload
?:
any
):
any
{
...
...
@@ -256,8 +256,8 @@ export class BreadcrumbsWidget {
return
this
.
_items
[
this
.
_selectedItemIdx
];
}
setSelection
(
item
:
BreadcrumbsItem
,
payload
?:
any
):
void
{
this
.
_select
(
this
.
_items
.
indexOf
(
item
),
payload
);
setSelection
(
item
:
BreadcrumbsItem
|
undefined
,
payload
?:
any
):
void
{
this
.
_select
(
this
.
_items
.
indexOf
(
item
!
),
payload
);
}
private
_select
(
nth
:
number
,
payload
:
any
):
void
{
...
...
src/vs/workbench/browser/parts/activitybar/activitybarActions.ts
浏览文件 @
c283296b
...
...
@@ -213,7 +213,7 @@ class SwitchSideBarViewAction extends Action {
if
(
!
activeViewlet
)
{
return
Promise
.
resolve
();
}
let
targetViewletId
:
string
;
let
targetViewletId
:
string
|
undefined
;
for
(
let
i
=
0
;
i
<
pinnedViewletIds
.
length
;
i
++
)
{
if
(
pinnedViewletIds
[
i
]
===
activeViewlet
.
getId
())
{
targetViewletId
=
pinnedViewletIds
[(
i
+
pinnedViewletIds
.
length
+
offset
)
%
pinnedViewletIds
.
length
];
...
...
src/vs/workbench/browser/parts/editor/breadcrumbsControl.ts
浏览文件 @
c283296b
...
...
@@ -260,9 +260,12 @@ export class BreadcrumbsControl {
return
true
;
}
private
_getActiveCodeEditor
():
ICodeEditor
{
private
_getActiveCodeEditor
():
ICodeEditor
|
undefined
{
if
(
!
this
.
_editorGroup
.
activeControl
)
{
return
undefined
;
}
let
control
=
this
.
_editorGroup
.
activeControl
.
getControl
();
let
editor
:
ICodeEditor
;
let
editor
:
ICodeEditor
|
undefined
;
if
(
isCodeEditor
(
control
))
{
editor
=
control
as
ICodeEditor
;
}
else
if
(
isDiffEditor
(
control
))
{
...
...
@@ -313,7 +316,7 @@ export class BreadcrumbsControl {
let
picker
:
BreadcrumbsPicker
;
let
editor
=
this
.
_getActiveCodeEditor
();
let
editorDecorations
:
string
[]
=
[];
let
editorViewState
:
ICodeEditorViewState
;
let
editorViewState
:
ICodeEditorViewState
|
undefined
;
this
.
_contextViewService
.
showContextView
({
render
:
(
parent
:
HTMLElement
)
=>
{
...
...
@@ -336,7 +339,7 @@ export class BreadcrumbsControl {
return
;
}
if
(
!
editorViewState
)
{
editorViewState
=
editor
.
saveViewState
();
editorViewState
=
editor
.
saveViewState
()
||
undefined
;
}
const
{
symbol
}
=
data
.
target
;
editor
.
revealRangeInCenter
(
symbol
.
range
,
ScrollType
.
Smooth
);
...
...
@@ -538,7 +541,11 @@ KeybindingsRegistry.registerCommandAndKeybindingRule({
handler
(
accessor
)
{
const
groups
=
accessor
.
get
(
IEditorGroupsService
);
const
breadcrumbs
=
accessor
.
get
(
IBreadcrumbsService
);
breadcrumbs
.
getWidget
(
groups
.
activeGroup
.
id
).
focusNext
();
const
widget
=
breadcrumbs
.
getWidget
(
groups
.
activeGroup
.
id
);
if
(
!
widget
)
{
return
;
}
widget
.
focusNext
();
}
});
KeybindingsRegistry
.
registerCommandAndKeybindingRule
({
...
...
@@ -554,7 +561,11 @@ KeybindingsRegistry.registerCommandAndKeybindingRule({
handler
(
accessor
)
{
const
groups
=
accessor
.
get
(
IEditorGroupsService
);
const
breadcrumbs
=
accessor
.
get
(
IBreadcrumbsService
);
breadcrumbs
.
getWidget
(
groups
.
activeGroup
.
id
).
focusPrev
();
const
widget
=
breadcrumbs
.
getWidget
(
groups
.
activeGroup
.
id
);
if
(
!
widget
)
{
return
;
}
widget
.
focusPrev
();
}
});
KeybindingsRegistry
.
registerCommandAndKeybindingRule
({
...
...
@@ -567,6 +578,9 @@ KeybindingsRegistry.registerCommandAndKeybindingRule({
const
groups
=
accessor
.
get
(
IEditorGroupsService
);
const
breadcrumbs
=
accessor
.
get
(
IBreadcrumbsService
);
const
widget
=
breadcrumbs
.
getWidget
(
groups
.
activeGroup
.
id
);
if
(
!
widget
)
{
return
;
}
widget
.
setSelection
(
widget
.
getFocused
(),
BreadcrumbsControl
.
Payload_Pick
);
}
});
...
...
@@ -580,6 +594,9 @@ KeybindingsRegistry.registerCommandAndKeybindingRule({
const
groups
=
accessor
.
get
(
IEditorGroupsService
);
const
breadcrumbs
=
accessor
.
get
(
IBreadcrumbsService
);
const
widget
=
breadcrumbs
.
getWidget
(
groups
.
activeGroup
.
id
);
if
(
!
widget
)
{
return
;
}
widget
.
setSelection
(
widget
.
getFocused
(),
BreadcrumbsControl
.
Payload_Reveal
);
}
});
...
...
@@ -591,8 +608,12 @@ KeybindingsRegistry.registerCommandAndKeybindingRule({
handler
(
accessor
)
{
const
groups
=
accessor
.
get
(
IEditorGroupsService
);
const
breadcrumbs
=
accessor
.
get
(
IBreadcrumbsService
);
breadcrumbs
.
getWidget
(
groups
.
activeGroup
.
id
).
setFocused
(
undefined
);
breadcrumbs
.
getWidget
(
groups
.
activeGroup
.
id
).
setSelection
(
undefined
);
const
widget
=
breadcrumbs
.
getWidget
(
groups
.
activeGroup
.
id
);
if
(
!
widget
)
{
return
;
}
widget
.
setFocused
(
undefined
);
widget
.
setSelection
(
undefined
);
groups
.
activeGroup
.
activeControl
.
focus
();
}
});
...
...
src/vs/workbench/browser/parts/editor/editorActions.ts
浏览文件 @
c283296b
...
...
@@ -579,7 +579,7 @@ export class CloseLeftEditorsInGroupAction extends Action {
}
}
function
getTarget
(
editorService
:
IEditorService
,
editorGroupService
:
IEditorGroupsService
,
context
?:
IEditorIdentifier
):
{
editor
:
IEditorInput
,
group
:
IEditorGroup
}
{
function
getTarget
(
editorService
:
IEditorService
,
editorGroupService
:
IEditorGroupsService
,
context
?:
IEditorIdentifier
):
{
editor
:
IEditorInput
|
null
,
group
:
IEditorGroup
}
{
if
(
context
)
{
return
{
editor
:
context
.
editor
,
group
:
editorGroupService
.
getGroup
(
context
.
groupId
)
};
}
...
...
src/vs/workbench/contrib/markers/electron-browser/markersPanel.ts
浏览文件 @
c283296b
...
...
@@ -389,7 +389,7 @@ export class MarkersPanel extends Panel implements IMarkerFilterController {
}));
this
.
_register
(
Event
.
any
<
any
>
(
this
.
tree
.
onDidChangeSelection
,
this
.
tree
.
onDidChangeFocus
)(()
=>
{
const
elements
:
TreeElement
[]
=
[...
this
.
tree
.
getSelection
(),
...
this
.
tree
.
getFocus
()];
const
elements
=
[...
this
.
tree
.
getSelection
(),
...
this
.
tree
.
getFocus
()];
for
(
const
element
of
elements
)
{
if
(
element
instanceof
Marker
)
{
const
viewModel
=
this
.
markersViewModel
.
getViewModel
(
element
);
...
...
@@ -467,14 +467,15 @@ export class MarkersPanel extends Panel implements IMarkerFilterController {
}
private
isCurrentResourceGotAddedToMarkersData
(
changedResources
:
URI
[])
{
if
(
!
this
.
currentActiveResource
)
{
const
currentlyActiveResource
=
this
.
currentActiveResource
;
if
(
!
currentlyActiveResource
)
{
return
false
;
}
const
resourceForCurrentActiveResource
=
this
.
getResourceForCurrentActiveResource
();
if
(
resourceForCurrentActiveResource
)
{
return
false
;
}
return
changedResources
.
some
(
r
=>
r
.
toString
()
===
this
.
current
ActiveResource
.
toString
());
return
changedResources
.
some
(
r
=>
r
.
toString
()
===
currently
ActiveResource
.
toString
());
}
private
onActiveEditorChanged
():
void
{
...
...
@@ -484,7 +485,7 @@ export class MarkersPanel extends Panel implements IMarkerFilterController {
private
setCurrentActiveEditor
():
void
{
const
activeEditor
=
this
.
editorService
.
activeEditor
;
this
.
currentActiveResource
=
activeEditor
?
activeEditor
.
getResource
()
:
undefined
;
this
.
currentActiveResource
=
activeEditor
?
activeEditor
.
getResource
()
:
null
;
}
private
onSelected
():
void
{
...
...
@@ -694,7 +695,7 @@ export class MarkersPanel extends Panel implements IMarkerFilterController {
return
this
.
tree
.
getFocus
()[
0
];
}
public
getActionItem
(
action
:
IAction
):
IActionItem
{
public
getActionItem
(
action
:
IAction
):
IActionItem
|
null
{
if
(
action
.
id
===
MarkersFilterAction
.
ID
)
{
this
.
filterInputActionItem
=
this
.
instantiationService
.
createInstance
(
MarkersFilterActionItem
,
this
.
filterAction
,
this
);
return
this
.
filterInputActionItem
;
...
...
src/vs/workbench/contrib/scm/electron-browser/scm.contribution.ts
浏览文件 @
c283296b
...
...
@@ -128,7 +128,7 @@ KeybindingsRegistry.registerCommandAndKeybindingRule({
const
args
=
repository
.
provider
.
acceptInputCommand
.
arguments
;
const
commandService
=
accessor
.
get
(
ICommandService
);
return
commandService
.
executeCommand
(
id
,
...
args
);
return
commandService
.
executeCommand
(
id
,
...
(
args
||
[])
);
}
});
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录