Merge from vscode 4d91d96e5e121b38d33508cdef17868bab255eae

This commit is contained in:
ADS Merger
2020-06-18 04:32:54 +00:00
committed by AzureDataStudio
parent a971aee5bd
commit 5e7071e466
1002 changed files with 24201 additions and 13193 deletions

File diff suppressed because one or more lines are too long

View File

@@ -883,9 +883,9 @@ suite('ExtHostLanguageFeatures', function () {
}, []));
await rpcProtocol.sync();
const value = await provideSuggestionItems(model, new EditorPosition(1, 1), new CompletionOptions(undefined, new Set<modes.CompletionItemKind>().add(modes.CompletionItemKind.Snippet)));
assert.equal(value.length, 1);
assert.equal(value[0].completion.insertText, 'testing2');
const { items } = await provideSuggestionItems(model, new EditorPosition(1, 1), new CompletionOptions(undefined, new Set<modes.CompletionItemKind>().add(modes.CompletionItemKind.Snippet)));
assert.equal(items.length, 1);
assert.equal(items[0].completion.insertText, 'testing2');
});
test('Suggest, order 2/3', async () => {
@@ -903,9 +903,9 @@ suite('ExtHostLanguageFeatures', function () {
}, []));
await rpcProtocol.sync();
const value = await provideSuggestionItems(model, new EditorPosition(1, 1), new CompletionOptions(undefined, new Set<modes.CompletionItemKind>().add(modes.CompletionItemKind.Snippet)));
assert.equal(value.length, 1);
assert.equal(value[0].completion.insertText, 'weak-selector');
const { items } = await provideSuggestionItems(model, new EditorPosition(1, 1), new CompletionOptions(undefined, new Set<modes.CompletionItemKind>().add(modes.CompletionItemKind.Snippet)));
assert.equal(items.length, 1);
assert.equal(items[0].completion.insertText, 'weak-selector');
});
test('Suggest, order 2/3', async () => {
@@ -923,10 +923,10 @@ suite('ExtHostLanguageFeatures', function () {
}, []));
await rpcProtocol.sync();
const value = await provideSuggestionItems(model, new EditorPosition(1, 1), new CompletionOptions(undefined, new Set<modes.CompletionItemKind>().add(modes.CompletionItemKind.Snippet)));
assert.equal(value.length, 2);
assert.equal(value[0].completion.insertText, 'strong-1'); // sort by label
assert.equal(value[1].completion.insertText, 'strong-2');
const { items } = await provideSuggestionItems(model, new EditorPosition(1, 1), new CompletionOptions(undefined, new Set<modes.CompletionItemKind>().add(modes.CompletionItemKind.Snippet)));
assert.equal(items.length, 2);
assert.equal(items[0].completion.insertText, 'strong-1'); // sort by label
assert.equal(items[1].completion.insertText, 'strong-2');
});
test('Suggest, evil provider', async () => {
@@ -945,8 +945,8 @@ suite('ExtHostLanguageFeatures', function () {
await rpcProtocol.sync();
const value = await provideSuggestionItems(model, new EditorPosition(1, 1), new CompletionOptions(undefined, new Set<modes.CompletionItemKind>().add(modes.CompletionItemKind.Snippet)));
assert.equal(value[0].container.incomplete, false);
const { items } = await provideSuggestionItems(model, new EditorPosition(1, 1), new CompletionOptions(undefined, new Set<modes.CompletionItemKind>().add(modes.CompletionItemKind.Snippet)));
assert.equal(items[0].container.incomplete, false);
});
test('Suggest, CompletionList', async () => {
@@ -958,8 +958,8 @@ suite('ExtHostLanguageFeatures', function () {
}, []));
await rpcProtocol.sync();
provideSuggestionItems(model, new EditorPosition(1, 1), new CompletionOptions(undefined, new Set<modes.CompletionItemKind>().add(modes.CompletionItemKind.Snippet))).then(value => {
assert.equal(value[0].container.incomplete, true);
provideSuggestionItems(model, new EditorPosition(1, 1), new CompletionOptions(undefined, new Set<modes.CompletionItemKind>().add(modes.CompletionItemKind.Snippet))).then(model => {
assert.equal(model.items[0].container.incomplete, true);
});
});

View File

@@ -13,7 +13,7 @@ import { IDisposable, Disposable } from 'vs/base/common/lifecycle';
import * as platform from 'vs/base/common/platform';
const emptyDialogService = new class implements IDialogService {
_serviceBrand: undefined;
declare readonly _serviceBrand: undefined;
show(): never {
throw new Error('not implemented');
}
@@ -37,7 +37,7 @@ const emptyCommandService: ICommandService = {
};
const emptyNotificationService = new class implements INotificationService {
_serviceBrand: undefined;
declare readonly _serviceBrand: undefined;
notify(...args: any[]): never {
throw new Error('not implemented');
}
@@ -62,7 +62,7 @@ const emptyNotificationService = new class implements INotificationService {
};
class EmptyNotificationService implements INotificationService {
_serviceBrand: undefined;
declare readonly _serviceBrand: undefined;
constructor(private withNotify: (notification: INotification) => void) {
}

View File

@@ -73,7 +73,7 @@ suite('NotebookConcatDocument', function () {
});
await extHostNotebooks.$acceptDocumentAndEditorsDelta({ newActiveEditor: '_notebook_editor_0' });
notebook = extHostNotebooks.activeNotebookDocument!;
notebook = extHostNotebooks.notebookDocuments[0]!;
disposables.add(reg);
disposables.add(notebook);

View File

@@ -7,12 +7,21 @@
import * as assert from 'assert';
import { MarkdownString, LogLevel } from 'vs/workbench/api/common/extHostTypeConverters';
import { isEmptyObject } from 'vs/base/common/types';
import { size, forEach } from 'vs/base/common/collections';
import { forEach } from 'vs/base/common/collections';
import * as types from 'vs/workbench/api/common/extHostTypes';
import { LogLevel as _MainLogLevel } from 'vs/platform/log/common/log';
import { URI } from 'vs/base/common/uri';
suite('ExtHostTypeConverter', function () {
function size<T>(from: Record<any, any>): number {
let count = 0;
for (let key in from) {
if (Object.prototype.hasOwnProperty.call(from, key)) {
count += 1;
}
}
return count;
}
test('MarkdownConvert - uris', function () {

View File

@@ -8,10 +8,11 @@ import { BoundModelReferenceCollection } from 'vs/workbench/api/browser/mainThre
import { createTextModel } from 'vs/editor/test/common/editorTestUtils';
import { timeout } from 'vs/base/common/async';
import { URI } from 'vs/base/common/uri';
import { extUri } from 'vs/base/common/resources';
suite('BoundModelReferenceCollection', () => {
let col = new BoundModelReferenceCollection(15, 75);
let col = new BoundModelReferenceCollection(extUri, 15, 75);
teardown(() => {
col.dispose();

View File

@@ -27,6 +27,7 @@ import { TestDialogService } from 'vs/platform/dialogs/test/common/testDialogSer
import { TestNotificationService } from 'vs/platform/notification/test/common/testNotificationService';
import { TestTextResourcePropertiesService, TestWorkingCopyFileService } from 'vs/workbench/test/common/workbenchTestServices';
import { UriIdentityService } from 'vs/workbench/services/uriIdentity/common/uriIdentityService';
import { IClipboardService } from 'vs/platform/clipboard/common/clipboardService';
suite('MainThreadDocumentsAndEditors', () => {
@@ -67,6 +68,8 @@ suite('MainThreadDocumentsAndEditors', () => {
const fileService = new class extends mock<IFileService>() {
onDidRunOperation = Event.None;
onDidChangeFileSystemProviderCapabilities = Event.None;
onDidChangeFileSystemProviderRegistrations = Event.None;
};
new MainThreadDocumentsAndEditors(
@@ -82,7 +85,7 @@ suite('MainThreadDocumentsAndEditors', () => {
editorGroupService,
null!,
new class extends mock<IPanelService>() implements IPanelService {
_serviceBrand: undefined;
declare readonly _serviceBrand: undefined;
onDidPanelOpen = Event.None;
onDidPanelClose = Event.None;
getActivePanel() {
@@ -92,6 +95,11 @@ suite('MainThreadDocumentsAndEditors', () => {
TestEnvironmentService,
new TestWorkingCopyFileService(),
new UriIdentityService(fileService),
new class extends mock<IClipboardService>() {
readText() {
return Promise.resolve('clipboard_contents');
}
}
);
});

View File

@@ -48,6 +48,8 @@ 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';
import { IUriIdentityService } from 'vs/workbench/services/uriIdentity/common/uriIdentity';
import { extUri } from 'vs/base/common/resources';
suite('MainThreadEditors', () => {
@@ -131,13 +133,16 @@ suite('MainThreadEditors', () => {
});
services.set(IPanelService, new class extends mock<IPanelService>() implements IPanelService {
_serviceBrand: undefined;
declare readonly _serviceBrand: undefined;
onDidPanelOpen = Event.None;
onDidPanelClose = Event.None;
getActivePanel() {
return undefined;
}
});
services.set(IUriIdentityService, new class extends mock<IUriIdentityService>() {
get extUri() { return extUri; }
});
const instaService = new InstantiationService(services);