Merge vscode source through 1.62 release (#19981)

* Build breaks 1

* Build breaks

* Build breaks

* Build breaks

* More build breaks

* Build breaks (#2512)

* Runtime breaks

* Build breaks

* Fix dialog location break

* Update typescript

* Fix ASAR break issue

* Unit test breaks

* Update distro

* Fix breaks in ADO builds (#2513)

* Bump to node 16

* Fix hygiene errors

* Bump distro

* Remove reference to node type

* Delete vscode specific extension

* Bump to node 16 in CI yaml

* Skip integration tests in CI builds (while fixing)

* yarn.lock update

* Bump moment dependency in remote yarn

* Fix drop-down chevron style

* Bump to node 16

* Remove playwrite from ci.yaml

* Skip building build scripts in hygine check
This commit is contained in:
Karl Burtram
2022-07-11 14:09:32 -07:00
committed by GitHub
parent fa0fcef303
commit 26455e9113
1876 changed files with 72050 additions and 37997 deletions

View File

@@ -401,6 +401,43 @@ suite('ExtHostSearch', () => {
]);
});
// https://github.com/microsoft/vscode-remotehub/issues/255
test('include, sibling exclude, and subfolder', async () => {
const reportedResults = [
'foo/file1.ts',
'foo/file1.js',
];
await registerTestFileSearchProvider({
provideFileSearchResults(query: vscode.FileSearchQuery, options: vscode.FileSearchOptions, token: vscode.CancellationToken): Promise<URI[]> {
return Promise.resolve(reportedResults
.map(relativePath => joinPath(options.folder, relativePath)));
}
});
const query: ISearchQuery = {
type: QueryType.File,
filePattern: '',
includePattern: { '**/*.ts': true },
excludePattern: {
'*.js': {
when: '$(basename).ts'
}
},
folderQueries: [
{ folder: rootFolderA }
]
};
const { results } = await runFileSearch(query);
compareURIs(
results,
[
joinPath(rootFolderA, 'foo/file1.ts')
]);
});
test('multiroot sibling exclude clause', async () => {
await registerTestFileSearchProvider({

View File

@@ -12,19 +12,26 @@ import { SingleProxyRPCProtocol } from 'vs/workbench/test/browser/api/testRPCPro
import { CancellationTokenSource } from 'vs/base/common/cancellation';
import { IConfigurationService } from 'vs/platform/configuration/common/configuration';
import { TestConfigurationService } from 'vs/platform/configuration/test/common/testConfigurationService';
import { DisposableStore } from 'vs/base/common/lifecycle';
suite('MainThreadWorkspace', () => {
let disposables: DisposableStore;
let configService: TestConfigurationService;
let instantiationService: TestInstantiationService;
setup(() => {
instantiationService = workbenchInstantiationService() as TestInstantiationService;
disposables = new DisposableStore();
instantiationService = workbenchInstantiationService(disposables) as TestInstantiationService;
configService = instantiationService.get(IConfigurationService) as TestConfigurationService;
configService.setUserConfiguration('search', {});
});
teardown(() => {
disposables.dispose();
});
test('simple', () => {
instantiationService.stub(ISearchService, {
fileSearch(query: IFileQuery) {

View File

@@ -15,7 +15,8 @@ import { RequestService } from 'vs/platform/request/node/requestService';
import { TestConfigurationService } from 'vs/platform/configuration/test/common/testConfigurationService';
import 'vs/workbench/workbench.desktop.main';
import { NullLogService } from 'vs/platform/log/common/log';
import { TestEnvironmentService } from 'vs/workbench/test/electron-browser/workbenchTestServices';
import { mock } from 'vs/base/test/common/mock';
import { INativeEnvironmentService } from 'vs/platform/environment/common/environment';
interface ColorInfo {
description: string;
@@ -33,7 +34,10 @@ export const experimental: string[] = []; // 'settings.modifiedItemForeground',
suite('Color Registry', function () {
test('all colors documented in theme-color.md', async function () {
const reqContext = await new RequestService(new TestConfigurationService(), TestEnvironmentService, new NullLogService()).request({ url: 'https://raw.githubusercontent.com/microsoft/vscode-docs/vnext/api/references/theme-color.md' }, CancellationToken.None);
// avoid importing the TestEnvironmentService as it brings in a duplicate registration of the file editor input factory.
const environmentService = new class extends mock<INativeEnvironmentService>() { override args = { _: [] }; };
const reqContext = await new RequestService(new TestConfigurationService(), environmentService, new NullLogService()).request({ url: 'https://raw.githubusercontent.com/microsoft/vscode-docs/vnext/api/references/theme-color.md' }, CancellationToken.None);
const content = (await asText(reqContext))!;
const expression = /\-\s*\`([\w\.]+)\`: (.*)/g;

View File

@@ -0,0 +1,19 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import * as assert from 'assert';
import { LanguagesRegistry } from 'vs/editor/common/services/languagesRegistry';
// import { ModeServiceImpl } from 'vs/editor/common/services/modeServiceImpl';
/**
* This function is called before test running and also again at the end of test running
* and can be used to add assertions. e.g. that registries are empty, etc.
*/
export function assertCleanState(): void {
// If this test fails, it is a clear indication that
// your test or suite is leaking services (e.g. via leaking text models)
// assert.strictEqual(ModeServiceImpl.instanceCount, 0, 'No leaking IModeService');
assert.strictEqual(LanguagesRegistry.instanceCount, 0, 'No leaking LanguagesRegistry');
}

View File

@@ -11,7 +11,9 @@ import * as path from 'vs/base/common/path';
import { URI } from 'vs/base/common/uri';
import { IModelService } from 'vs/editor/common/services/modelService';
import { ModelServiceImpl } from 'vs/editor/common/services/modelServiceImpl';
import { ModeServiceImpl } from 'vs/editor/common/services/modeServiceImpl';
import { ITextResourcePropertiesService } from 'vs/editor/common/services/textResourceConfigurationService';
import { TestLanguageConfigurationService } from 'vs/editor/test/common/modes/testLanguageConfigurationService';
import { IConfigurationService } from 'vs/platform/configuration/common/configuration';
import { TestConfigurationService } from 'vs/platform/configuration/test/common/testConfigurationService';
import { IDialogService } from 'vs/platform/dialogs/common/dialogs';
@@ -24,7 +26,7 @@ import { ILogService, NullLogService } from 'vs/platform/log/common/log';
import { INotificationService } from 'vs/platform/notification/common/notification';
import { TestNotificationService } from 'vs/platform/notification/test/common/testNotificationService';
import { ClassifiedEvent, GDPRClassification, StrictPropertyCheck } from 'vs/platform/telemetry/common/gdprTypings';
import { ITelemetryInfo, ITelemetryService } from 'vs/platform/telemetry/common/telemetry';
import { ITelemetryInfo, ITelemetryService, TelemetryLevel } from 'vs/platform/telemetry/common/telemetry';
import { TestThemeService } from 'vs/platform/theme/test/common/testThemeService';
import { IUndoRedoService } from 'vs/platform/undoRedo/common/undoRedo';
import { UndoRedoService } from 'vs/platform/undoRedo/common/undoRedoService';
@@ -72,22 +74,41 @@ suite.skip('TextSearch performance (integration)', () => {
const dialogService = new TestDialogService();
const notificationService = new TestNotificationService();
const undoRedoService = new UndoRedoService(dialogService, notificationService);
const instantiationService = new InstantiationService(new ServiceCollection(
[ITelemetryService, telemetryService],
[IConfigurationService, configurationService],
[ITextResourcePropertiesService, textResourcePropertiesService],
[IDialogService, dialogService],
[INotificationService, notificationService],
[IUndoRedoService, undoRedoService],
[IModelService, new ModelServiceImpl(configurationService, textResourcePropertiesService, new TestThemeService(), logService, undoRedoService)],
[IWorkspaceContextService, new TestContextService(testWorkspace(URI.file(testWorkspacePath)))],
[IEditorService, new TestEditorService()],
[IEditorGroupsService, new TestEditorGroupsService()],
[IEnvironmentService, TestEnvironmentService],
[IUntitledTextEditorService, new SyncDescriptor(UntitledTextEditorService)],
[ISearchService, new SyncDescriptor(LocalSearchService)],
[ILogService, logService]
));
const instantiationService = new InstantiationService(
new ServiceCollection(
[ITelemetryService, telemetryService],
[IConfigurationService, configurationService],
[ITextResourcePropertiesService, textResourcePropertiesService],
[IDialogService, dialogService],
[INotificationService, notificationService],
[IUndoRedoService, undoRedoService],
[
IModelService,
new ModelServiceImpl(
configurationService,
textResourcePropertiesService,
new TestThemeService(),
logService,
undoRedoService,
new ModeServiceImpl(),
new TestLanguageConfigurationService()
),
],
[
IWorkspaceContextService,
new TestContextService(testWorkspace(URI.file(testWorkspacePath))),
],
[IEditorService, new TestEditorService()],
[IEditorGroupsService, new TestEditorGroupsService()],
[IEnvironmentService, TestEnvironmentService],
[
IUntitledTextEditorService,
new SyncDescriptor(UntitledTextEditorService),
],
[ISearchService, new SyncDescriptor(LocalSearchService)],
[ILogService, logService]
)
);
const queryOptions: ITextQueryBuilderOptions = {
maxResults: 2048
@@ -162,7 +183,7 @@ suite.skip('TextSearch performance (integration)', () => {
class TestTelemetryService implements ITelemetryService {
public _serviceBrand: undefined;
public isOptedIn = true;
public telemetryLevel = TelemetryLevel.USAGE;
public sendErrorTelemetry = true;
public events: any[] = [];

View File

@@ -23,7 +23,7 @@ import { ICodeEditorService } from 'vs/editor/browser/services/codeEditorService
import { URI } from 'vs/base/common/uri';
import { IReadTextFileOptions, ITextFileStreamContent, ITextFileService } from 'vs/workbench/services/textfile/common/textfiles';
import { createTextBufferFactoryFromStream } from 'vs/editor/common/model/textModel';
import { IOpenEmptyWindowOptions, IWindowOpenable, IOpenWindowOptions, IOpenedWindow, IPartsSplash } from 'vs/platform/windows/common/windows';
import { IOpenEmptyWindowOptions, IWindowOpenable, IOpenWindowOptions, IOpenedWindow, IPartsSplash, IColorScheme } from 'vs/platform/windows/common/windows';
import { parseArgs, OPTIONS } from 'vs/platform/environment/node/argv';
import { LogLevel, ILogService } from 'vs/platform/log/common/log';
import { IPathService } from 'vs/workbench/services/path/common/pathService';
@@ -45,6 +45,8 @@ import { IWorkbenchEnvironmentService } from 'vs/workbench/services/environment/
import { getUserDataPath } from 'vs/platform/environment/node/userDataPath';
import product from 'vs/platform/product/common/product';
import { IElevatedFileService } from 'vs/workbench/services/files/common/elevatedFileService';
import { IDecorationsService } from 'vs/workbench/services/decorations/common/decorations';
import { DisposableStore } from 'vs/base/common/lifecycle';
const args = parseArgs(process.argv, OPTIONS);
@@ -90,7 +92,8 @@ export class TestTextFileService extends NativeTextFileService {
@ILogService logService: ILogService,
@IUriIdentityService uriIdentityService: IUriIdentityService,
@IModeService modeService: IModeService,
@IElevatedFileService elevatedFileService: IElevatedFileService
@IElevatedFileService elevatedFileService: IElevatedFileService,
@IDecorationsService decorationsService: IDecorationsService
) {
super(
fileService,
@@ -110,7 +113,8 @@ export class TestTextFileService extends NativeTextFileService {
uriIdentityService,
modeService,
elevatedFileService,
logService
logService,
decorationsService
);
}
@@ -160,6 +164,8 @@ export class TestSharedProcessService implements ISharedProcessService {
getChannel(channelName: string): any { return undefined; }
registerChannel(channelName: string, channel: any): void { }
notifyRestored(): void { }
}
export class TestNativeHostService implements INativeHostService {
@@ -213,6 +219,7 @@ export class TestNativeHostService implements INativeHostService {
async getOSProperties(): Promise<IOSProperties> { return Object.create(null); }
async getOSStatistics(): Promise<IOSStatistics> { return Object.create(null); }
async getOSVirtualMachineHint(): Promise<number> { return 0; }
async getOSColorScheme(): Promise<IColorScheme> { return { dark: true, highContrast: false }; }
async killProcess(): Promise<void> { }
async setDocumentEdited(edited: boolean): Promise<void> { }
async openExternal(url: string): Promise<boolean> { return false; }
@@ -254,11 +261,11 @@ export class TestNativeHostService implements INativeHostService {
async findCredentials(service: string): Promise<{ account: string; password: string; }[]> { return []; }
}
export function workbenchInstantiationService(): ITestInstantiationService {
export function workbenchInstantiationService(disposables = new DisposableStore()): ITestInstantiationService {
const instantiationService = browserWorkbenchInstantiationService({
textFileService: insta => <ITextFileService>insta.createInstance(TestTextFileService),
pathService: insta => <IPathService>insta.createInstance(TestNativePathService)
});
}, disposables);
instantiationService.stub(INativeHostService, new TestNativeHostService());
instantiationService.stub(IEnvironmentService, TestEnvironmentService);