mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-24 10:38:59 +01:00
make sure the API doesn't allow to set an empty selections array (#251010)
re https://github.com/microsoft/vscode-copilot/issues/18075
This commit is contained in:
@@ -295,4 +295,19 @@ suite('vscode API - editors', () => {
|
||||
|
||||
assert.strictEqual(document.getText(), Buffer.from(await workspace.fs.readFile(file)).toString());
|
||||
}
|
||||
|
||||
test('extEditor.selection can be empty #18075', async function () {
|
||||
await withRandomFileEditor('foo', async editor => {
|
||||
|
||||
assert.ok(editor.selections.length > 0);
|
||||
|
||||
editor.selections = [];
|
||||
|
||||
assert.strictEqual(editor.selections.length, 1);
|
||||
assert.strictEqual(editor.selections[0].start.line, 0);
|
||||
assert.strictEqual(editor.selections[0].start.character, 0);
|
||||
assert.strictEqual(editor.selections[0].end.line, 0);
|
||||
assert.strictEqual(editor.selections[0].end.character, 0);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user