mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-10 10:12:34 -05:00
Merge from vscode cfc1ab4c5f816765b91fb7ead3c3427a7c8581a3
This commit is contained in:
@@ -895,7 +895,7 @@ suite('ExtHostLanguageFeatureCommands', function () {
|
||||
|
||||
disposables.push(extHost.registerCallHierarchyProvider(nullExtensionDescription, defaultSelector, new class implements vscode.CallHierarchyProvider {
|
||||
|
||||
prepareCallHierarchy(document: vscode.TextDocument, position: vscode.Position, ): vscode.ProviderResult<vscode.CallHierarchyItem> {
|
||||
prepareCallHierarchy(document: vscode.TextDocument, position: vscode.Position,): vscode.ProviderResult<vscode.CallHierarchyItem> {
|
||||
return new types.CallHierarchyItem(types.SymbolKind.Constant, 'ROOT', 'ROOT', document.uri, new types.Range(0, 0, 0, 0), new types.Range(0, 0, 0, 0));
|
||||
}
|
||||
|
||||
@@ -931,4 +931,53 @@ suite('ExtHostLanguageFeatureCommands', function () {
|
||||
assert.equal(outgoing.length, 1);
|
||||
assert.equal(outgoing[0].to.name, 'OUTGOING');
|
||||
});
|
||||
|
||||
test('selectionRangeProvider on inner array always returns outer array #91852', async function () {
|
||||
|
||||
disposables.push(extHost.registerSelectionRangeProvider(nullExtensionDescription, defaultSelector, <vscode.SelectionRangeProvider>{
|
||||
provideSelectionRanges(_doc, positions) {
|
||||
const [first] = positions;
|
||||
return [
|
||||
new types.SelectionRange(new types.Range(first.line, first.character, first.line, first.character)),
|
||||
];
|
||||
}
|
||||
}));
|
||||
|
||||
await rpcProtocol.sync();
|
||||
let value = await commands.executeCommand<vscode.SelectionRange[]>('vscode.executeSelectionRangeProvider', model.uri, [new types.Position(0, 10)]);
|
||||
assert.equal(value.length, 1);
|
||||
assert.equal(value[0].range.start.line, 0);
|
||||
assert.equal(value[0].range.start.character, 10);
|
||||
assert.equal(value[0].range.end.line, 0);
|
||||
assert.equal(value[0].range.end.character, 10);
|
||||
});
|
||||
|
||||
test('selectionRangeProvider on inner array always returns outer array #91852', async function () {
|
||||
|
||||
disposables.push(extHost.registerSelectionRangeProvider(nullExtensionDescription, defaultSelector, <vscode.SelectionRangeProvider>{
|
||||
provideSelectionRanges(_doc, positions) {
|
||||
const [first, second] = positions;
|
||||
return [
|
||||
new types.SelectionRange(new types.Range(first.line, first.character, first.line, first.character)),
|
||||
new types.SelectionRange(new types.Range(second.line, second.character, second.line, second.character)),
|
||||
];
|
||||
}
|
||||
}));
|
||||
|
||||
await rpcProtocol.sync();
|
||||
let value = await commands.executeCommand<vscode.SelectionRange[]>(
|
||||
'vscode.executeSelectionRangeProvider',
|
||||
model.uri,
|
||||
[new types.Position(0, 0), new types.Position(0, 10)]
|
||||
);
|
||||
assert.equal(value.length, 2);
|
||||
assert.equal(value[0].range.start.line, 0);
|
||||
assert.equal(value[0].range.start.character, 0);
|
||||
assert.equal(value[0].range.end.line, 0);
|
||||
assert.equal(value[0].range.end.character, 0);
|
||||
assert.equal(value[1].range.start.line, 0);
|
||||
assert.equal(value[1].range.start.character, 10);
|
||||
assert.equal(value[1].range.end.line, 0);
|
||||
assert.equal(value[1].range.end.character, 10);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -13,7 +13,7 @@ import { ITextFileService } from 'vs/workbench/services/textfile/common/textfile
|
||||
import { ExtHostDocumentsAndEditorsShape, IDocumentsAndEditorsDelta } from 'vs/workbench/api/common/extHost.protocol';
|
||||
import { createTestCodeEditor, TestCodeEditor } from 'vs/editor/test/browser/testCodeEditor';
|
||||
import { mock } from 'vs/workbench/test/browser/api/mock';
|
||||
import { TestEditorService, TestEditorGroupsService, TestTextResourcePropertiesService, TestEnvironmentService } from 'vs/workbench/test/browser/workbenchTestServices';
|
||||
import { TestEditorService, TestEditorGroupsService, TestEnvironmentService } from 'vs/workbench/test/browser/workbenchTestServices';
|
||||
import { Event } from 'vs/base/common/event';
|
||||
import { ITextModel } from 'vs/editor/common/model';
|
||||
import { ServiceCollection } from 'vs/platform/instantiation/common/serviceCollection';
|
||||
@@ -25,6 +25,7 @@ import { NullLogService } from 'vs/platform/log/common/log';
|
||||
import { UndoRedoService } from 'vs/platform/undoRedo/common/undoRedoService';
|
||||
import { TestDialogService } from 'vs/platform/dialogs/test/common/testDialogService';
|
||||
import { TestNotificationService } from 'vs/platform/notification/test/common/testNotificationService';
|
||||
import { TestTextResourcePropertiesService } from 'vs/workbench/test/common/workbenchTestServices';
|
||||
|
||||
suite('MainThreadDocumentsAndEditors', () => {
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@ import { Range } from 'vs/editor/common/core/range';
|
||||
import { Position } from 'vs/editor/common/core/position';
|
||||
import { IModelService } from 'vs/editor/common/services/modelService';
|
||||
import { EditOperation } from 'vs/editor/common/core/editOperation';
|
||||
import { TestFileService, TestEditorService, TestEditorGroupsService, TestEnvironmentService, TestContextService, TestTextResourcePropertiesService } from 'vs/workbench/test/browser/workbenchTestServices';
|
||||
import { TestFileService, TestEditorService, TestEditorGroupsService, TestEnvironmentService } from 'vs/workbench/test/browser/workbenchTestServices';
|
||||
import { BulkEditService } from 'vs/workbench/services/bulkEdit/browser/bulkEditService';
|
||||
import { NullLogService, ILogService } from 'vs/platform/log/common/log';
|
||||
import { ITextModelService, IResolvedTextEditorModel } from 'vs/editor/common/services/resolverService';
|
||||
@@ -47,6 +47,7 @@ import { IDialogService } from 'vs/platform/dialogs/common/dialogs';
|
||||
import { IUndoRedoService } from 'vs/platform/undoRedo/common/undoRedo';
|
||||
import { TestNotificationService } from 'vs/platform/notification/test/common/testNotificationService';
|
||||
import { INotificationService } from 'vs/platform/notification/common/notification';
|
||||
import { TestTextResourcePropertiesService, TestContextService } from 'vs/workbench/test/common/workbenchTestServices';
|
||||
|
||||
suite('MainThreadEditors', () => {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user