Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
11871fb6
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,发现更多精彩内容 >>
未验证
提交
11871fb6
编写于
1月 08, 2018
作者:
A
Alexandru Dima
提交者:
GitHub
1月 08, 2018
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #39347 from mjbvz/38254
Fix auto closing of < in markdown code blocks
上级
e8cc004e
4809111c
变更
2
显示空白变更内容
内联
并排
Showing
2 changed file
with
20 addition
and
20 deletion
+20
-20
src/vs/editor/common/modes/supports/characterPair.ts
src/vs/editor/common/modes/supports/characterPair.ts
+1
-1
src/vs/editor/test/common/modes/supports/characterPair.test.ts
...s/editor/test/common/modes/supports/characterPair.test.ts
+19
-19
未找到文件。
src/vs/editor/common/modes/supports/characterPair.ts
浏览文件 @
11871fb6
...
...
@@ -45,7 +45,7 @@ export class CharacterPairSupport {
}
}
return
tru
e
;
return
fals
e
;
}
public
getSurroundingPairs
():
IAutoClosingPair
[]
{
...
...
src/vs/editor/test/common/modes/supports/characterPair.test.ts
浏览文件 @
11871fb6
...
...
@@ -59,64 +59,64 @@ suite('CharacterPairSupport', () => {
test
(
'
shouldAutoClosePair in empty line
'
,
()
=>
{
let
sup
=
new
CharacterPairSupport
({
autoClosingPairs
:
[{
open
:
'
{
'
,
close
:
'
}
'
,
notIn
:
[
'
string
'
,
'
comment
'
]
}]
});
assert
.
equal
(
testShouldAutoClose
(
sup
,
[],
'
a
'
,
1
),
tru
e
);
assert
.
equal
(
testShouldAutoClose
(
sup
,
[],
'
a
'
,
1
),
fals
e
);
assert
.
equal
(
testShouldAutoClose
(
sup
,
[],
'
{
'
,
1
),
true
);
});
test
(
'
shouldAutoClosePair in not interesting line 1
'
,
()
=>
{
let
sup
=
new
CharacterPairSupport
({
autoClosingPairs
:
[{
open
:
'
{
'
,
close
:
'
}
'
,
notIn
:
[
'
string
'
,
'
comment
'
]
}]
});
assert
.
equal
(
testShouldAutoClose
(
sup
,
[{
text
:
'
do
'
,
type
:
StandardTokenType
.
Other
}],
'
{
'
,
3
),
true
);
assert
.
equal
(
testShouldAutoClose
(
sup
,
[{
text
:
'
do
'
,
type
:
StandardTokenType
.
Other
}],
'
a
'
,
3
),
tru
e
);
assert
.
equal
(
testShouldAutoClose
(
sup
,
[{
text
:
'
do
'
,
type
:
StandardTokenType
.
Other
}],
'
a
'
,
3
),
fals
e
);
});
test
(
'
shouldAutoClosePair in not interesting line 2
'
,
()
=>
{
let
sup
=
new
CharacterPairSupport
({
autoClosingPairs
:
[{
open
:
'
{
'
,
close
:
'
}
'
}]
});
assert
.
equal
(
testShouldAutoClose
(
sup
,
[{
text
:
'
do
'
,
type
:
StandardTokenType
.
String
}],
'
{
'
,
3
),
true
);
assert
.
equal
(
testShouldAutoClose
(
sup
,
[{
text
:
'
do
'
,
type
:
StandardTokenType
.
String
}],
'
a
'
,
3
),
tru
e
);
assert
.
equal
(
testShouldAutoClose
(
sup
,
[{
text
:
'
do
'
,
type
:
StandardTokenType
.
String
}],
'
a
'
,
3
),
fals
e
);
});
test
(
'
shouldAutoClosePair in interesting line 1
'
,
()
=>
{
let
sup
=
new
CharacterPairSupport
({
autoClosingPairs
:
[{
open
:
'
{
'
,
close
:
'
}
'
,
notIn
:
[
'
string
'
,
'
comment
'
]
}]
});
assert
.
equal
(
testShouldAutoClose
(
sup
,
[{
text
:
'
"a"
'
,
type
:
StandardTokenType
.
String
}],
'
{
'
,
1
),
false
);
assert
.
equal
(
testShouldAutoClose
(
sup
,
[{
text
:
'
"a"
'
,
type
:
StandardTokenType
.
String
}],
'
a
'
,
1
),
tru
e
);
assert
.
equal
(
testShouldAutoClose
(
sup
,
[{
text
:
'
"a"
'
,
type
:
StandardTokenType
.
String
}],
'
a
'
,
1
),
fals
e
);
assert
.
equal
(
testShouldAutoClose
(
sup
,
[{
text
:
'
"a"
'
,
type
:
StandardTokenType
.
String
}],
'
{
'
,
2
),
false
);
assert
.
equal
(
testShouldAutoClose
(
sup
,
[{
text
:
'
"a"
'
,
type
:
StandardTokenType
.
String
}],
'
a
'
,
2
),
tru
e
);
assert
.
equal
(
testShouldAutoClose
(
sup
,
[{
text
:
'
"a"
'
,
type
:
StandardTokenType
.
String
}],
'
a
'
,
2
),
fals
e
);
assert
.
equal
(
testShouldAutoClose
(
sup
,
[{
text
:
'
"a"
'
,
type
:
StandardTokenType
.
String
}],
'
{
'
,
3
),
false
);
assert
.
equal
(
testShouldAutoClose
(
sup
,
[{
text
:
'
"a"
'
,
type
:
StandardTokenType
.
String
}],
'
a
'
,
3
),
tru
e
);
assert
.
equal
(
testShouldAutoClose
(
sup
,
[{
text
:
'
"a"
'
,
type
:
StandardTokenType
.
String
}],
'
a
'
,
3
),
fals
e
);
assert
.
equal
(
testShouldAutoClose
(
sup
,
[{
text
:
'
"a"
'
,
type
:
StandardTokenType
.
String
}],
'
{
'
,
4
),
false
);
assert
.
equal
(
testShouldAutoClose
(
sup
,
[{
text
:
'
"a"
'
,
type
:
StandardTokenType
.
String
}],
'
a
'
,
4
),
tru
e
);
assert
.
equal
(
testShouldAutoClose
(
sup
,
[{
text
:
'
"a"
'
,
type
:
StandardTokenType
.
String
}],
'
a
'
,
4
),
fals
e
);
});
test
(
'
shouldAutoClosePair in interesting line 2
'
,
()
=>
{
let
sup
=
new
CharacterPairSupport
({
autoClosingPairs
:
[{
open
:
'
{
'
,
close
:
'
}
'
,
notIn
:
[
'
string
'
,
'
comment
'
]
}]
});
assert
.
equal
(
testShouldAutoClose
(
sup
,
[{
text
:
'
x=
'
,
type
:
StandardTokenType
.
Other
},
{
text
:
'
"a"
'
,
type
:
StandardTokenType
.
String
},
{
text
:
'
;
'
,
type
:
StandardTokenType
.
Other
}],
'
{
'
,
1
),
true
);
assert
.
equal
(
testShouldAutoClose
(
sup
,
[{
text
:
'
x=
'
,
type
:
StandardTokenType
.
Other
},
{
text
:
'
"a"
'
,
type
:
StandardTokenType
.
String
},
{
text
:
'
;
'
,
type
:
StandardTokenType
.
Other
}],
'
a
'
,
1
),
tru
e
);
assert
.
equal
(
testShouldAutoClose
(
sup
,
[{
text
:
'
x=
'
,
type
:
StandardTokenType
.
Other
},
{
text
:
'
"a"
'
,
type
:
StandardTokenType
.
String
},
{
text
:
'
;
'
,
type
:
StandardTokenType
.
Other
}],
'
a
'
,
1
),
fals
e
);
assert
.
equal
(
testShouldAutoClose
(
sup
,
[{
text
:
'
x=
'
,
type
:
StandardTokenType
.
Other
},
{
text
:
'
"a"
'
,
type
:
StandardTokenType
.
String
},
{
text
:
'
;
'
,
type
:
StandardTokenType
.
Other
}],
'
{
'
,
2
),
true
);
assert
.
equal
(
testShouldAutoClose
(
sup
,
[{
text
:
'
x=
'
,
type
:
StandardTokenType
.
Other
},
{
text
:
'
"a"
'
,
type
:
StandardTokenType
.
String
},
{
text
:
'
;
'
,
type
:
StandardTokenType
.
Other
}],
'
a
'
,
2
),
tru
e
);
assert
.
equal
(
testShouldAutoClose
(
sup
,
[{
text
:
'
x=
'
,
type
:
StandardTokenType
.
Other
},
{
text
:
'
"a"
'
,
type
:
StandardTokenType
.
String
},
{
text
:
'
;
'
,
type
:
StandardTokenType
.
Other
}],
'
a
'
,
2
),
fals
e
);
assert
.
equal
(
testShouldAutoClose
(
sup
,
[{
text
:
'
x=
'
,
type
:
StandardTokenType
.
Other
},
{
text
:
'
"a"
'
,
type
:
StandardTokenType
.
String
},
{
text
:
'
;
'
,
type
:
StandardTokenType
.
Other
}],
'
{
'
,
3
),
true
);
assert
.
equal
(
testShouldAutoClose
(
sup
,
[{
text
:
'
x=
'
,
type
:
StandardTokenType
.
Other
},
{
text
:
'
"a"
'
,
type
:
StandardTokenType
.
String
},
{
text
:
'
;
'
,
type
:
StandardTokenType
.
Other
}],
'
a
'
,
3
),
tru
e
);
assert
.
equal
(
testShouldAutoClose
(
sup
,
[{
text
:
'
x=
'
,
type
:
StandardTokenType
.
Other
},
{
text
:
'
"a"
'
,
type
:
StandardTokenType
.
String
},
{
text
:
'
;
'
,
type
:
StandardTokenType
.
Other
}],
'
a
'
,
3
),
fals
e
);
assert
.
equal
(
testShouldAutoClose
(
sup
,
[{
text
:
'
x=
'
,
type
:
StandardTokenType
.
Other
},
{
text
:
'
"a"
'
,
type
:
StandardTokenType
.
String
},
{
text
:
'
;
'
,
type
:
StandardTokenType
.
Other
}],
'
{
'
,
4
),
false
);
assert
.
equal
(
testShouldAutoClose
(
sup
,
[{
text
:
'
x=
'
,
type
:
StandardTokenType
.
Other
},
{
text
:
'
"a"
'
,
type
:
StandardTokenType
.
String
},
{
text
:
'
;
'
,
type
:
StandardTokenType
.
Other
}],
'
a
'
,
4
),
tru
e
);
assert
.
equal
(
testShouldAutoClose
(
sup
,
[{
text
:
'
x=
'
,
type
:
StandardTokenType
.
Other
},
{
text
:
'
"a"
'
,
type
:
StandardTokenType
.
String
},
{
text
:
'
;
'
,
type
:
StandardTokenType
.
Other
}],
'
a
'
,
4
),
fals
e
);
assert
.
equal
(
testShouldAutoClose
(
sup
,
[{
text
:
'
x=
'
,
type
:
StandardTokenType
.
Other
},
{
text
:
'
"a"
'
,
type
:
StandardTokenType
.
String
},
{
text
:
'
;
'
,
type
:
StandardTokenType
.
Other
}],
'
{
'
,
5
),
false
);
assert
.
equal
(
testShouldAutoClose
(
sup
,
[{
text
:
'
x=
'
,
type
:
StandardTokenType
.
Other
},
{
text
:
'
"a"
'
,
type
:
StandardTokenType
.
String
},
{
text
:
'
;
'
,
type
:
StandardTokenType
.
Other
}],
'
a
'
,
5
),
tru
e
);
assert
.
equal
(
testShouldAutoClose
(
sup
,
[{
text
:
'
x=
'
,
type
:
StandardTokenType
.
Other
},
{
text
:
'
"a"
'
,
type
:
StandardTokenType
.
String
},
{
text
:
'
;
'
,
type
:
StandardTokenType
.
Other
}],
'
a
'
,
5
),
fals
e
);
assert
.
equal
(
testShouldAutoClose
(
sup
,
[{
text
:
'
x=
'
,
type
:
StandardTokenType
.
Other
},
{
text
:
'
"a"
'
,
type
:
StandardTokenType
.
String
},
{
text
:
'
;
'
,
type
:
StandardTokenType
.
Other
}],
'
{
'
,
6
),
false
);
assert
.
equal
(
testShouldAutoClose
(
sup
,
[{
text
:
'
x=
'
,
type
:
StandardTokenType
.
Other
},
{
text
:
'
"a"
'
,
type
:
StandardTokenType
.
String
},
{
text
:
'
;
'
,
type
:
StandardTokenType
.
Other
}],
'
a
'
,
6
),
tru
e
);
assert
.
equal
(
testShouldAutoClose
(
sup
,
[{
text
:
'
x=
'
,
type
:
StandardTokenType
.
Other
},
{
text
:
'
"a"
'
,
type
:
StandardTokenType
.
String
},
{
text
:
'
;
'
,
type
:
StandardTokenType
.
Other
}],
'
a
'
,
6
),
fals
e
);
assert
.
equal
(
testShouldAutoClose
(
sup
,
[{
text
:
'
x=
'
,
type
:
StandardTokenType
.
Other
},
{
text
:
'
"a"
'
,
type
:
StandardTokenType
.
String
},
{
text
:
'
;
'
,
type
:
StandardTokenType
.
Other
}],
'
{
'
,
7
),
true
);
assert
.
equal
(
testShouldAutoClose
(
sup
,
[{
text
:
'
x=
'
,
type
:
StandardTokenType
.
Other
},
{
text
:
'
"a"
'
,
type
:
StandardTokenType
.
String
},
{
text
:
'
;
'
,
type
:
StandardTokenType
.
Other
}],
'
a
'
,
7
),
tru
e
);
assert
.
equal
(
testShouldAutoClose
(
sup
,
[{
text
:
'
x=
'
,
type
:
StandardTokenType
.
Other
},
{
text
:
'
"a"
'
,
type
:
StandardTokenType
.
String
},
{
text
:
'
;
'
,
type
:
StandardTokenType
.
Other
}],
'
a
'
,
7
),
fals
e
);
});
test
(
'
shouldAutoClosePair in interesting line 3
'
,
()
=>
{
let
sup
=
new
CharacterPairSupport
({
autoClosingPairs
:
[{
open
:
'
{
'
,
close
:
'
}
'
,
notIn
:
[
'
string
'
,
'
comment
'
]
}]
});
assert
.
equal
(
testShouldAutoClose
(
sup
,
[{
text
:
'
'
,
type
:
StandardTokenType
.
Other
},
{
text
:
'
//a
'
,
type
:
StandardTokenType
.
Comment
}],
'
{
'
,
1
),
true
);
assert
.
equal
(
testShouldAutoClose
(
sup
,
[{
text
:
'
'
,
type
:
StandardTokenType
.
Other
},
{
text
:
'
//a
'
,
type
:
StandardTokenType
.
Comment
}],
'
a
'
,
1
),
tru
e
);
assert
.
equal
(
testShouldAutoClose
(
sup
,
[{
text
:
'
'
,
type
:
StandardTokenType
.
Other
},
{
text
:
'
//a
'
,
type
:
StandardTokenType
.
Comment
}],
'
a
'
,
1
),
fals
e
);
assert
.
equal
(
testShouldAutoClose
(
sup
,
[{
text
:
'
'
,
type
:
StandardTokenType
.
Other
},
{
text
:
'
//a
'
,
type
:
StandardTokenType
.
Comment
}],
'
{
'
,
2
),
true
);
assert
.
equal
(
testShouldAutoClose
(
sup
,
[{
text
:
'
'
,
type
:
StandardTokenType
.
Other
},
{
text
:
'
//a
'
,
type
:
StandardTokenType
.
Comment
}],
'
a
'
,
2
),
tru
e
);
assert
.
equal
(
testShouldAutoClose
(
sup
,
[{
text
:
'
'
,
type
:
StandardTokenType
.
Other
},
{
text
:
'
//a
'
,
type
:
StandardTokenType
.
Comment
}],
'
a
'
,
2
),
fals
e
);
assert
.
equal
(
testShouldAutoClose
(
sup
,
[{
text
:
'
'
,
type
:
StandardTokenType
.
Other
},
{
text
:
'
//a
'
,
type
:
StandardTokenType
.
Comment
}],
'
{
'
,
3
),
false
);
assert
.
equal
(
testShouldAutoClose
(
sup
,
[{
text
:
'
'
,
type
:
StandardTokenType
.
Other
},
{
text
:
'
//a
'
,
type
:
StandardTokenType
.
Comment
}],
'
a
'
,
3
),
tru
e
);
assert
.
equal
(
testShouldAutoClose
(
sup
,
[{
text
:
'
'
,
type
:
StandardTokenType
.
Other
},
{
text
:
'
//a
'
,
type
:
StandardTokenType
.
Comment
}],
'
a
'
,
3
),
fals
e
);
assert
.
equal
(
testShouldAutoClose
(
sup
,
[{
text
:
'
'
,
type
:
StandardTokenType
.
Other
},
{
text
:
'
//a
'
,
type
:
StandardTokenType
.
Comment
}],
'
{
'
,
4
),
false
);
assert
.
equal
(
testShouldAutoClose
(
sup
,
[{
text
:
'
'
,
type
:
StandardTokenType
.
Other
},
{
text
:
'
//a
'
,
type
:
StandardTokenType
.
Comment
}],
'
a
'
,
4
),
tru
e
);
assert
.
equal
(
testShouldAutoClose
(
sup
,
[{
text
:
'
'
,
type
:
StandardTokenType
.
Other
},
{
text
:
'
//a
'
,
type
:
StandardTokenType
.
Comment
}],
'
a
'
,
4
),
fals
e
);
assert
.
equal
(
testShouldAutoClose
(
sup
,
[{
text
:
'
'
,
type
:
StandardTokenType
.
Other
},
{
text
:
'
//a
'
,
type
:
StandardTokenType
.
Comment
}],
'
{
'
,
5
),
false
);
assert
.
equal
(
testShouldAutoClose
(
sup
,
[{
text
:
'
'
,
type
:
StandardTokenType
.
Other
},
{
text
:
'
//a
'
,
type
:
StandardTokenType
.
Comment
}],
'
a
'
,
5
),
tru
e
);
assert
.
equal
(
testShouldAutoClose
(
sup
,
[{
text
:
'
'
,
type
:
StandardTokenType
.
Other
},
{
text
:
'
//a
'
,
type
:
StandardTokenType
.
Comment
}],
'
a
'
,
5
),
fals
e
);
});
});
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录