Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
475d1aea
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,发现更多精彩内容 >>
提交
475d1aea
编写于
1月 11, 2016
作者:
J
Joao Moreno
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
suggest: extra info final polish
上级
e727fef5
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
23 addition
and
7 deletion
+23
-7
src/vs/editor/contrib/suggest/browser/suggest.ts
src/vs/editor/contrib/suggest/browser/suggest.ts
+2
-2
src/vs/editor/contrib/suggest/browser/suggestWidget.ts
src/vs/editor/contrib/suggest/browser/suggestWidget.ts
+21
-5
未找到文件。
src/vs/editor/contrib/suggest/browser/suggest.ts
浏览文件 @
475d1aea
...
...
@@ -157,7 +157,7 @@ export class SuggestController implements EditorCommon.IEditorContribution {
}
}
public
hide
SuggestWidget
():
void
{
public
cancel
SuggestWidget
():
void
{
if
(
this
.
widget
)
{
this
.
widget
.
cancel
();
}
...
...
@@ -225,7 +225,7 @@ CommonEditorRegistry.registerEditorCommand(ACCEPT_SELECTED_SUGGESTION_CMD, weigh
});
CommonEditorRegistry
.
registerEditorCommand
(
'
hideSuggestWidget
'
,
weight
,
{
primary
:
KeyCode
.
Escape
},
true
,
CONTEXT_SUGGEST_WIDGET_VISIBLE
,
(
ctx
,
editor
,
args
)
=>
{
const
controller
=
SuggestController
.
getSuggestController
(
editor
);
controller
.
hide
SuggestWidget
();
controller
.
cancel
SuggestWidget
();
});
CommonEditorRegistry
.
registerEditorCommand
(
'
selectNextSuggestion
'
,
weight
,
{
primary
:
KeyCode
.
DownArrow
},
true
,
CONTEXT_SUGGEST_WIDGET_VISIBLE
,
(
ctx
,
editor
,
args
)
=>
{
const
controller
=
SuggestController
.
getSuggestController
(
editor
);
...
...
src/vs/editor/contrib/suggest/browser/suggestWidget.ts
浏览文件 @
475d1aea
...
...
@@ -30,6 +30,7 @@ import { ISuggestResult2 } from '../common/suggest';
import
URI
from
'
vs/base/common/uri
'
;
import
{
isFalsyOrEmpty
}
from
'
vs/base/common/arrays
'
;
import
{
onUnexpectedError
,
isPromiseCanceledError
,
illegalArgument
}
from
'
vs/base/common/errors
'
;
import
{
IInstantiationService
}
from
'
vs/platform/instantiation/common/instantiation
'
;
class
CompletionItem
{
...
...
@@ -267,7 +268,15 @@ interface ISuggestionTemplateData {
class
Renderer
implements
Tree
.
IRenderer
{
constructor
(
private
widget
:
SuggestWidget
)
{}
private
triggerKeybindingLabel
:
string
;
constructor
(
private
widget
:
SuggestWidget
,
@
IKeybindingService
keybindingService
:
IKeybindingService
)
{
const
keybindings
=
keybindingService
.
lookupKeybindings
(
'
editor.action.triggerSuggest
'
);
this
.
triggerKeybindingLabel
=
keybindings
.
length
===
0
?
''
:
` (
${
keybindingService
.
getLabelFor
(
keybindings
[
0
])}
)`
;
}
public
getHeight
(
tree
:
Tree
.
ITree
,
element
:
any
):
number
{
if
(
element
instanceof
CompletionItem
)
{
...
...
@@ -304,7 +313,7 @@ class Renderer implements Tree.IRenderer {
const
docs
=
append
(
text
,
$
(
'
.docs
'
));
data
.
documentation
=
append
(
docs
,
$
(
'
span.docs-text
'
));
data
.
documentationDetails
=
append
(
docs
,
$
(
'
span.docs-details.octicon.octicon-info
'
));
data
.
documentationDetails
.
title
=
nls
.
localize
(
'
readMore
'
,
"
Read More...
"
);
data
.
documentationDetails
.
title
=
nls
.
localize
(
'
readMore
'
,
"
Read More...
{0}
"
,
this
.
triggerKeybindingLabel
);
return
data
;
}
...
...
@@ -405,6 +414,7 @@ class SuggestionDetails {
const
header
=
append
(
this
.
el
,
$
(
'
.header
'
));
this
.
title
=
append
(
header
,
$
(
'
span.title
'
));
this
.
back
=
append
(
header
,
$
(
'
span.go-back.octicon.octicon-x
'
));
this
.
back
.
title
=
nls
.
localize
(
'
goback
'
,
"
Go back
"
);
this
.
body
=
append
(
this
.
el
,
$
(
'
.body
'
));
this
.
type
=
append
(
this
.
body
,
$
(
'
p.type
'
));
this
.
docs
=
append
(
this
.
body
,
$
(
'
p.docs
'
));
...
...
@@ -493,7 +503,8 @@ export class SuggestWidget implements EditorBrowser.IContentWidget, IDisposable
private
editor
:
EditorBrowser
.
ICodeEditor
,
private
model
:
SuggestModel
,
@
IKeybindingService
keybindingService
:
IKeybindingService
,
@
ITelemetryService
telemetryService
:
ITelemetryService
@
ITelemetryService
telemetryService
:
ITelemetryService
,
@
IInstantiationService
instantiationService
:
IInstantiationService
)
{
this
.
isAuto
=
false
;
this
.
oldFocus
=
null
;
...
...
@@ -514,9 +525,10 @@ export class SuggestWidget implements EditorBrowser.IContentWidget, IDisposable
this
.
messageElement
=
append
(
this
.
element
,
$
(
'
.message
'
));
this
.
treeElement
=
append
(
this
.
element
,
$
(
'
.tree
'
));
this
.
details
=
new
SuggestionDetails
(
this
.
element
,
this
);
this
.
renderer
=
instantiationService
.
createInstance
(
Renderer
,
this
);
const
configuration
=
{
renderer
:
this
.
renderer
=
new
Renderer
(
this
)
,
renderer
:
this
.
renderer
,
dataSource
:
new
DataSource
(),
controller
:
new
Controller
(),
filter
:
new
Filter
(()
=>
this
.
state
),
...
...
@@ -947,7 +959,11 @@ export class SuggestWidget implements EditorBrowser.IContentWidget, IDisposable
}
public
cancel
():
void
{
this
.
model
.
cancel
();
if
(
this
.
state
===
State
.
Details
)
{
this
.
toggleDetails
();
}
else
{
this
.
model
.
cancel
();
}
}
public
getPosition
():
EditorBrowser
.
IContentWidgetPosition
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录