mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-03-21 20:30:29 -04:00
Merge VS Code 1.31.1 (#4283)
This commit is contained in:
@@ -51,8 +51,8 @@ export class TestFindController extends CommonFindController {
|
||||
}
|
||||
}
|
||||
|
||||
function fromRange(rng: Range): number[] {
|
||||
return [rng.startLineNumber, rng.startColumn, rng.endLineNumber, rng.endColumn];
|
||||
function fromSelection(slc: Selection): number[] {
|
||||
return [slc.startLineNumber, slc.startColumn, slc.endLineNumber, slc.endColumn];
|
||||
}
|
||||
|
||||
suite('FindController', () => {
|
||||
@@ -67,8 +67,8 @@ suite('FindController', () => {
|
||||
getBoolean: (key: string) => !!queryState[key],
|
||||
getInteger: (key: string) => undefined,
|
||||
store: (key: string, value: any) => { queryState[key] = value; return Promise.resolve(); },
|
||||
remove: (key) => void 0
|
||||
} as IStorageService);
|
||||
remove: (key) => undefined
|
||||
} as any);
|
||||
|
||||
if (platform.isMacintosh) {
|
||||
serviceCollection.set(IClipboardService, <any>{
|
||||
@@ -122,7 +122,7 @@ suite('FindController', () => {
|
||||
nextMatchFindAction.run(null, editor);
|
||||
assert.equal(findState.searchString, 'ABC');
|
||||
|
||||
assert.deepEqual(fromRange(editor.getSelection()), [1, 1, 1, 4]);
|
||||
assert.deepEqual(fromSelection(editor.getSelection()!), [1, 1, 1, 4]);
|
||||
|
||||
findController.dispose();
|
||||
});
|
||||
@@ -175,14 +175,14 @@ suite('FindController', () => {
|
||||
findState.change({ searchString: 'ABC' }, true);
|
||||
|
||||
// The first ABC is highlighted.
|
||||
assert.deepEqual(fromRange(editor.getSelection()), [1, 1, 1, 4]);
|
||||
assert.deepEqual(fromSelection(editor.getSelection()!), [1, 1, 1, 4]);
|
||||
|
||||
// I hit Esc to exit the Find dialog.
|
||||
findController.closeFindWidget();
|
||||
findController.hasFocus = false;
|
||||
|
||||
// The cursor is now at end of the first line, with ABC on that line highlighted.
|
||||
assert.deepEqual(fromRange(editor.getSelection()), [1, 1, 1, 4]);
|
||||
assert.deepEqual(fromSelection(editor.getSelection()!), [1, 1, 1, 4]);
|
||||
|
||||
// I hit delete to remove it and change the text to XYZ.
|
||||
editor.pushUndoStop();
|
||||
@@ -195,10 +195,10 @@ suite('FindController', () => {
|
||||
// ABC
|
||||
// XYZ
|
||||
// ABC
|
||||
assert.equal(editor.getModel().getLineContent(1), 'XYZ');
|
||||
assert.equal(editor.getModel()!.getLineContent(1), 'XYZ');
|
||||
|
||||
// The cursor is at end of the first line.
|
||||
assert.deepEqual(fromRange(editor.getSelection()), [1, 4, 1, 4]);
|
||||
assert.deepEqual(fromSelection(editor.getSelection()!), [1, 4, 1, 4]);
|
||||
|
||||
// I hit F3 to "Find Next" to find the next occurrence of ABC, but instead it searches for XYZ.
|
||||
nextMatchFindAction.run(null, editor);
|
||||
@@ -224,10 +224,10 @@ suite('FindController', () => {
|
||||
});
|
||||
|
||||
nextMatchFindAction.run(null, editor);
|
||||
assert.deepEqual(fromRange(editor.getSelection()), [1, 26, 1, 29]);
|
||||
assert.deepEqual(fromSelection(editor.getSelection()!), [1, 26, 1, 29]);
|
||||
|
||||
nextMatchFindAction.run(null, editor);
|
||||
assert.deepEqual(fromRange(editor.getSelection()), [1, 8, 1, 11]);
|
||||
assert.deepEqual(fromSelection(editor.getSelection()!), [1, 8, 1, 11]);
|
||||
|
||||
findController.dispose();
|
||||
});
|
||||
@@ -250,10 +250,10 @@ suite('FindController', () => {
|
||||
startFindAction.run(null, editor);
|
||||
|
||||
nextMatchFindAction.run(null, editor);
|
||||
assert.deepEqual(fromRange(editor.getSelection()), [2, 9, 2, 13]);
|
||||
assert.deepEqual(fromSelection(editor.getSelection()!), [2, 9, 2, 13]);
|
||||
|
||||
nextMatchFindAction.run(null, editor);
|
||||
assert.deepEqual(fromRange(editor.getSelection()), [1, 9, 1, 13]);
|
||||
assert.deepEqual(fromSelection(editor.getSelection()!), [1, 9, 1, 13]);
|
||||
|
||||
findController.dispose();
|
||||
});
|
||||
@@ -330,7 +330,7 @@ suite('FindController', () => {
|
||||
findController.getState().change({ searchString: '\\b\\s{3}\\b', replaceString: ' ', isRegex: true }, false);
|
||||
findController.moveToNextMatch();
|
||||
|
||||
assert.deepEqual(editor.getSelections().map(fromRange), [
|
||||
assert.deepEqual(editor.getSelections()!.map(fromSelection), [
|
||||
[1, 39, 1, 42]
|
||||
]);
|
||||
|
||||
@@ -357,7 +357,7 @@ suite('FindController', () => {
|
||||
findController.getState().change({ searchString: '^', replaceString: 'x', isRegex: true }, false);
|
||||
findController.moveToNextMatch();
|
||||
|
||||
assert.deepEqual(editor.getSelections().map(fromRange), [
|
||||
assert.deepEqual(editor.getSelections()!.map(fromSelection), [
|
||||
[2, 1, 2, 1]
|
||||
]);
|
||||
|
||||
@@ -388,7 +388,7 @@ suite('FindController', () => {
|
||||
// cmd+f3
|
||||
nextSelectionMatchFindAction.run(null, editor);
|
||||
|
||||
assert.deepEqual(editor.getSelections().map(fromRange), [
|
||||
assert.deepEqual(editor.getSelections()!.map(fromSelection), [
|
||||
[3, 1, 3, 9]
|
||||
]);
|
||||
|
||||
@@ -419,7 +419,7 @@ suite('FindController', () => {
|
||||
// cmd+f3
|
||||
nextSelectionMatchFindAction.run(null, editor);
|
||||
|
||||
assert.deepEqual(editor.getSelections().map(fromRange), [
|
||||
assert.deepEqual(editor.getSelections()!.map(fromSelection), [
|
||||
[3, 1, 3, 9]
|
||||
]);
|
||||
|
||||
@@ -442,8 +442,8 @@ suite('FindController query options persistence', () => {
|
||||
getBoolean: (key: string) => !!queryState[key],
|
||||
getInteger: (key: string) => undefined,
|
||||
store: (key: string, value: any) => { queryState[key] = value; return Promise.resolve(); },
|
||||
remove: (key) => void 0
|
||||
} as IStorageService);
|
||||
remove: (key) => undefined
|
||||
} as any);
|
||||
|
||||
test('matchCase', () => {
|
||||
withTestCodeEditor([
|
||||
@@ -464,7 +464,7 @@ suite('FindController query options persistence', () => {
|
||||
// I type ABC.
|
||||
findState.change({ searchString: 'ABC' }, true);
|
||||
// The second ABC is highlighted as matchCase is true.
|
||||
assert.deepEqual(fromRange(editor.getSelection()), [2, 1, 2, 4]);
|
||||
assert.deepEqual(fromSelection(editor.getSelection()!), [2, 1, 2, 4]);
|
||||
|
||||
findController.dispose();
|
||||
});
|
||||
@@ -491,7 +491,7 @@ suite('FindController query options persistence', () => {
|
||||
// I type AB.
|
||||
findState.change({ searchString: 'AB' }, true);
|
||||
// The second AB is highlighted as wholeWord is true.
|
||||
assert.deepEqual(fromRange(editor.getSelection()), [2, 1, 2, 3]);
|
||||
assert.deepEqual(fromSelection(editor.getSelection()!), [2, 1, 2, 3]);
|
||||
|
||||
findController.dispose();
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user