Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
9752af2c
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,发现更多精彩内容 >>
未验证
提交
9752af2c
编写于
12月 06, 2019
作者:
A
Alex Dima
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fixes #84595: editor.matchBrackets can now be 'never' | 'near' | 'always'
上级
e7c13723
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
25 addition
and
15 deletion
+25
-15
src/vs/editor/common/config/commonEditorConfig.ts
src/vs/editor/common/config/commonEditorConfig.ts
+7
-0
src/vs/editor/common/config/editorOptions.ts
src/vs/editor/common/config/editorOptions.ts
+7
-5
src/vs/editor/contrib/bracketMatching/bracketMatching.ts
src/vs/editor/contrib/bracketMatching/bracketMatching.ts
+9
-8
src/vs/monaco.d.ts
src/vs/monaco.d.ts
+2
-2
未找到文件。
src/vs/editor/common/config/commonEditorConfig.ts
浏览文件 @
9752af2c
...
...
@@ -263,6 +263,13 @@ function migrateOptions(options: IEditorOptions): void {
}
else
if
(
<
any
>
autoIndent
===
false
)
{
options
.
autoIndent
=
'
advanced
'
;
}
const
matchBrackets
=
options
.
matchBrackets
;
if
(
<
any
>
matchBrackets
===
true
)
{
options
.
matchBrackets
=
'
always
'
;
}
else
if
(
<
any
>
matchBrackets
===
false
)
{
options
.
matchBrackets
=
'
never
'
;
}
}
function
deepCloneAndMigrateOptions
(
_options
:
IEditorOptions
):
IEditorOptions
{
...
...
src/vs/editor/common/config/editorOptions.ts
浏览文件 @
9752af2c
...
...
@@ -481,9 +481,9 @@ export interface IEditorOptions {
showFoldingControls
?:
'
always
'
|
'
mouseover
'
;
/**
* Enable highlighting of matching brackets.
* Defaults to
true
.
* Defaults to
'always'
.
*/
matchBrackets
?:
boolean
;
matchBrackets
?:
'
never
'
|
'
near
'
|
'
always
'
;
/**
* Enable rendering of whitespace.
* Defaults to none.
...
...
@@ -3356,9 +3356,11 @@ export const EditorOptions = {
EditorOption
.
links
,
'
links
'
,
true
,
{
description
:
nls
.
localize
(
'
links
'
,
"
Controls whether the editor should detect links and make them clickable.
"
)
}
)),
matchBrackets
:
register
(
new
EditorBooleanOption
(
EditorOption
.
matchBrackets
,
'
matchBrackets
'
,
true
,
{
description
:
nls
.
localize
(
'
matchBrackets
'
,
"
Highlight matching brackets when one of them is selected.
"
)
}
matchBrackets
:
register
(
new
EditorStringEnumOption
(
EditorOption
.
matchBrackets
,
'
matchBrackets
'
,
'
always
'
as
'
never
'
|
'
near
'
|
'
always
'
,
[
'
always
'
,
'
near
'
,
'
never
'
]
as
const
,
{
description
:
nls
.
localize
(
'
matchBrackets
'
,
"
Highlight matching brackets.
"
)
}
)),
minimap
:
register
(
new
EditorMinimap
()),
mouseStyle
:
register
(
new
EditorStringEnumOption
(
...
...
src/vs/editor/contrib/bracketMatching/bracketMatching.ts
浏览文件 @
9752af2c
...
...
@@ -116,7 +116,7 @@ export class BracketMatchingController extends Disposable implements editorCommo
private
_lastVersionId
:
number
;
private
_decorations
:
string
[];
private
readonly
_updateBracketsSoon
:
RunOnceScheduler
;
private
_matchBrackets
:
boolean
;
private
_matchBrackets
:
'
never
'
|
'
near
'
|
'
always
'
;
constructor
(
editor
:
ICodeEditor
...
...
@@ -132,7 +132,7 @@ export class BracketMatchingController extends Disposable implements editorCommo
this
.
_updateBracketsSoon
.
schedule
();
this
.
_register
(
editor
.
onDidChangeCursorPosition
((
e
)
=>
{
if
(
!
this
.
_matchBrackets
)
{
if
(
this
.
_matchBrackets
===
'
never
'
)
{
// Early exit if nothing needs to be done!
// Leave some form of early exit check here if you wish to continue being a cursor position change listener ;)
return
;
...
...
@@ -153,12 +153,13 @@ export class BracketMatchingController extends Disposable implements editorCommo
this
.
_updateBracketsSoon
.
schedule
();
}));
this
.
_register
(
editor
.
onDidChangeConfiguration
((
e
)
=>
{
this
.
_matchBrackets
=
this
.
_editor
.
getOption
(
EditorOption
.
matchBrackets
);
if
(
!
this
.
_matchBrackets
&&
this
.
_decorations
.
length
>
0
)
{
// Remove existing decorations if bracket matching is off
if
(
e
.
hasChanged
(
EditorOption
.
matchBrackets
))
{
this
.
_matchBrackets
=
this
.
_editor
.
getOption
(
EditorOption
.
matchBrackets
);
this
.
_decorations
=
this
.
_editor
.
deltaDecorations
(
this
.
_decorations
,
[]);
this
.
_lastBracketsData
=
[];
this
.
_lastVersionId
=
0
;
this
.
_updateBracketsSoon
.
schedule
();
}
this
.
_updateBracketsSoon
.
schedule
();
}));
}
...
...
@@ -262,7 +263,7 @@ export class BracketMatchingController extends Disposable implements editorCommo
});
private
_updateBrackets
():
void
{
if
(
!
this
.
_matchBrackets
)
{
if
(
this
.
_matchBrackets
===
'
never
'
)
{
return
;
}
this
.
_recomputeBrackets
();
...
...
@@ -332,7 +333,7 @@ export class BracketMatchingController extends Disposable implements editorCommo
}
else
{
let
brackets
=
model
.
matchBracket
(
position
);
let
options
=
BracketMatchingController
.
_DECORATION_OPTIONS_WITH_OVERVIEW_RULER
;
if
(
!
brackets
)
{
if
(
!
brackets
&&
this
.
_matchBrackets
===
'
always
'
)
{
brackets
=
model
.
findEnclosingBrackets
(
position
);
options
=
BracketMatchingController
.
_DECORATION_OPTIONS_WITHOUT_OVERVIEW_RULER
;
}
...
...
src/vs/monaco.d.ts
浏览文件 @
9752af2c
...
...
@@ -2880,9 +2880,9 @@ declare namespace monaco.editor {
showFoldingControls
?:
'
always
'
|
'
mouseover
'
;
/**
* Enable highlighting of matching brackets.
* Defaults to
true
.
* Defaults to
'always'
.
*/
matchBrackets
?:
boolean
;
matchBrackets
?:
'
never
'
|
'
near
'
|
'
always
'
;
/**
* Enable rendering of whitespace.
* Defaults to none.
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录