mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 18:46:40 -05:00
Merge from vscode cbeff45f80213db0ddda2183170281ed97ed3b12 (#8670)
* Merge from vscode cbeff45f80213db0ddda2183170281ed97ed3b12 * fix null strict checks
This commit is contained in:
@@ -25,6 +25,9 @@ suite('Breadcrumb Model', function () {
|
||||
}
|
||||
return super.getValue(...args);
|
||||
}
|
||||
updateValue() {
|
||||
return Promise.resolve();
|
||||
}
|
||||
};
|
||||
|
||||
test('only uri, inside workspace', function () {
|
||||
|
||||
@@ -521,8 +521,8 @@ suite('Workbench editor groups', () => {
|
||||
|
||||
const mru = group.getEditors(true);
|
||||
assert.equal(mru[0], input1);
|
||||
assert.equal(mru[1], input2);
|
||||
assert.equal(mru[2], input3);
|
||||
assert.equal(mru[1], input3);
|
||||
assert.equal(mru[2], input2);
|
||||
});
|
||||
|
||||
test('Multiple Editors - Preview gets overwritten', function () {
|
||||
@@ -1115,12 +1115,12 @@ suite('Workbench editor groups', () => {
|
||||
assert.equal(group2.previewEditor!.matches(g2_input2), true);
|
||||
|
||||
assert.equal(group1.getEditors(true)[0].matches(g1_input2), true);
|
||||
assert.equal(group1.getEditors(true)[1].matches(g1_input1), true);
|
||||
assert.equal(group1.getEditors(true)[2].matches(g1_input3), true);
|
||||
assert.equal(group1.getEditors(true)[1].matches(g1_input3), true);
|
||||
assert.equal(group1.getEditors(true)[2].matches(g1_input1), true);
|
||||
|
||||
assert.equal(group2.getEditors(true)[0].matches(g2_input1), true);
|
||||
assert.equal(group2.getEditors(true)[1].matches(g2_input2), true);
|
||||
assert.equal(group2.getEditors(true)[2].matches(g2_input3), true);
|
||||
assert.equal(group2.getEditors(true)[1].matches(g2_input3), true);
|
||||
assert.equal(group2.getEditors(true)[2].matches(g2_input2), true);
|
||||
|
||||
// Create model again - should load from storage
|
||||
group1 = inst.createInstance(EditorGroup, group1.serialize());
|
||||
@@ -1134,12 +1134,12 @@ suite('Workbench editor groups', () => {
|
||||
assert.equal(group2.previewEditor!.matches(g2_input2), true);
|
||||
|
||||
assert.equal(group1.getEditors(true)[0].matches(g1_input2), true);
|
||||
assert.equal(group1.getEditors(true)[1].matches(g1_input1), true);
|
||||
assert.equal(group1.getEditors(true)[2].matches(g1_input3), true);
|
||||
assert.equal(group1.getEditors(true)[1].matches(g1_input3), true);
|
||||
assert.equal(group1.getEditors(true)[2].matches(g1_input1), true);
|
||||
|
||||
assert.equal(group2.getEditors(true)[0].matches(g2_input1), true);
|
||||
assert.equal(group2.getEditors(true)[1].matches(g2_input2), true);
|
||||
assert.equal(group2.getEditors(true)[2].matches(g2_input3), true);
|
||||
assert.equal(group2.getEditors(true)[1].matches(g2_input3), true);
|
||||
assert.equal(group2.getEditors(true)[2].matches(g2_input2), true);
|
||||
});
|
||||
|
||||
test('Single group, multiple editors - persist (some not persistable)', function () {
|
||||
@@ -1172,18 +1172,18 @@ suite('Workbench editor groups', () => {
|
||||
assert.equal(group.previewEditor!.matches(nonSerializableInput2), true);
|
||||
|
||||
assert.equal(group.getEditors(true)[0].matches(nonSerializableInput2), true);
|
||||
assert.equal(group.getEditors(true)[1].matches(serializableInput1), true);
|
||||
assert.equal(group.getEditors(true)[2].matches(serializableInput2), true);
|
||||
assert.equal(group.getEditors(true)[1].matches(serializableInput2), true);
|
||||
assert.equal(group.getEditors(true)[2].matches(serializableInput1), true);
|
||||
|
||||
// Create model again - should load from storage
|
||||
group = inst.createInstance(EditorGroup, group.serialize());
|
||||
|
||||
assert.equal(group.count, 2);
|
||||
assert.equal(group.activeEditor!.matches(serializableInput1), true);
|
||||
assert.equal(group.activeEditor!.matches(serializableInput2), true);
|
||||
assert.equal(group.previewEditor, null);
|
||||
|
||||
assert.equal(group.getEditors(true)[0].matches(serializableInput1), true);
|
||||
assert.equal(group.getEditors(true)[1].matches(serializableInput2), true);
|
||||
assert.equal(group.getEditors(true)[0].matches(serializableInput2), true);
|
||||
assert.equal(group.getEditors(true)[1].matches(serializableInput1), true);
|
||||
});
|
||||
|
||||
test('Multiple groups, multiple editors - persist (some not persistable, causes empty group)', function () {
|
||||
|
||||
@@ -12,7 +12,7 @@ import { ConfigurationModel } from 'vs/platform/configuration/common/configurati
|
||||
import { TestRPCProtocol } from './testRPCProtocol';
|
||||
import { mock } from 'vs/workbench/test/electron-browser/api/mock';
|
||||
import { IWorkspaceFolder, WorkspaceFolder } from 'vs/platform/workspace/common/workspace';
|
||||
import { ConfigurationTarget, IConfigurationModel } from 'vs/platform/configuration/common/configuration';
|
||||
import { ConfigurationTarget, IConfigurationModel, IConfigurationChange } from 'vs/platform/configuration/common/configuration';
|
||||
import { NullLogService } from 'vs/platform/log/common/log';
|
||||
import { assign } from 'vs/base/common/objects';
|
||||
import { IExtHostInitDataService } from 'vs/workbench/api/common/extHostInitDataService';
|
||||
@@ -608,7 +608,7 @@ suite('ExtHostConfiguration', function () {
|
||||
createConfigurationData({
|
||||
'farboo': {
|
||||
'config': false,
|
||||
'updatedconfig': false
|
||||
'updatedConfig': false
|
||||
}
|
||||
}),
|
||||
new NullLogService()
|
||||
@@ -617,29 +617,16 @@ suite('ExtHostConfiguration', function () {
|
||||
const newConfigData = createConfigurationData({
|
||||
'farboo': {
|
||||
'config': false,
|
||||
'updatedconfig': true,
|
||||
'updatedConfig': true,
|
||||
'newConfig': true,
|
||||
}
|
||||
});
|
||||
const changedConfigurationByResource = Object.create({});
|
||||
changedConfigurationByResource[workspaceFolder.uri.toString()] = new ConfigurationModel({
|
||||
'farboo': {
|
||||
'newConfig': true,
|
||||
}
|
||||
}, ['farboo.newConfig']);
|
||||
const configEventData = {
|
||||
changedConfiguration: new ConfigurationModel({
|
||||
'farboo': {
|
||||
'updatedConfig': true,
|
||||
}
|
||||
}, ['farboo.updatedConfig']),
|
||||
changedConfigurationByResource
|
||||
};
|
||||
const configEventData: IConfigurationChange = { keys: ['farboo.updatedConfig', 'farboo.newConfig'], overrides: [] };
|
||||
testObject.onDidChangeConfiguration(e => {
|
||||
|
||||
assert.deepEqual(testObject.getConfiguration().get('farboo'), {
|
||||
'config': false,
|
||||
'updatedconfig': true,
|
||||
'updatedConfig': true,
|
||||
'newConfig': true,
|
||||
});
|
||||
|
||||
@@ -653,7 +640,7 @@ suite('ExtHostConfiguration', function () {
|
||||
|
||||
assert.ok(e.affectsConfiguration('farboo.newConfig'));
|
||||
assert.ok(e.affectsConfiguration('farboo.newConfig', workspaceFolder.uri));
|
||||
assert.ok(!e.affectsConfiguration('farboo.newConfig', URI.file('any')));
|
||||
assert.ok(e.affectsConfiguration('farboo.newConfig', URI.file('any')));
|
||||
|
||||
assert.ok(!e.affectsConfiguration('farboo.config'));
|
||||
assert.ok(!e.affectsConfiguration('farboo.config', workspaceFolder.uri));
|
||||
|
||||
@@ -21,6 +21,7 @@ import { ICodeEditorService } from 'vs/editor/browser/services/codeEditorService
|
||||
import { IFileService } from 'vs/platform/files/common/files';
|
||||
import { IPanelService } from 'vs/workbench/services/panel/common/panelService';
|
||||
import { TestThemeService } from 'vs/platform/theme/test/common/testThemeService';
|
||||
import { NullLogService } from 'vs/platform/log/common/log';
|
||||
|
||||
suite('MainThreadDocumentsAndEditors', () => {
|
||||
|
||||
@@ -43,7 +44,7 @@ suite('MainThreadDocumentsAndEditors', () => {
|
||||
deltas.length = 0;
|
||||
const configService = new TestConfigurationService();
|
||||
configService.setUserConfiguration('editor', { 'detectIndentation': false });
|
||||
modelService = new ModelServiceImpl(configService, new TestTextResourcePropertiesService(configService), new TestThemeService());
|
||||
modelService = new ModelServiceImpl(configService, new TestTextResourcePropertiesService(configService), new TestThemeService(), new NullLogService());
|
||||
codeEditorService = new TestCodeEditorService();
|
||||
textFileService = new class extends mock<ITextFileService>() {
|
||||
isDirty() { return false; }
|
||||
|
||||
@@ -43,7 +43,7 @@ suite('MainThreadEditors', () => {
|
||||
|
||||
setup(() => {
|
||||
const configService = new TestConfigurationService();
|
||||
modelService = new ModelServiceImpl(configService, new TestTextResourcePropertiesService(configService), new TestThemeService());
|
||||
modelService = new ModelServiceImpl(configService, new TestTextResourcePropertiesService(configService), new TestThemeService(), new NullLogService());
|
||||
const codeEditorService = new TestCodeEditorService();
|
||||
|
||||
movedResources.clear();
|
||||
|
||||
@@ -31,6 +31,7 @@ import { IUntitledTextEditorService, UntitledTextEditorService } from 'vs/workbe
|
||||
import { TestContextService, TestEditorGroupsService, TestEditorService, TestEnvironmentService, TestTextResourcePropertiesService } from 'vs/workbench/test/workbenchTestServices';
|
||||
import { ClassifiedEvent, StrictPropertyCheck, GDPRClassification } from 'vs/platform/telemetry/common/gdprTypings';
|
||||
import { TestThemeService } from 'vs/platform/theme/test/common/testThemeService';
|
||||
import { NullLogService } from 'vs/platform/log/common/log';
|
||||
|
||||
namespace Timer {
|
||||
export interface ITimerEvent {
|
||||
@@ -74,7 +75,7 @@ suite.skip('QuickOpen performance (integration)', () => {
|
||||
[ITelemetryService, telemetryService],
|
||||
[IConfigurationService, configurationService],
|
||||
[ITextResourcePropertiesService, textResourcePropertiesService],
|
||||
[IModelService, new ModelServiceImpl(configurationService, textResourcePropertiesService, new TestThemeService())],
|
||||
[IModelService, new ModelServiceImpl(configurationService, textResourcePropertiesService, new TestThemeService(), new NullLogService())],
|
||||
[IWorkspaceContextService, new TestContextService(testWorkspace(URI.file(testWorkspacePath)))],
|
||||
[IEditorService, new TestEditorService()],
|
||||
[IEditorGroupsService, new TestEditorGroupsService()],
|
||||
|
||||
@@ -60,18 +60,19 @@ suite.skip('TextSearch performance (integration)', () => {
|
||||
const telemetryService = new TestTelemetryService();
|
||||
const configurationService = new TestConfigurationService();
|
||||
const textResourcePropertiesService = new TestTextResourcePropertiesService(configurationService);
|
||||
const logService = new NullLogService();
|
||||
const instantiationService = new InstantiationService(new ServiceCollection(
|
||||
[ITelemetryService, telemetryService],
|
||||
[IConfigurationService, configurationService],
|
||||
[ITextResourcePropertiesService, textResourcePropertiesService],
|
||||
[IModelService, new ModelServiceImpl(configurationService, textResourcePropertiesService, new TestThemeService())],
|
||||
[IModelService, new ModelServiceImpl(configurationService, textResourcePropertiesService, new TestThemeService(), logService)],
|
||||
[IWorkspaceContextService, new TestContextService(testWorkspace(URI.file(testWorkspacePath)))],
|
||||
[IEditorService, new TestEditorService()],
|
||||
[IEditorGroupsService, new TestEditorGroupsService()],
|
||||
[IEnvironmentService, TestEnvironmentService],
|
||||
[IUntitledTextEditorService, createSyncDescriptor(UntitledTextEditorService)],
|
||||
[ISearchService, createSyncDescriptor(LocalSearchService)],
|
||||
[ILogService, new NullLogService()]
|
||||
[ILogService, logService]
|
||||
));
|
||||
|
||||
const queryOptions: ITextQueryBuilderOptions = {
|
||||
|
||||
@@ -16,7 +16,7 @@ import { IEditorOpeningEvent, EditorServiceImpl, IEditorGroupView } from 'vs/wor
|
||||
import { Event, Emitter } from 'vs/base/common/event';
|
||||
import Severity from 'vs/base/common/severity';
|
||||
import { IBackupFileService, IResolvedBackup } from 'vs/workbench/services/backup/common/backup';
|
||||
import { IConfigurationService } from 'vs/platform/configuration/common/configuration';
|
||||
import { IConfigurationService, ConfigurationTarget } from 'vs/platform/configuration/common/configuration';
|
||||
import { IWorkbenchLayoutService, Parts, Position as PartPosition } from 'vs/workbench/services/layout/browser/layoutService';
|
||||
import { TextModelResolverService } from 'vs/workbench/services/textmodelResolver/common/textModelResolverService';
|
||||
import { ITextModelService } from 'vs/editor/common/services/resolverService';
|
||||
@@ -42,7 +42,7 @@ import { IEnvironmentService } from 'vs/platform/environment/common/environment'
|
||||
import { IThemeService } from 'vs/platform/theme/common/themeService';
|
||||
import { TestThemeService } from 'vs/platform/theme/test/common/testThemeService';
|
||||
import { IWorkspaceIdentifier, ISingleFolderWorkspaceIdentifier, isSingleFolderWorkspaceIdentifier } from 'vs/platform/workspaces/common/workspaces';
|
||||
import { ITextResourceConfigurationService, ITextResourcePropertiesService } from 'vs/editor/common/services/resourceConfiguration';
|
||||
import { IResourceConfigurationService, ITextResourcePropertiesService } from 'vs/editor/common/services/resourceConfiguration';
|
||||
import { IPosition, Position as EditorPosition } from 'vs/editor/common/core/position';
|
||||
import { IMenuService, MenuId, IMenu } from 'vs/platform/actions/common/actions';
|
||||
import { IContextKeyService } from 'vs/platform/contextkey/common/contextkey';
|
||||
@@ -209,7 +209,7 @@ export class TestTextFileService extends NativeTextFileService {
|
||||
@IDialogService dialogService: IDialogService,
|
||||
@IFileDialogService fileDialogService: IFileDialogService,
|
||||
@IEditorService editorService: IEditorService,
|
||||
@ITextResourceConfigurationService textResourceConfigurationService: ITextResourceConfigurationService,
|
||||
@IResourceConfigurationService textResourceConfigurationService: IResourceConfigurationService,
|
||||
@IElectronService electronService: IElectronService,
|
||||
@IProductService productService: IProductService,
|
||||
@IFilesConfigurationService filesConfigurationService: IFilesConfigurationService
|
||||
@@ -286,7 +286,7 @@ export function workbenchInstantiationService(): IInstantiationService {
|
||||
const configService = new TestConfigurationService();
|
||||
instantiationService.stub(IConfigurationService, configService);
|
||||
instantiationService.stub(IFilesConfigurationService, new TestFilesConfigurationService(contextKeyService, configService, TestEnvironmentService));
|
||||
instantiationService.stub(ITextResourceConfigurationService, new TestTextResourceConfigurationService(configService));
|
||||
instantiationService.stub(IResourceConfigurationService, new TestTextResourceConfigurationService(configService));
|
||||
instantiationService.stub(IUntitledTextEditorService, instantiationService.createInstance(UntitledTextEditorService));
|
||||
instantiationService.stub(IStorageService, new TestStorageService());
|
||||
instantiationService.stub(IWorkbenchLayoutService, new TestLayoutService());
|
||||
@@ -1247,7 +1247,7 @@ export class TestLifecycleService implements ILifecycleService {
|
||||
}
|
||||
}
|
||||
|
||||
export class TestTextResourceConfigurationService implements ITextResourceConfigurationService {
|
||||
export class TestTextResourceConfigurationService implements IResourceConfigurationService {
|
||||
|
||||
_serviceBrand: undefined;
|
||||
|
||||
@@ -1263,6 +1263,10 @@ export class TestTextResourceConfigurationService implements ITextResourceConfig
|
||||
const section: string | undefined = position ? (typeof arg3 === 'string' ? arg3 : undefined) : (typeof arg2 === 'string' ? arg2 : undefined);
|
||||
return this.configurationService.getValue(section, { resource });
|
||||
}
|
||||
|
||||
updateValue(resource: URI, key: string, value: any, configurationTarget?: ConfigurationTarget): Promise<void> {
|
||||
return this.configurationService.updateValue(key, value);
|
||||
}
|
||||
}
|
||||
|
||||
export class TestTextResourcePropertiesService implements ITextResourcePropertiesService {
|
||||
|
||||
Reference in New Issue
Block a user