fixes #5269: [json] "Format Code" folds braces into preceding comments.

This commit is contained in:
Martin Aeschlimann
2016-04-22 15:57:04 +02:00
parent 41ec572ca0
commit fc59387aba
4 changed files with 58 additions and 2 deletions

View File

@@ -240,6 +240,19 @@ suite('JSON Formatter', () => {
format(content, expected);
});
test('single line comment on same line 2', () => {
var content = [
'{ //comment',
'}'
].join('\n');
var expected = [
'{ //comment',
'}'
].join('\n');
format(content, expected);
});
test('block comment on same line', () => {
var content = [
'{ "a": {}, /*comment*/ ',
@@ -295,6 +308,20 @@ suite('JSON Formatter', () => {
format(content, expected);
});
test('multiple mixed comments on same line', () => {
var content = [
'[ /*comment*/ /*comment*/ // comment ',
']'
].join('\n');
var expected = [
'[ /*comment*/ /*comment*/ // comment ',
']'
].join('\n');
format(content, expected);
});
test('range', () => {
var content = [