Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
826d34e9
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,发现更多精彩内容 >>
提交
826d34e9
编写于
2月 20, 2019
作者:
S
Sandeep Somavarapu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
#67076 Show keybindings
上级
4d6187a5
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
22 addition
and
10 deletion
+22
-10
src/vs/editor/contrib/gotoError/gotoError.ts
src/vs/editor/contrib/gotoError/gotoError.ts
+12
-6
src/vs/editor/contrib/hover/hover.ts
src/vs/editor/contrib/hover/hover.ts
+3
-1
src/vs/editor/contrib/hover/modesContentHover.ts
src/vs/editor/contrib/hover/modesContentHover.ts
+7
-3
未找到文件。
src/vs/editor/contrib/gotoError/gotoError.ts
浏览文件 @
826d34e9
...
...
@@ -25,6 +25,7 @@ import { ICodeEditorService } from 'vs/editor/browser/services/codeEditorService
import
{
onUnexpectedError
}
from
'
vs/base/common/errors
'
;
import
{
MenuRegistry
,
MenuId
}
from
'
vs/platform/actions/common/actions
'
;
import
{
Action
}
from
'
vs/base/common/actions
'
;
import
{
IKeybindingService
}
from
'
vs/platform/keybinding/common/keybinding
'
;
class
MarkerModel
{
...
...
@@ -212,7 +213,8 @@ export class MarkerController implements editorCommon.IEditorContribution {
@
IMarkerService
private
readonly
_markerService
:
IMarkerService
,
@
IContextKeyService
private
readonly
_contextKeyService
:
IContextKeyService
,
@
IThemeService
private
readonly
_themeService
:
IThemeService
,
@
ICodeEditorService
private
readonly
_editorService
:
ICodeEditorService
@
ICodeEditorService
private
readonly
_editorService
:
ICodeEditorService
,
@
IKeybindingService
private
readonly
_keybindingService
:
IKeybindingService
)
{
this
.
_editor
=
editor
;
this
.
_widgetVisible
=
CONTEXT_MARKERS_NAVIGATION_VISIBLE
.
bindTo
(
this
.
_contextKeyService
);
...
...
@@ -243,9 +245,11 @@ export class MarkerController implements editorCommon.IEditorContribution {
this
.
_model
=
new
MarkerModel
(
this
.
_editor
,
markers
);
this
.
_markerService
.
onMarkerChanged
(
this
.
_onMarkerChanged
,
this
,
this
.
_disposeOnClose
);
const
prevMarkerKeybinding
=
this
.
_keybindingService
.
lookupKeybinding
(
PrevMarkerAction
.
ID
);
const
nextMarkerKeybinding
=
this
.
_keybindingService
.
lookupKeybinding
(
NextMarkerAction
.
ID
);
const
actions
=
[
new
Action
(
PrevMarkerAction
.
ID
,
PrevMarkerAction
.
LABEL
,
'
show-previous-problem octicon octicon-chevron-up
'
,
this
.
_model
.
canNavigate
(),
async
()
=>
{
if
(
this
.
_model
)
{
this
.
_model
.
move
(
false
,
true
);
}
}),
new
Action
(
NextMarkerAction
.
ID
,
NextMarkerAction
.
LABEL
,
'
show-next-problem octicon octicon-chevron-down
'
,
this
.
_model
.
canNavigate
(),
async
()
=>
{
if
(
this
.
_model
)
{
this
.
_model
.
move
(
true
,
true
);
}
})
new
Action
(
PrevMarkerAction
.
ID
,
PrevMarkerAction
.
LABEL
+
(
prevMarkerKeybinding
?
` (
${
prevMarkerKeybinding
.
getLabel
()}
)`
:
''
)
,
'
show-previous-problem octicon octicon-chevron-up
'
,
this
.
_model
.
canNavigate
(),
async
()
=>
{
if
(
this
.
_model
)
{
this
.
_model
.
move
(
false
,
true
);
}
}),
new
Action
(
NextMarkerAction
.
ID
,
NextMarkerAction
.
LABEL
+
(
nextMarkerKeybinding
?
` (
${
nextMarkerKeybinding
.
getLabel
()}
)`
:
''
)
,
'
show-next-problem octicon octicon-chevron-down
'
,
this
.
_model
.
canNavigate
(),
async
()
=>
{
if
(
this
.
_model
)
{
this
.
_model
.
move
(
true
,
true
);
}
})
];
this
.
_widget
=
new
MarkerNavigationWidget
(
this
.
_editor
,
actions
,
this
.
_themeService
);
this
.
_widgetVisible
.
set
(
true
);
...
...
@@ -416,7 +420,7 @@ class MarkerNavigationAction extends EditorAction {
}
}
class
NextMarkerAction
extends
MarkerNavigationAction
{
export
class
NextMarkerAction
extends
MarkerNavigationAction
{
static
ID
:
string
=
'
editor.action.marker.next
'
;
static
LABEL
:
string
=
nls
.
localize
(
'
markerAction.next.label
'
,
"
Go to Next Problem (Error, Warning, Info)
"
);
constructor
()
{
...
...
@@ -424,7 +428,8 @@ class NextMarkerAction extends MarkerNavigationAction {
id
:
NextMarkerAction
.
ID
,
label
:
NextMarkerAction
.
LABEL
,
alias
:
'
Go to Next Error or Warning
'
,
precondition
:
EditorContextKeys
.
writable
precondition
:
EditorContextKeys
.
writable
,
kbOpts
:
{
kbExpr
:
EditorContextKeys
.
editorTextFocus
,
primary
:
KeyMod
.
Alt
|
KeyCode
.
F8
,
weight
:
KeybindingWeight
.
EditorContrib
}
});
}
}
...
...
@@ -437,7 +442,8 @@ class PrevMarkerAction extends MarkerNavigationAction {
id
:
PrevMarkerAction
.
ID
,
label
:
PrevMarkerAction
.
LABEL
,
alias
:
'
Go to Previous Error or Warning
'
,
precondition
:
EditorContextKeys
.
writable
precondition
:
EditorContextKeys
.
writable
,
kbOpts
:
{
kbExpr
:
EditorContextKeys
.
editorTextFocus
,
primary
:
KeyMod
.
Shift
|
KeyMod
.
Alt
|
KeyCode
.
F8
,
weight
:
KeybindingWeight
.
EditorContrib
}
});
}
}
...
...
src/vs/editor/contrib/hover/hover.ts
浏览文件 @
826d34e9
...
...
@@ -26,6 +26,7 @@ import { IOpenerService } from 'vs/platform/opener/common/opener';
import
{
editorHoverBackground
,
editorHoverBorder
,
editorHoverHighlight
,
textCodeBlockBackground
,
textLinkForeground
,
editorHoverFooterBackground
}
from
'
vs/platform/theme/common/colorRegistry
'
;
import
{
IThemeService
,
registerThemingParticipant
}
from
'
vs/platform/theme/common/themeService
'
;
import
{
IMarkerDecorationsService
}
from
'
vs/editor/common/services/markersDecorationService
'
;
import
{
IKeybindingService
}
from
'
vs/platform/keybinding/common/keybinding
'
;
export
class
ModesHoverController
implements
IEditorContribution
{
...
...
@@ -64,6 +65,7 @@ export class ModesHoverController implements IEditorContribution {
@
IOpenerService
private
readonly
_openerService
:
IOpenerService
,
@
IModeService
private
readonly
_modeService
:
IModeService
,
@
IMarkerDecorationsService
private
readonly
_markerDecorationsService
:
IMarkerDecorationsService
,
@
IKeybindingService
private
readonly
_keybindingService
:
IKeybindingService
,
@
IThemeService
private
readonly
_themeService
:
IThemeService
)
{
this
.
_toUnhook
=
[];
...
...
@@ -207,7 +209,7 @@ export class ModesHoverController implements IEditorContribution {
private
_createHoverWidget
()
{
const
renderer
=
new
MarkdownRenderer
(
this
.
_editor
,
this
.
_modeService
,
this
.
_openerService
);
this
.
_contentWidget
=
new
ModesContentHoverWidget
(
this
.
_editor
,
renderer
,
this
.
_markerDecorationsService
,
this
.
_themeService
,
this
.
_openerService
);
this
.
_contentWidget
=
new
ModesContentHoverWidget
(
this
.
_editor
,
renderer
,
this
.
_markerDecorationsService
,
this
.
_themeService
,
this
.
_
keybindingService
,
this
.
_
openerService
);
this
.
_glyphWidget
=
new
ModesGlyphHoverWidget
(
this
.
_editor
,
renderer
);
}
...
...
src/vs/editor/contrib/hover/modesContentHover.ts
浏览文件 @
826d34e9
...
...
@@ -29,7 +29,8 @@ import { basename } from 'vs/base/common/resources';
import
{
IMarkerDecorationsService
}
from
'
vs/editor/common/services/markersDecorationService
'
;
import
{
onUnexpectedError
}
from
'
vs/base/common/errors
'
;
import
{
IOpenerService
,
NullOpenerService
}
from
'
vs/platform/opener/common/opener
'
;
import
{
MarkerController
}
from
'
vs/editor/contrib/gotoError/gotoError
'
;
import
{
MarkerController
,
NextMarkerAction
}
from
'
vs/editor/contrib/gotoError/gotoError
'
;
import
{
IKeybindingService
}
from
'
vs/platform/keybinding/common/keybinding
'
;
const
$
=
dom
.
$
;
...
...
@@ -207,6 +208,7 @@ export class ModesContentHoverWidget extends ContentHoverWidget {
markdownRenderer
:
MarkdownRenderer
,
markerDecorationsService
:
IMarkerDecorationsService
,
private
readonly
_themeService
:
IThemeService
,
private
readonly
_keybindingService
:
IKeybindingService
,
private
readonly
_openerService
:
IOpenerService
|
null
=
NullOpenerService
,
)
{
super
(
ModesContentHoverWidget
.
ID
,
editor
);
...
...
@@ -510,8 +512,10 @@ export class ModesContentHoverWidget extends ContentHoverWidget {
const
actionsElement
=
dom
.
append
(
hoverElement
,
$
(
'
div.actions
'
));
const
disposables
:
IDisposable
[]
=
[];
const
peekMarkerAction
=
dom
.
append
(
actionsElement
,
$
(
'
a.action.peek-marker
'
,
{
title
:
nls
.
localize
(
'
go to problem
'
,
"
Peek Problem
"
)
}));
peekMarkerAction
.
textContent
=
'
Peek Problem
'
;
const
keybinding
=
this
.
_keybindingService
.
lookupKeybinding
(
NextMarkerAction
.
ID
);
const
label
=
nls
.
localize
(
'
peek problem
'
,
"
Peek Problem
"
)
+
(
keybinding
?
` (
${
keybinding
.
getLabel
()}
)`
:
''
);
const
peekMarkerAction
=
dom
.
append
(
actionsElement
,
$
(
'
a.action.peek-marker
'
,
{
title
:
label
}));
peekMarkerAction
.
textContent
=
label
;
disposables
.
push
(
dom
.
addDisposableListener
(
peekMarkerAction
,
dom
.
EventType
.
CLICK
,
e
=>
{
e
.
stopPropagation
();
e
.
preventDefault
();
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录