Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
1b8c51e6
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,发现更多精彩内容 >>
未验证
提交
1b8c51e6
编写于
8月 07, 2018
作者:
J
Johannes Rieken
提交者:
GitHub
8月 07, 2018
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #55354 from ozyx/cycle-parameterHints
Add option to enable cycling of parameter hints
上级
b9caa370
18bde2e2
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
104 addition
and
18 deletion
+104
-18
src/vs/editor/common/config/commonEditorConfig.ts
src/vs/editor/common/config/commonEditorConfig.ts
+9
-3
src/vs/editor/common/config/editorOptions.ts
src/vs/editor/common/config/editorOptions.ts
+51
-6
src/vs/editor/contrib/parameterHints/parameterHintsWidget.ts
src/vs/editor/contrib/parameterHints/parameterHintsWidget.ts
+18
-5
src/vs/monaco.d.ts
src/vs/monaco.d.ts
+24
-3
src/vs/platform/telemetry/common/telemetryUtils.ts
src/vs/platform/telemetry/common/telemetryUtils.ts
+2
-1
未找到文件。
src/vs/editor/common/config/commonEditorConfig.ts
浏览文件 @
1b8c51e6
...
...
@@ -83,6 +83,7 @@ export abstract class CommonEditorConfiguration extends Disposable implements ed
this
.
_rawOptions
.
minimap
=
objects
.
mixin
({},
this
.
_rawOptions
.
minimap
||
{});
this
.
_rawOptions
.
find
=
objects
.
mixin
({},
this
.
_rawOptions
.
find
||
{});
this
.
_rawOptions
.
hover
=
objects
.
mixin
({},
this
.
_rawOptions
.
hover
||
{});
this
.
_rawOptions
.
parameterHints
=
objects
.
mixin
({},
this
.
_rawOptions
.
parameterHints
||
{});
this
.
_validatedOptions
=
editorOptions
.
EditorOptionsValidator
.
validate
(
this
.
_rawOptions
,
EDITOR_DEFAULTS
);
this
.
editor
=
null
;
...
...
@@ -488,10 +489,15 @@ const editorConfiguration: IConfigurationNode = {
'
minimum
'
:
0
,
'
description
'
:
nls
.
localize
(
'
quickSuggestionsDelay
'
,
"
Controls the delay in milliseconds after which quick suggestions will show up.
"
)
},
'
editor.parameterHints
'
:
{
'
editor.parameterHints
.enabled
'
:
{
'
type
'
:
'
boolean
'
,
'
default
'
:
EDITOR_DEFAULTS
.
contribInfo
.
parameterHints
,
'
description
'
:
nls
.
localize
(
'
parameterHints
'
,
"
Enables a pop-up that shows parameter documentation and type information as you type.
"
)
'
default
'
:
EDITOR_DEFAULTS
.
contribInfo
.
parameterHints
.
enabled
,
'
description
'
:
nls
.
localize
(
'
parameterHints.enabled
'
,
"
Enables a pop-up that shows parameter documentation and type information as you type.
"
)
},
'
editor.parameterHints.cycle
'
:
{
'
type
'
:
'
boolean
'
,
'
default
'
:
EDITOR_DEFAULTS
.
contribInfo
.
parameterHints
.
cycle
,
'
description
'
:
nls
.
localize
(
'
parameterHints.cycle
'
,
"
Controls whether the parameter hints menu cycles or closes when reaching the end of the list.
"
)
},
'
editor.autoClosingBrackets
'
:
{
'
type
'
:
'
boolean
'
,
...
...
src/vs/editor/common/config/editorOptions.ts
浏览文件 @
1b8c51e6
...
...
@@ -158,6 +158,22 @@ export interface IEditorHoverOptions {
sticky
?:
boolean
;
}
/**
* Configuration options for parameter hints
*/
export
interface
IEditorParameterHintOptions
{
/**
* Enable parameter hints.
* Defaults to true.
*/
enabled
?:
boolean
;
/**
* Enable cycling of parameter hints.
* Defaults to false.
*/
cycle
?:
boolean
;
}
export
interface
ISuggestOptions
{
/**
* Enable graceful matching. Defaults to true.
...
...
@@ -451,9 +467,9 @@ export interface IEditorOptions {
*/
quickSuggestionsDelay
?:
number
;
/**
*
Enables parameter hints
*
Parameter hint options.
*/
parameterHints
?:
boolean
;
parameterHints
?:
IEditorParameterHintOptions
;
/**
* Render icons in suggestions box.
* Defaults to true.
...
...
@@ -851,6 +867,11 @@ export interface InternalSuggestOptions {
readonly
snippetsPreventQuickSuggestions
:
boolean
;
}
export
interface
InternalParameterHintOptions
{
readonly
enabled
:
boolean
;
readonly
cycle
:
boolean
;
}
export
interface
EditorWrappingInfo
{
readonly
inDiffEditor
:
boolean
;
readonly
isDominatedByLongLines
:
boolean
;
...
...
@@ -911,7 +932,7 @@ export interface EditorContribOptions {
readonly
contextmenu
:
boolean
;
readonly
quickSuggestions
:
boolean
|
{
other
:
boolean
,
comments
:
boolean
,
strings
:
boolean
};
readonly
quickSuggestionsDelay
:
number
;
readonly
parameterHints
:
boolean
;
readonly
parameterHints
:
InternalParameterHintOptions
;
readonly
iconsInSuggestions
:
boolean
;
readonly
formatOnType
:
boolean
;
readonly
formatOnPaste
:
boolean
;
...
...
@@ -1237,6 +1258,16 @@ export class InternalEditorOptions {
);
}
/**
* @internal
*/
private
static
_equalsParameterHintOptions
(
a
:
InternalParameterHintOptions
,
b
:
InternalParameterHintOptions
):
boolean
{
return
(
a
.
enabled
===
b
.
enabled
&&
a
.
cycle
===
b
.
cycle
);
}
/**
* @internal
*/
...
...
@@ -1291,7 +1322,7 @@ export class InternalEditorOptions {
&&
a
.
contextmenu
===
b
.
contextmenu
&&
InternalEditorOptions
.
_equalsQuickSuggestions
(
a
.
quickSuggestions
,
b
.
quickSuggestions
)
&&
a
.
quickSuggestionsDelay
===
b
.
quickSuggestionsDelay
&&
a
.
parameterHints
===
b
.
parameterHints
&&
this
.
_equalsParameterHintOptions
(
a
.
parameterHints
,
b
.
parameterHints
)
&&
a
.
iconsInSuggestions
===
b
.
iconsInSuggestions
&&
a
.
formatOnType
===
b
.
formatOnType
&&
a
.
formatOnPaste
===
b
.
formatOnPaste
...
...
@@ -1732,6 +1763,17 @@ export class EditorOptionsValidator {
};
}
private
static
_sanitizeParameterHintOpts
(
opts
:
IEditorParameterHintOptions
,
defaults
:
InternalParameterHintOptions
):
InternalParameterHintOptions
{
if
(
typeof
opts
!==
'
object
'
)
{
return
defaults
;
}
return
{
enabled
:
_boolean
(
opts
.
enabled
,
defaults
.
enabled
),
cycle
:
_boolean
(
opts
.
cycle
,
defaults
.
cycle
)
};
}
private
static
_santizeHoverOpts
(
_opts
:
boolean
|
IEditorHoverOptions
,
defaults
:
InternalEditorHoverOptions
):
InternalEditorHoverOptions
{
let
opts
:
IEditorHoverOptions
;
if
(
typeof
_opts
===
'
boolean
'
)
{
...
...
@@ -1884,7 +1926,7 @@ export class EditorOptionsValidator {
contextmenu
:
_boolean
(
opts
.
contextmenu
,
defaults
.
contextmenu
),
quickSuggestions
:
quickSuggestions
,
quickSuggestionsDelay
:
_clampedInt
(
opts
.
quickSuggestionsDelay
,
defaults
.
quickSuggestionsDelay
,
Constants
.
MIN_SAFE_SMALL_INTEGER
,
Constants
.
MAX_SAFE_SMALL_INTEGER
),
parameterHints
:
_boolean
(
opts
.
parameterHints
,
defaults
.
parameterHints
),
parameterHints
:
this
.
_sanitizeParameterHintOpts
(
opts
.
parameterHints
,
defaults
.
parameterHints
),
iconsInSuggestions
:
_boolean
(
opts
.
iconsInSuggestions
,
defaults
.
iconsInSuggestions
),
formatOnType
:
_boolean
(
opts
.
formatOnType
,
defaults
.
formatOnType
),
formatOnPaste
:
_boolean
(
opts
.
formatOnPaste
,
defaults
.
formatOnPaste
),
...
...
@@ -2463,7 +2505,10 @@ export const EDITOR_DEFAULTS: IValidatedEditorOptions = {
contextmenu
:
true
,
quickSuggestions
:
{
other
:
true
,
comments
:
false
,
strings
:
false
},
quickSuggestionsDelay
:
10
,
parameterHints
:
true
,
parameterHints
:
{
enabled
:
true
,
cycle
:
false
},
iconsInSuggestions
:
true
,
formatOnType
:
false
,
formatOnPaste
:
false
,
...
...
src/vs/editor/contrib/parameterHints/parameterHintsWidget.ts
浏览文件 @
1b8c51e6
...
...
@@ -169,7 +169,7 @@ export class ParameterHintsModel extends Disposable {
}
private
onEditorConfigurationChange
():
void
{
this
.
enabled
=
this
.
editor
.
getConfiguration
().
contribInfo
.
parameterHints
;
this
.
enabled
=
this
.
editor
.
getConfiguration
().
contribInfo
.
parameterHints
.
enabled
;
if
(
!
this
.
enabled
)
{
this
.
cancel
();
...
...
@@ -476,14 +476,20 @@ export class ParameterHintsWidget implements IContentWidget, IDisposable {
next
():
boolean
{
const
length
=
this
.
hints
.
signatures
.
length
;
const
last
=
(
this
.
currentSignature
%
length
)
===
(
length
-
1
);
const
cycle
=
this
.
editor
.
getConfiguration
().
contribInfo
.
parameterHints
.
cycle
;
// If there is only one signature, or we're on last signature of list
if
(
length
<
2
||
last
)
{
if
(
(
length
<
2
||
last
)
&&
!
cycle
)
{
this
.
cancel
();
return
false
;
}
this
.
currentSignature
++
;
if
(
last
&&
cycle
)
{
this
.
currentSignature
=
0
;
}
else
{
this
.
currentSignature
++
;
}
this
.
render
();
return
true
;
}
...
...
@@ -491,13 +497,20 @@ export class ParameterHintsWidget implements IContentWidget, IDisposable {
previous
():
boolean
{
const
length
=
this
.
hints
.
signatures
.
length
;
const
first
=
this
.
currentSignature
===
0
;
const
cycle
=
this
.
editor
.
getConfiguration
().
contribInfo
.
parameterHints
.
cycle
;
if
(
length
<
2
||
first
)
{
// If there is only one signature, or we're on first signature of list
if
((
length
<
2
||
first
)
&&
!
cycle
)
{
this
.
cancel
();
return
false
;
}
this
.
currentSignature
--
;
if
(
first
&&
cycle
)
{
this
.
currentSignature
=
length
-
1
;
}
else
{
this
.
currentSignature
--
;
}
this
.
render
();
return
true
;
}
...
...
src/vs/monaco.d.ts
浏览文件 @
1b8c51e6
...
...
@@ -2508,6 +2508,22 @@ declare namespace monaco.editor {
sticky
?:
boolean
;
}
/**
* Configuration options for parameter hints
*/
export
interface
IEditorParameterHintOptions
{
/**
* Enable parameter hints.
* Defaults to true.
*/
enabled
?:
boolean
;
/**
* Enable cycling of parameter hints.
* Defaults to false.
*/
cycle
?:
boolean
;
}
export
interface
ISuggestOptions
{
/**
* Enable graceful matching. Defaults to true.
...
...
@@ -2793,9 +2809,9 @@ declare namespace monaco.editor {
*/
quickSuggestionsDelay
?:
number
;
/**
*
Enables parameter hints
*
Parameter hint options.
*/
parameterHints
?:
boolean
;
parameterHints
?:
IEditorParameterHintOptions
;
/**
* Render icons in suggestions box.
* Defaults to true.
...
...
@@ -3130,6 +3146,11 @@ declare namespace monaco.editor {
readonly
snippetsPreventQuickSuggestions
:
boolean
;
}
export
interface
InternalParameterHintOptions
{
readonly
enabled
:
boolean
;
readonly
cycle
:
boolean
;
}
export
interface
EditorWrappingInfo
{
readonly
inDiffEditor
:
boolean
;
readonly
isDominatedByLongLines
:
boolean
;
...
...
@@ -3194,7 +3215,7 @@ declare namespace monaco.editor {
strings
:
boolean
;
};
readonly
quickSuggestionsDelay
:
number
;
readonly
parameterHints
:
boolean
;
readonly
parameterHints
:
InternalParameterHintOptions
;
readonly
iconsInSuggestions
:
boolean
;
readonly
formatOnType
:
boolean
;
readonly
formatOnPaste
:
boolean
;
...
...
src/vs/platform/telemetry/common/telemetryUtils.ts
浏览文件 @
1b8c51e6
...
...
@@ -113,7 +113,8 @@ const configurationValueWhitelist = [
'
editor.multiCursorModifier
'
,
'
editor.quickSuggestions
'
,
'
editor.quickSuggestionsDelay
'
,
'
editor.parameterHints
'
,
'
editor.parameterHints.enabled
'
,
'
editor.parameterHints.cycle
'
,
'
editor.autoClosingBrackets
'
,
'
editor.autoIndent
'
,
'
editor.formatOnType
'
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录