Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
掘金者说
vscode
提交
60211895
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,发现更多精彩内容 >>
提交
60211895
编写于
10月 04, 2016
作者:
J
Joao Moreno
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fixes #2465
上级
6c0b455f
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
74 addition
and
21 deletion
+74
-21
src/vs/editor/common/config/commonEditorConfig.ts
src/vs/editor/common/config/commonEditorConfig.ts
+14
-0
src/vs/editor/common/config/defaultConfig.ts
src/vs/editor/common/config/defaultConfig.ts
+2
-0
src/vs/editor/common/editorCommon.ts
src/vs/editor/common/editorCommon.ts
+18
-0
src/vs/editor/contrib/suggest/browser/suggestWidget.ts
src/vs/editor/contrib/suggest/browser/suggestWidget.ts
+28
-21
src/vs/monaco.d.ts
src/vs/monaco.d.ts
+12
-0
未找到文件。
src/vs/editor/common/config/commonEditorConfig.ts
浏览文件 @
60211895
...
@@ -312,6 +312,8 @@ class InternalEditorOptionsHelper {
...
@@ -312,6 +312,8 @@ class InternalEditorOptionsHelper {
snippetSuggestions
:
opts
.
snippetSuggestions
,
snippetSuggestions
:
opts
.
snippetSuggestions
,
tabCompletion
:
opts
.
tabCompletion
,
tabCompletion
:
opts
.
tabCompletion
,
wordBasedSuggestions
:
opts
.
wordBasedSuggestions
,
wordBasedSuggestions
:
opts
.
wordBasedSuggestions
,
suggestFontSize
:
opts
.
suggestFontSize
,
suggestLineHeight
:
opts
.
suggestLineHeight
,
selectionHighlight
:
toBoolean
(
opts
.
selectionHighlight
),
selectionHighlight
:
toBoolean
(
opts
.
selectionHighlight
),
codeLens
:
opts
.
referenceInfos
&&
opts
.
codeLens
,
codeLens
:
opts
.
referenceInfos
&&
opts
.
codeLens
,
folding
:
toBoolean
(
opts
.
folding
),
folding
:
toBoolean
(
opts
.
folding
),
...
@@ -765,6 +767,18 @@ let editorConfiguration:IConfigurationNode = {
...
@@ -765,6 +767,18 @@ let editorConfiguration:IConfigurationNode = {
'
default
'
:
DefaultConfig
.
editor
.
wordBasedSuggestions
,
'
default
'
:
DefaultConfig
.
editor
.
wordBasedSuggestions
,
'
description
'
:
nls
.
localize
(
'
wordBasedSuggestions
'
,
"
Enable word based suggestions.
"
)
'
description
'
:
nls
.
localize
(
'
wordBasedSuggestions
'
,
"
Enable word based suggestions.
"
)
},
},
'
editor.suggestFontSize
'
:
{
'
type
'
:
'
integer
'
,
'
default
'
:
0
,
'
minimum
'
:
0
,
'
description
'
:
nls
.
localize
(
'
suggestFontSize
'
,
"
Font size for the suggest widget
"
)
},
'
editor.suggestLineHeight
'
:
{
'
type
'
:
'
integer
'
,
'
default
'
:
0
,
'
minimum
'
:
0
,
'
description
'
:
nls
.
localize
(
'
suggestLineHeight
'
,
"
Line height for the suggest widget
"
)
},
'
editor.tabCompletion
'
:
{
'
editor.tabCompletion
'
:
{
'
type
'
:
'
boolean
'
,
'
type
'
:
'
boolean
'
,
'
default
'
:
DefaultConfig
.
editor
.
tabCompletion
,
'
default
'
:
DefaultConfig
.
editor
.
tabCompletion
,
...
...
src/vs/editor/common/config/defaultConfig.ts
浏览文件 @
60211895
...
@@ -87,6 +87,8 @@ class ConfigClass implements IConfiguration {
...
@@ -87,6 +87,8 @@ class ConfigClass implements IConfiguration {
snippetSuggestions
:
'
bottom
'
,
snippetSuggestions
:
'
bottom
'
,
tabCompletion
:
false
,
tabCompletion
:
false
,
wordBasedSuggestions
:
true
,
wordBasedSuggestions
:
true
,
suggestFontSize
:
0
,
suggestLineHeight
:
0
,
selectionHighlight
:
true
,
selectionHighlight
:
true
,
codeLens
:
true
,
codeLens
:
true
,
referenceInfos
:
true
,
referenceInfos
:
true
,
...
...
src/vs/editor/common/editorCommon.ts
浏览文件 @
60211895
...
@@ -410,6 +410,16 @@ export interface IEditorOptions {
...
@@ -410,6 +410,16 @@ export interface IEditorOptions {
* Enable word based suggestions. Defaults to 'true'
* Enable word based suggestions. Defaults to 'true'
*/
*/
wordBasedSuggestions
?:
boolean
;
wordBasedSuggestions
?:
boolean
;
/**
* The font size for the suggest widget.
* Defaults to the editor font size.
*/
suggestFontSize
?:
number
;
/**
* The line height for the suggest widget.
* Defaults to the editor line height.
*/
suggestLineHeight
?:
number
;
/**
/**
* Enable selection highlight.
* Enable selection highlight.
* Defaults to true.
* Defaults to true.
...
@@ -854,6 +864,8 @@ export class EditorContribOptions {
...
@@ -854,6 +864,8 @@ export class EditorContribOptions {
snippetSuggestions
:
'
top
'
|
'
bottom
'
|
'
inline
'
|
'
none
'
;
snippetSuggestions
:
'
top
'
|
'
bottom
'
|
'
inline
'
|
'
none
'
;
tabCompletion
:
boolean
;
tabCompletion
:
boolean
;
wordBasedSuggestions
:
boolean
;
wordBasedSuggestions
:
boolean
;
suggestFontSize
:
number
;
suggestLineHeight
:
number
;
selectionHighlight
:
boolean
;
selectionHighlight
:
boolean
;
codeLens
:
boolean
;
codeLens
:
boolean
;
folding
:
boolean
;
folding
:
boolean
;
...
@@ -875,6 +887,8 @@ export class EditorContribOptions {
...
@@ -875,6 +887,8 @@ export class EditorContribOptions {
snippetSuggestions
:
'
top
'
|
'
bottom
'
|
'
inline
'
|
'
none
'
;
snippetSuggestions
:
'
top
'
|
'
bottom
'
|
'
inline
'
|
'
none
'
;
tabCompletion
:
boolean
;
tabCompletion
:
boolean
;
wordBasedSuggestions
:
boolean
;
wordBasedSuggestions
:
boolean
;
suggestFontSize
:
number
;
suggestLineHeight
:
number
;
selectionHighlight
:
boolean
;
selectionHighlight
:
boolean
;
codeLens
:
boolean
;
codeLens
:
boolean
;
folding
:
boolean
;
folding
:
boolean
;
...
@@ -892,6 +906,8 @@ export class EditorContribOptions {
...
@@ -892,6 +906,8 @@ export class EditorContribOptions {
this
.
snippetSuggestions
=
source
.
snippetSuggestions
;
this
.
snippetSuggestions
=
source
.
snippetSuggestions
;
this
.
tabCompletion
=
source
.
tabCompletion
;
this
.
tabCompletion
=
source
.
tabCompletion
;
this
.
wordBasedSuggestions
=
source
.
wordBasedSuggestions
;
this
.
wordBasedSuggestions
=
source
.
wordBasedSuggestions
;
this
.
suggestFontSize
=
source
.
suggestFontSize
;
this
.
suggestLineHeight
=
source
.
suggestLineHeight
;
this
.
selectionHighlight
=
Boolean
(
source
.
selectionHighlight
);
this
.
selectionHighlight
=
Boolean
(
source
.
selectionHighlight
);
this
.
codeLens
=
Boolean
(
source
.
codeLens
);
this
.
codeLens
=
Boolean
(
source
.
codeLens
);
this
.
folding
=
Boolean
(
source
.
folding
);
this
.
folding
=
Boolean
(
source
.
folding
);
...
@@ -915,6 +931,8 @@ export class EditorContribOptions {
...
@@ -915,6 +931,8 @@ export class EditorContribOptions {
&&
this
.
snippetSuggestions
===
other
.
snippetSuggestions
&&
this
.
snippetSuggestions
===
other
.
snippetSuggestions
&&
this
.
tabCompletion
===
other
.
tabCompletion
&&
this
.
tabCompletion
===
other
.
tabCompletion
&&
this
.
wordBasedSuggestions
===
other
.
wordBasedSuggestions
&&
this
.
wordBasedSuggestions
===
other
.
wordBasedSuggestions
&&
this
.
suggestFontSize
===
other
.
suggestFontSize
&&
this
.
suggestLineHeight
===
other
.
suggestLineHeight
&&
this
.
selectionHighlight
===
other
.
selectionHighlight
&&
this
.
selectionHighlight
===
other
.
selectionHighlight
&&
this
.
codeLens
===
other
.
codeLens
&&
this
.
codeLens
===
other
.
codeLens
&&
this
.
folding
===
other
.
folding
&&
this
.
folding
===
other
.
folding
...
...
src/vs/editor/contrib/suggest/browser/suggestWidget.ts
浏览文件 @
60211895
...
@@ -82,22 +82,26 @@ class Renderer implements IRenderer<ICompletionItem, ISuggestionTemplateData> {
...
@@ -82,22 +82,26 @@ class Renderer implements IRenderer<ICompletionItem, ISuggestionTemplateData> {
data
.
documentationDetails
.
title
=
nls
.
localize
(
'
readMore
'
,
"
Read More...{0}
"
,
this
.
triggerKeybindingLabel
);
data
.
documentationDetails
.
title
=
nls
.
localize
(
'
readMore
'
,
"
Read More...{0}
"
,
this
.
triggerKeybindingLabel
);
const
configureFont
=
()
=>
{
const
configureFont
=
()
=>
{
const
fontInfo
=
this
.
editor
.
getConfiguration
().
fontInfo
;
const
configuration
=
this
.
editor
.
getConfiguration
();
const
lineHeight
=
`
${
fontInfo
.
lineHeight
}
px`
;
const
fontFamily
=
configuration
.
fontInfo
.
fontFamily
;
const
fontSize
=
configuration
.
contribInfo
.
suggestFontSize
||
configuration
.
fontInfo
.
fontSize
;
data
.
root
.
style
.
fontSize
=
`
${
fontInfo
.
fontSize
}
px`
;
const
lineHeight
=
configuration
.
contribInfo
.
suggestLineHeight
||
configuration
.
fontInfo
.
lineHeight
;
main
.
style
.
fontFamily
=
fontInfo
.
fontFamily
;
const
fontSizePx
=
`
${
fontSize
}
px`
;
main
.
style
.
lineHeight
=
lineHeight
;
const
lineHeightPx
=
`
${
lineHeight
}
px`
;
data
.
icon
.
style
.
height
=
lineHeight
;
data
.
icon
.
style
.
width
=
lineHeight
;
data
.
root
.
style
.
fontSize
=
fontSizePx
;
data
.
documentationDetails
.
style
.
height
=
lineHeight
;
main
.
style
.
fontFamily
=
fontFamily
;
data
.
documentationDetails
.
style
.
width
=
lineHeight
;
main
.
style
.
lineHeight
=
lineHeightPx
;
data
.
icon
.
style
.
height
=
lineHeightPx
;
data
.
icon
.
style
.
width
=
lineHeightPx
;
data
.
documentationDetails
.
style
.
height
=
lineHeightPx
;
data
.
documentationDetails
.
style
.
width
=
lineHeightPx
;
};
};
configureFont
();
configureFont
();
chain
<
IConfigurationChangedEvent
>
(
this
.
editor
.
onDidChangeConfiguration
.
bind
(
this
.
editor
))
chain
<
IConfigurationChangedEvent
>
(
this
.
editor
.
onDidChangeConfiguration
.
bind
(
this
.
editor
))
.
filter
(
e
=>
e
.
fontInfo
)
.
filter
(
e
=>
e
.
fontInfo
||
e
.
contribInfo
)
.
on
(
configureFont
,
null
,
data
.
disposables
);
.
on
(
configureFont
,
null
,
data
.
disposables
);
return
data
;
return
data
;
...
@@ -262,15 +266,18 @@ class SuggestionDetails {
...
@@ -262,15 +266,18 @@ class SuggestionDetails {
}
}
private
configureFont
()
{
private
configureFont
()
{
const
fontInfo
=
this
.
editor
.
getConfiguration
().
fontInfo
;
const
configuration
=
this
.
editor
.
getConfiguration
();
const
fontSize
=
`
${
fontInfo
.
fontSize
}
px`
;
const
fontFamily
=
configuration
.
fontInfo
.
fontFamily
;
const
lineHeight
=
`
${
fontInfo
.
lineHeight
}
px`
;
const
fontSize
=
configuration
.
contribInfo
.
suggestFontSize
||
configuration
.
fontInfo
.
fontSize
;
const
lineHeight
=
configuration
.
contribInfo
.
suggestLineHeight
||
configuration
.
fontInfo
.
lineHeight
;
const
fontSizePx
=
`
${
fontSize
}
px`
;
const
lineHeightPx
=
`
${
lineHeight
}
px`
;
this
.
el
.
style
.
fontSize
=
fontSize
;
this
.
el
.
style
.
fontSize
=
fontSize
Px
;
this
.
title
.
style
.
fontFamily
=
font
Info
.
font
Family
;
this
.
title
.
style
.
fontFamily
=
fontFamily
;
this
.
type
.
style
.
fontFamily
=
font
Info
.
font
Family
;
this
.
type
.
style
.
fontFamily
=
fontFamily
;
this
.
back
.
style
.
height
=
lineHeight
;
this
.
back
.
style
.
height
=
lineHeight
Px
;
this
.
back
.
style
.
width
=
lineHeight
;
this
.
back
.
style
.
width
=
lineHeight
Px
;
}
}
dispose
():
void
{
dispose
():
void
{
...
@@ -754,8 +761,8 @@ export class SuggestWidget implements IContentWidget, IDelegate<ICompletionItem>
...
@@ -754,8 +761,8 @@ export class SuggestWidget implements IContentWidget, IDelegate<ICompletionItem>
}
}
private
get
unfocusedHeight
():
number
{
private
get
unfocusedHeight
():
number
{
const
fontInfo
=
this
.
editor
.
getConfiguration
().
fontInfo
;
const
configuration
=
this
.
editor
.
getConfiguration
()
;
return
fontInfo
.
lineHeight
;
return
configuration
.
contribInfo
.
suggestLineHeight
||
configuration
.
fontInfo
.
lineHeight
;
}
}
// IDelegate
// IDelegate
...
...
src/vs/monaco.d.ts
浏览文件 @
60211895
...
@@ -1273,6 +1273,16 @@ declare module monaco.editor {
...
@@ -1273,6 +1273,16 @@ declare module monaco.editor {
* Enable word based suggestions. Defaults to 'true'
* Enable word based suggestions. Defaults to 'true'
*/
*/
wordBasedSuggestions
?:
boolean
;
wordBasedSuggestions
?:
boolean
;
/**
* The font size for the suggest widget.
* Defaults to the editor font size.
*/
suggestFontSize
?:
number
;
/**
* The line height for the suggest widget.
* Defaults to the editor line height.
*/
suggestLineHeight
?:
number
;
/**
/**
* Enable selection highlight.
* Enable selection highlight.
* Defaults to true.
* Defaults to true.
...
@@ -1453,6 +1463,8 @@ declare module monaco.editor {
...
@@ -1453,6 +1463,8 @@ declare module monaco.editor {
snippetSuggestions
:
'
top
'
|
'
bottom
'
|
'
inline
'
|
'
none
'
;
snippetSuggestions
:
'
top
'
|
'
bottom
'
|
'
inline
'
|
'
none
'
;
tabCompletion
:
boolean
;
tabCompletion
:
boolean
;
wordBasedSuggestions
:
boolean
;
wordBasedSuggestions
:
boolean
;
suggestFontSize
:
number
;
suggestLineHeight
:
number
;
selectionHighlight
:
boolean
;
selectionHighlight
:
boolean
;
codeLens
:
boolean
;
codeLens
:
boolean
;
folding
:
boolean
;
folding
:
boolean
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录