Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
掘金者说
vscode
提交
a8eadbd8
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,发现更多精彩内容 >>
提交
a8eadbd8
编写于
5月 30, 2016
作者:
M
Martin Aeschlimann
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Clean up __characterPairSupport, fixes #6889
上级
db21446a
变更
17
隐藏空白更改
内联
并排
Showing
17 changed file
with
134 addition
and
136 deletion
+134
-136
extensions/json/client/src/jsonMain.ts
extensions/json/client/src/jsonMain.ts
+8
-10
extensions/php/src/phpMain.ts
extensions/php/src/phpMain.ts
+7
-9
extensions/typescript/src/typescriptMain.ts
extensions/typescript/src/typescriptMain.ts
+8
-10
src/vs/editor/common/modes/monarch/monarchDefinition.ts
src/vs/editor/common/modes/monarch/monarchDefinition.ts
+2
-4
src/vs/editor/common/modes/supports/characterPair.ts
src/vs/editor/common/modes/supports/characterPair.ts
+7
-9
src/vs/editor/common/modes/supports/richEditSupport.ts
src/vs/editor/common/modes/supports/richEditSupport.ts
+8
-6
src/vs/editor/node/languageConfiguration.ts
src/vs/editor/node/languageConfiguration.ts
+3
-9
src/vs/editor/test/common/controller/cursor.test.ts
src/vs/editor/test/common/controller/cursor.test.ts
+1
-3
src/vs/languages/css/common/css.ts
src/vs/languages/css/common/css.ts
+7
-9
src/vs/languages/handlebars/common/handlebars.ts
src/vs/languages/handlebars/common/handlebars.ts
+13
-14
src/vs/languages/html/common/html.ts
src/vs/languages/html/common/html.ts
+12
-13
src/vs/languages/json/common/json.ts
src/vs/languages/json/common/json.ts
+5
-7
src/vs/languages/php/common/php.ts
src/vs/languages/php/common/php.ts
+7
-9
src/vs/languages/razor/common/razor.ts
src/vs/languages/razor/common/razor.ts
+11
-13
src/vs/languages/typescript/common/mode.ts
src/vs/languages/typescript/common/mode.ts
+8
-10
src/vs/vscode.d.ts
src/vs/vscode.d.ts
+21
-1
src/vs/workbench/api/node/extHost.api.impl.ts
src/vs/workbench/api/node/extHost.api.impl.ts
+6
-0
未找到文件。
extensions/json/client/src/jsonMain.ts
浏览文件 @
a8eadbd8
...
...
@@ -94,16 +94,14 @@ export function activate(context: ExtensionContext) {
languages
.
setLanguageConfiguration
(
'
json
'
,
{
wordPattern
:
/
(
-
?\d
*
\.\d\w
*
)
|
([^\[\{\]\}\:\"\,\s]
+
)
/g
,
__characterPairSupport
:
{
autoClosingPairs
:
[
{
open
:
'
{
'
,
close
:
'
}
'
},
{
open
:
'
[
'
,
close
:
'
]
'
},
{
open
:
'
(
'
,
close
:
'
)
'
},
{
open
:
'
"
'
,
close
:
'
"
'
,
notIn
:
[
'
string
'
]
},
{
open
:
'
\'
'
,
close
:
'
\'
'
,
notIn
:
[
'
string
'
,
'
comment
'
]
},
{
open
:
'
`
'
,
close
:
'
`
'
,
notIn
:
[
'
string
'
,
'
comment
'
]
}
]
}
autoClosingPairs
:
[
{
open
:
'
{
'
,
close
:
'
}
'
},
{
open
:
'
[
'
,
close
:
'
]
'
},
{
open
:
'
(
'
,
close
:
'
)
'
},
{
open
:
'
"
'
,
close
:
'
"
'
,
notIn
:
[
'
string
'
]
},
{
open
:
'
\'
'
,
close
:
'
\'
'
,
notIn
:
[
'
string
'
,
'
comment
'
]
},
{
open
:
'
`
'
,
close
:
'
`
'
,
notIn
:
[
'
string
'
,
'
comment
'
]
}
]
});
});
}
...
...
extensions/php/src/phpMain.ts
浏览文件 @
a8eadbd8
...
...
@@ -28,14 +28,12 @@ export function activate(context: ExtensionContext): any {
languages
.
setLanguageConfiguration
(
'
php
'
,
{
wordPattern
:
/
(
-
?\d
*
\.\d\w
*
)
|
([^\-\`\~\!\@\#\%\^\&\*\(\)\=\+\[\{\]\}\\\|\;\:\'\"\,\.\<\>\/\?\s]
+
)
/g
,
__characterPairSupport
:
{
autoClosingPairs
:
[
{
open
:
'
{
'
,
close
:
'
}
'
},
{
open
:
'
[
'
,
close
:
'
]
'
},
{
open
:
'
(
'
,
close
:
'
)
'
},
{
open
:
'
"
'
,
close
:
'
"
'
,
notIn
:
[
'
string
'
]
},
{
open
:
'
\'
'
,
close
:
'
\'
'
,
notIn
:
[
'
string
'
,
'
comment
'
]
}
]
}
autoClosingPairs
:
[
{
open
:
'
{
'
,
close
:
'
}
'
},
{
open
:
'
[
'
,
close
:
'
]
'
},
{
open
:
'
(
'
,
close
:
'
)
'
},
{
open
:
'
"
'
,
close
:
'
"
'
,
notIn
:
[
'
string
'
]
},
{
open
:
'
\'
'
,
close
:
'
\'
'
,
notIn
:
[
'
string
'
,
'
comment
'
]
}
]
});
}
\ No newline at end of file
extensions/typescript/src/typescriptMain.ts
浏览文件 @
a8eadbd8
...
...
@@ -192,16 +192,14 @@ class LanguageProvider {
docComment
:
{
scope
:
'
comment.documentation
'
,
open
:
'
/**
'
,
lineStart
:
'
*
'
,
close
:
'
*/
'
}
},
__characterPairSupport
:
{
autoClosingPairs
:
[
{
open
:
'
{
'
,
close
:
'
}
'
},
{
open
:
'
[
'
,
close
:
'
]
'
},
{
open
:
'
(
'
,
close
:
'
)
'
},
{
open
:
'
"
'
,
close
:
'
"
'
,
notIn
:
[
'
string
'
]
},
{
open
:
'
\'
'
,
close
:
'
\'
'
,
notIn
:
[
'
string
'
,
'
comment
'
]
},
{
open
:
'
`
'
,
close
:
'
`
'
,
notIn
:
[
'
string
'
,
'
comment
'
]
}
]
}
autoClosingPairs
:
[
{
open
:
'
{
'
,
close
:
'
}
'
},
{
open
:
'
[
'
,
close
:
'
]
'
},
{
open
:
'
(
'
,
close
:
'
)
'
},
{
open
:
'
"
'
,
close
:
'
"
'
,
notIn
:
[
'
string
'
]
},
{
open
:
'
\'
'
,
close
:
'
\'
'
,
notIn
:
[
'
string
'
,
'
comment
'
]
},
{
open
:
'
`
'
,
close
:
'
`
'
,
notIn
:
[
'
string
'
,
'
comment
'
]
}
]
});
});
}
...
...
src/vs/editor/common/modes/monarch/monarchDefinition.ts
浏览文件 @
a8eadbd8
...
...
@@ -25,14 +25,12 @@ export function createRichEditSupport(lexer: ILexer): IRichLanguageConfiguration
brackets
:
lexer
.
standardBrackets
,
autoClosingPairs
:
lexer
.
autoClosingPairs
,
__electricCharacterSupport
:
{
// regexBrackets: lexer.enhancedBrackets,
caseInsensitive
:
lexer
.
ignoreCase
,
embeddedElectricCharacters
:
lexer
.
outdentTriggers
.
split
(
''
)
},
__characterPairSupport
:
{
autoClosingPairs
:
lexer
.
autoClosingPairs
}
};
}
src/vs/editor/common/modes/supports/characterPair.ts
浏览文件 @
a8eadbd8
...
...
@@ -4,24 +4,22 @@
*--------------------------------------------------------------------------------------------*/
'
use strict
'
;
import
{
IAutoClosingPair
,
IAutoClosingPairConditional
,
ILineContext
,
IMode
,
IRichEditCharacterPair
}
from
'
vs/editor/common/modes
'
;
import
{
IAutoClosingPair
,
IAutoClosingPairConditional
,
ILineContext
,
IMode
,
IRichEditCharacterPair
,
CharacterPair
}
from
'
vs/editor/common/modes
'
;
import
{
handleEvent
}
from
'
vs/editor/common/modes/supports
'
;
export
interface
ICharacterPairContribution
{
autoClosingPairs
:
IAutoClosingPairConditional
[];
surroundingPairs
?:
IAutoClosingPair
[];
}
export
class
CharacterPairSupport
implements
IRichEditCharacterPair
{
private
_modeId
:
string
;
private
_autoClosingPairs
:
IAutoClosingPairConditional
[];
private
_surroundingPairs
:
IAutoClosingPair
[];
constructor
(
modeId
:
string
,
con
tribution
:
ICharacterPairContribution
)
{
constructor
(
modeId
:
string
,
con
fig
:
{
brackets
?:
CharacterPair
[];
autoClosingPairs
?:
IAutoClosingPairConditional
[],
surroundingPairs
?:
IAutoClosingPair
[]}
)
{
this
.
_modeId
=
modeId
;
this
.
_autoClosingPairs
=
contribution
.
autoClosingPairs
;
this
.
_surroundingPairs
=
Array
.
isArray
(
contribution
.
surroundingPairs
)
?
contribution
.
surroundingPairs
:
contribution
.
autoClosingPairs
;
this
.
_autoClosingPairs
=
config
.
autoClosingPairs
;
if
(
!
this
.
_autoClosingPairs
)
{
this
.
_autoClosingPairs
=
config
.
brackets
?
config
.
brackets
.
map
(
b
=>
({
open
:
b
[
0
],
close
:
b
[
1
]
}))
:
[];
}
this
.
_surroundingPairs
=
config
.
surroundingPairs
||
this
.
_autoClosingPairs
;
}
public
getAutoClosingPairs
():
IAutoClosingPair
[]
{
...
...
src/vs/editor/common/modes/supports/richEditSupport.ts
浏览文件 @
a8eadbd8
...
...
@@ -4,10 +4,10 @@
*--------------------------------------------------------------------------------------------*/
'
use strict
'
;
import
{
ICommentsConfiguration
,
IRichEditBrackets
,
IRichEditCharacterPair
,
IRichEditOnEnter
,
IRichEditSupport
,
CharacterPair
}
from
'
vs/editor/common/modes
'
;
import
{
ICommentsConfiguration
,
IRichEditBrackets
,
IRichEditCharacterPair
,
IAutoClosingPair
,
IAutoClosingPairConditional
,
IRichEditOnEnter
,
IRichEditSupport
,
CharacterPair
}
from
'
vs/editor/common/modes
'
;
import
{
NullMode
}
from
'
vs/editor/common/modes/nullMode
'
;
import
{
CharacterPairSupport
}
from
'
vs/editor/common/modes/supports/characterPair
'
;
import
{
ICharacterPairContribution
}
from
'
vs/editor/common/modes/supports/characterPair
'
;
import
{
BracketElectricCharacterSupport
,
IBracketElectricCharacterContribution
}
from
'
vs/editor/common/modes/supports/electricCharacter
'
;
import
{
IIndentationRules
,
IOnEnterRegExpRules
,
IOnEnterSupportOptions
,
OnEnterSupport
}
from
'
vs/editor/common/modes/supports/onEnter
'
;
import
{
RichEditBrackets
}
from
'
vs/editor/common/modes/supports/richEditBrackets
'
;
...
...
@@ -23,8 +23,9 @@ export interface IRichLanguageConfiguration {
wordPattern
?:
RegExp
;
indentationRules
?:
IIndentationRules
;
onEnterRules
?:
IOnEnterRegExpRules
[];
autoClosingPairs
?:
IAutoClosingPairConditional
[];
surroundingPairs
?:
IAutoClosingPair
[];
__electricCharacterSupport
?:
IBracketElectricCharacterContribution
;
__characterPairSupport
?:
ICharacterPairContribution
;
}
export
class
RichEditSupport
implements
IRichEditSupport
{
...
...
@@ -55,8 +56,8 @@ export class RichEditSupport implements IRichEditSupport {
this
.
_handleComments
(
modeId
,
this
.
_conf
);
if
(
this
.
_conf
.
__characterPairSupport
)
{
this
.
characterPair
=
new
CharacterPairSupport
(
modeId
,
this
.
_conf
.
__characterPairSupport
);
if
(
this
.
_conf
.
autoClosingPairs
)
{
this
.
characterPair
=
new
CharacterPairSupport
(
modeId
,
this
.
_conf
);
}
if
(
this
.
_conf
.
__electricCharacterSupport
||
this
.
_conf
.
brackets
)
{
...
...
@@ -73,8 +74,9 @@ export class RichEditSupport implements IRichEditSupport {
wordPattern
:
(
prev
?
current
.
wordPattern
||
prev
.
wordPattern
:
current
.
wordPattern
),
indentationRules
:
(
prev
?
current
.
indentationRules
||
prev
.
indentationRules
:
current
.
indentationRules
),
onEnterRules
:
(
prev
?
current
.
onEnterRules
||
prev
.
onEnterRules
:
current
.
onEnterRules
),
autoClosingPairs
:
(
prev
?
current
.
autoClosingPairs
||
prev
.
autoClosingPairs
:
current
.
autoClosingPairs
),
surroundingPairs
:
(
prev
?
current
.
surroundingPairs
||
prev
.
surroundingPairs
:
current
.
surroundingPairs
),
__electricCharacterSupport
:
(
prev
?
current
.
__electricCharacterSupport
||
prev
.
__electricCharacterSupport
:
current
.
__electricCharacterSupport
),
__characterPairSupport
:
(
prev
?
current
.
__characterPairSupport
||
prev
.
__characterPairSupport
:
current
.
__characterPairSupport
),
};
}
...
...
src/vs/editor/node/languageConfiguration.ts
浏览文件 @
a8eadbd8
...
...
@@ -81,17 +81,11 @@ export class LanguageConfigurationFileHandler {
}
if
(
configuration
.
autoClosingPairs
)
{
richEditConfig
.
__characterPairSupport
=
{
autoClosingPairs
:
this
.
_mapCharacterPairs
(
configuration
.
autoClosingPairs
)
};
}
else
if
(
configuration
.
brackets
)
{
richEditConfig
.
__characterPairSupport
=
{
autoClosingPairs
:
this
.
_mapCharacterPairs
(
configuration
.
brackets
)
};
richEditConfig
.
autoClosingPairs
=
this
.
_mapCharacterPairs
(
configuration
.
autoClosingPairs
);
}
if
(
richEditConfig
.
__characterPairSupport
&&
configuration
.
surroundingPairs
)
{
richEditConfig
.
__characterPairSupport
.
surroundingPairs
=
this
.
_mapCharacterPairs
(
configuration
.
surroundingPairs
);
if
(
configuration
.
surroundingPairs
)
{
richEditConfig
.
surroundingPairs
=
this
.
_mapCharacterPairs
(
configuration
.
surroundingPairs
);
}
this
.
_modeService
.
registerRichEditSupport
(
modeId
,
richEditConfig
);
...
...
src/vs/editor/test/common/controller/cursor.test.ts
浏览文件 @
a8eadbd8
...
...
@@ -1078,9 +1078,7 @@ class SurroundingMode extends TestMode {
constructor
()
{
super
();
this
.
richEditSupport
=
new
RichEditSupport
(
this
.
getId
(),
null
,
{
__characterPairSupport
:
{
autoClosingPairs
:
[{
open
:
'
(
'
,
close
:
'
)
'
}]
}
autoClosingPairs
:
[{
open
:
'
(
'
,
close
:
'
)
'
}]
});
}
}
...
...
src/vs/languages/css/common/css.ts
浏览文件 @
a8eadbd8
...
...
@@ -313,15 +313,13 @@ export class CSSMode extends AbstractMode {
[
'
(
'
,
'
)
'
]
],
__characterPairSupport
:
{
autoClosingPairs
:
[
{
open
:
'
{
'
,
close
:
'
}
'
},
{
open
:
'
[
'
,
close
:
'
]
'
},
{
open
:
'
(
'
,
close
:
'
)
'
},
{
open
:
'
"
'
,
close
:
'
"
'
,
notIn
:
[
'
string
'
]
},
{
open
:
'
\'
'
,
close
:
'
\'
'
,
notIn
:
[
'
string
'
]
}
]
}
autoClosingPairs
:
[
{
open
:
'
{
'
,
close
:
'
}
'
},
{
open
:
'
[
'
,
close
:
'
]
'
},
{
open
:
'
(
'
,
close
:
'
)
'
},
{
open
:
'
"
'
,
close
:
'
"
'
,
notIn
:
[
'
string
'
]
},
{
open
:
'
\'
'
,
close
:
'
\'
'
,
notIn
:
[
'
string
'
]
}
]
});
this
.
inplaceReplaceSupport
=
this
;
...
...
src/vs/languages/handlebars/common/handlebars.ts
浏览文件 @
a8eadbd8
...
...
@@ -169,20 +169,19 @@ export class HandlebarsMode extends htmlMode.HTMLMode<htmlWorker.HTMLWorker> {
embeddedElectricCharacters
:
[
'
*
'
,
'
}
'
,
'
]
'
,
'
)
'
]
},
__characterPairSupport
:
{
autoClosingPairs
:
[
{
open
:
'
{
'
,
close
:
'
}
'
},
{
open
:
'
[
'
,
close
:
'
]
'
},
{
open
:
'
(
'
,
close
:
'
)
'
},
{
open
:
'
"
'
,
close
:
'
"
'
},
{
open
:
'
\'
'
,
close
:
'
\'
'
}
],
surroundingPairs
:
[
{
open
:
'
<
'
,
close
:
'
>
'
},
{
open
:
'
"
'
,
close
:
'
"
'
},
{
open
:
'
\'
'
,
close
:
'
\'
'
}
]
},
autoClosingPairs
:
[
{
open
:
'
{
'
,
close
:
'
}
'
},
{
open
:
'
[
'
,
close
:
'
]
'
},
{
open
:
'
(
'
,
close
:
'
)
'
},
{
open
:
'
"
'
,
close
:
'
"
'
},
{
open
:
'
\'
'
,
close
:
'
\'
'
}
],
surroundingPairs
:
[
{
open
:
'
<
'
,
close
:
'
>
'
},
{
open
:
'
"
'
,
close
:
'
"
'
},
{
open
:
'
\'
'
,
close
:
'
\'
'
}
],
onEnterRules
:
[
{
...
...
src/vs/languages/html/common/html.ts
浏览文件 @
a8eadbd8
...
...
@@ -391,19 +391,18 @@ export class HTMLMode<W extends htmlWorker.HTMLWorker> extends AbstractMode impl
embeddedElectricCharacters
:
[
'
*
'
,
'
}
'
,
'
]
'
,
'
)
'
]
},
__characterPairSupport
:
{
autoClosingPairs
:
[
{
open
:
'
{
'
,
close
:
'
}
'
},
{
open
:
'
[
'
,
close
:
'
]
'
},
{
open
:
'
(
'
,
close
:
'
)
'
},
{
open
:
'
"
'
,
close
:
'
"
'
},
{
open
:
'
\'
'
,
close
:
'
\'
'
}
],
surroundingPairs
:
[
{
open
:
'
"
'
,
close
:
'
"
'
},
{
open
:
'
\'
'
,
close
:
'
\'
'
}
]
},
autoClosingPairs
:
[
{
open
:
'
{
'
,
close
:
'
}
'
},
{
open
:
'
[
'
,
close
:
'
]
'
},
{
open
:
'
(
'
,
close
:
'
)
'
},
{
open
:
'
"
'
,
close
:
'
"
'
},
{
open
:
'
\'
'
,
close
:
'
\'
'
}
],
surroundingPairs
:
[
{
open
:
'
"
'
,
close
:
'
"
'
},
{
open
:
'
\'
'
,
close
:
'
\'
'
}
],
onEnterRules
:
[
{
...
...
src/vs/languages/json/common/json.ts
浏览文件 @
a8eadbd8
...
...
@@ -54,13 +54,11 @@ export class JSONMode extends AbstractMode {
[
'
[
'
,
'
]
'
]
],
__characterPairSupport
:
{
autoClosingPairs
:
[
{
open
:
'
{
'
,
close
:
'
}
'
,
notIn
:
[
'
string
'
]
},
{
open
:
'
[
'
,
close
:
'
]
'
,
notIn
:
[
'
string
'
]
},
{
open
:
'
"
'
,
close
:
'
"
'
,
notIn
:
[
'
string
'
]
}
]
}
autoClosingPairs
:
[
{
open
:
'
{
'
,
close
:
'
}
'
,
notIn
:
[
'
string
'
]
},
{
open
:
'
[
'
,
close
:
'
]
'
,
notIn
:
[
'
string
'
]
},
{
open
:
'
"
'
,
close
:
'
"
'
,
notIn
:
[
'
string
'
]
}
]
});
modes
.
HoverProviderRegistry
.
register
(
this
.
getId
(),
{
...
...
src/vs/languages/php/common/php.ts
浏览文件 @
a8eadbd8
...
...
@@ -482,15 +482,13 @@ export class PHPMode extends AbstractMode implements ITokenizationCustomization
[
'
(
'
,
'
)
'
]
],
__characterPairSupport
:
{
autoClosingPairs
:
[
{
open
:
'
{
'
,
close
:
'
}
'
,
notIn
:
[
'
string.php
'
]
},
{
open
:
'
[
'
,
close
:
'
]
'
,
notIn
:
[
'
string.php
'
]
},
{
open
:
'
(
'
,
close
:
'
)
'
,
notIn
:
[
'
string.php
'
]
},
{
open
:
'
"
'
,
close
:
'
"
'
,
notIn
:
[
'
string.php
'
]
},
{
open
:
'
\'
'
,
close
:
'
\'
'
,
notIn
:
[
'
string.php
'
]
}
]
}
autoClosingPairs
:
[
{
open
:
'
{
'
,
close
:
'
}
'
,
notIn
:
[
'
string.php
'
]
},
{
open
:
'
[
'
,
close
:
'
]
'
,
notIn
:
[
'
string.php
'
]
},
{
open
:
'
(
'
,
close
:
'
)
'
,
notIn
:
[
'
string.php
'
]
},
{
open
:
'
"
'
,
close
:
'
"
'
,
notIn
:
[
'
string.php
'
]
},
{
open
:
'
\'
'
,
close
:
'
\'
'
,
notIn
:
[
'
string.php
'
]
}
]
});
if
(
editorWorkerService
)
{
...
...
src/vs/languages/razor/common/razor.ts
浏览文件 @
a8eadbd8
...
...
@@ -123,19 +123,17 @@ export class RAZORMode extends htmlMode.HTMLMode<RAZORWorker> {
embeddedElectricCharacters
:
[
'
*
'
,
'
}
'
,
'
]
'
,
'
)
'
]
},
__characterPairSupport
:
{
autoClosingPairs
:
[
{
open
:
'
{
'
,
close
:
'
}
'
},
{
open
:
'
[
'
,
close
:
'
]
'
},
{
open
:
'
(
'
,
close
:
'
)
'
},
{
open
:
'
"
'
,
close
:
'
"
'
},
{
open
:
'
\'
'
,
close
:
'
\'
'
}
],
surroundingPairs
:
[
{
open
:
'
"
'
,
close
:
'
"
'
},
{
open
:
'
\'
'
,
close
:
'
\'
'
}
]
},
autoClosingPairs
:
[
{
open
:
'
{
'
,
close
:
'
}
'
},
{
open
:
'
[
'
,
close
:
'
]
'
},
{
open
:
'
(
'
,
close
:
'
)
'
},
{
open
:
'
"
'
,
close
:
'
"
'
},
{
open
:
'
\'
'
,
close
:
'
\'
'
}
],
surroundingPairs
:
[
{
open
:
'
"
'
,
close
:
'
"
'
},
{
open
:
'
\'
'
,
close
:
'
\'
'
}
],
onEnterRules
:
[
{
...
...
src/vs/languages/typescript/common/mode.ts
浏览文件 @
a8eadbd8
...
...
@@ -85,16 +85,14 @@ const richEditConfiguration:IRichLanguageConfiguration = {
docComment
:
{
scope
:
'
comment.doc
'
,
open
:
'
/**
'
,
lineStart
:
'
*
'
,
close
:
'
*/
'
}
},
__characterPairSupport
:
{
autoClosingPairs
:
[
{
open
:
'
{
'
,
close
:
'
}
'
},
{
open
:
'
[
'
,
close
:
'
]
'
},
{
open
:
'
(
'
,
close
:
'
)
'
},
{
open
:
'
"
'
,
close
:
'
"
'
,
notIn
:
[
'
string
'
]
},
{
open
:
'
\'
'
,
close
:
'
\'
'
,
notIn
:
[
'
string
'
,
'
comment
'
]
},
{
open
:
'
`
'
,
close
:
'
`
'
}
]
}
autoClosingPairs
:
[
{
open
:
'
{
'
,
close
:
'
}
'
},
{
open
:
'
[
'
,
close
:
'
]
'
},
{
open
:
'
(
'
,
close
:
'
)
'
},
{
open
:
'
"
'
,
close
:
'
"
'
,
notIn
:
[
'
string
'
]
},
{
open
:
'
\'
'
,
close
:
'
\'
'
,
notIn
:
[
'
string
'
,
'
comment
'
]
},
{
open
:
'
`
'
,
close
:
'
`
'
}
]
};
export
function
createRichEditSupport
(
modeId
:
string
):
RichEditSupport
{
...
...
src/vs/vscode.d.ts
浏览文件 @
a8eadbd8
...
...
@@ -2300,6 +2300,26 @@ declare namespace vscode {
*/
onEnterRules
?:
OnEnterRule
[];
/**
* The language's auto closing pairs. The 'close' character is automatically inserted with the
* 'open' character is typed. If not set, the configured brackets will be used.
*/
autoClosingPairs
?:
{
open
:
string
;
close
:
string
;
notIn
?:
string
[];
}[];
/**
* The language's surrounding pairs. When the 'open' character is typed on a selection, the
* selected string is surrounded by the open and close characters. If not set, the autoclosing pairs
* settings will be used.
*/
surroundingPairs
?:
{
open
:
string
;
close
:
string
;
}[];
/**
* **Deprecated** Do not use.
*
...
...
@@ -2323,7 +2343,7 @@ declare namespace vscode {
/**
* **Deprecated** Do not use.
*
* @deprecated
Will be replaced by a better API soon
.
* @deprecated
Use autoClosingPairs and surroundingPairs instead
.
*/
__characterPairSupport
?:
{
autoClosingPairs
:
{
...
...
src/vs/workbench/api/node/extHost.api.impl.ts
浏览文件 @
a8eadbd8
...
...
@@ -419,6 +419,12 @@ export class ExtHostAPIImplementation {
setWordDefinitionFor
(
modeId
,
null
);
}
// backward compatibility, migrate deprecated setting
if
(
configuration
.
__characterPairSupport
&&
!
configuration
.
autoClosingPairs
)
{
configuration
.
autoClosingPairs
=
configuration
.
__characterPairSupport
.
autoClosingPairs
;
delete
configuration
.
__characterPairSupport
;
}
return
this
.
Modes_RichEditSupport_register
(
modeId
,
configuration
);
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录