mirror of
https://github.com/microsoft/vscode.git
synced 2025-12-24 12:19:20 +00:00
Fixes #16573: Ensure textEditor.options always contains all properties
This commit is contained in:
@@ -6,7 +6,7 @@
|
||||
'use strict';
|
||||
|
||||
import * as assert from 'assert';
|
||||
import { workspace, window, Position, Range, commands, TextEditor, TextDocument } from 'vscode';
|
||||
import { workspace, window, Position, Range, commands, TextEditor, TextDocument, TextEditorCursorStyle, TextEditorLineNumbersStyle } from 'vscode';
|
||||
import { createRandomFile, deleteFile, cleanUp } from './utils';
|
||||
|
||||
suite('editor tests', () => {
|
||||
@@ -98,4 +98,32 @@ suite('editor tests', () => {
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
test('issue #16573: Extension API: insertSpaces and tabSize are undefined', () => {
|
||||
return withRandomFileEditor('Hello world!\n\tHello world!', (editor, doc) => {
|
||||
|
||||
assert.equal(editor.options.tabSize, 4);
|
||||
assert.equal(editor.options.insertSpaces, false);
|
||||
assert.equal(editor.options.cursorStyle, TextEditorCursorStyle.Line);
|
||||
assert.equal(editor.options.lineNumbers, TextEditorLineNumbersStyle.On);
|
||||
|
||||
editor.options = {
|
||||
tabSize: 2
|
||||
};
|
||||
|
||||
assert.equal(editor.options.tabSize, 2);
|
||||
assert.equal(editor.options.insertSpaces, false);
|
||||
assert.equal(editor.options.cursorStyle, TextEditorCursorStyle.Line);
|
||||
assert.equal(editor.options.lineNumbers, TextEditorLineNumbersStyle.On);
|
||||
|
||||
editor.options.tabSize = 'invalid';
|
||||
|
||||
assert.equal(editor.options.tabSize, 2);
|
||||
assert.equal(editor.options.insertSpaces, false);
|
||||
assert.equal(editor.options.cursorStyle, TextEditorCursorStyle.Line);
|
||||
assert.equal(editor.options.lineNumbers, TextEditorLineNumbersStyle.On);
|
||||
|
||||
return Promise.resolve();
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user