add markdown list folding, #57104 (#57899)

This commit is contained in:
Jason Bright
2018-09-04 20:43:35 -04:00
committed by Matt Bierner
parent cd7c7c5fa2
commit d540729e40
2 changed files with 35 additions and 2 deletions

View File

@@ -103,6 +103,25 @@ a`);
assert.strictEqual(second.end, 9);
});
test('Should fold from list to end of document', async () => {
const folds = await getFoldsForDocument(`a
- b
c
d`);
assert.strictEqual(folds.length, 1);
const firstFold = folds[0];
assert.strictEqual(firstFold.start, 1);
assert.strictEqual(firstFold.end, 3);
});
test('Should fold if list has multiple lines of content', async () => {
const folds = await getFoldsForDocument(`a
- This list item\n spans multiple\n lines.`);
assert.strictEqual(folds.length, 1);
const firstFold = folds[0];
assert.strictEqual(firstFold.start, 1);
assert.strictEqual(firstFold.end, 3);
});
});