mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-25 02:58:56 +01:00
fixes #5269: [json] "Format Code" folds braces into preceding comments.
This commit is contained in:
@@ -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 = [
|
||||
|
||||
Reference in New Issue
Block a user