mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-11 10:38:31 -05:00
Merge from vscode e3c4990c67c40213af168300d1cfeb71d680f877 (#16569)
This commit is contained in:
@@ -883,14 +883,16 @@ suite('ExtHostSearch', () => {
|
||||
});
|
||||
|
||||
test('basic sibling clause', async () => {
|
||||
mockPFS.readdir = (_path: string): any => {
|
||||
if (_path === rootFolderA.fsPath) {
|
||||
return Promise.resolve([
|
||||
'file1.js',
|
||||
'file1.ts'
|
||||
]);
|
||||
} else {
|
||||
return Promise.reject(new Error('Wrong path'));
|
||||
(mockPFS as any).Promises = {
|
||||
readdir: (_path: string): any => {
|
||||
if (_path === rootFolderA.fsPath) {
|
||||
return Promise.resolve([
|
||||
'file1.js',
|
||||
'file1.ts'
|
||||
]);
|
||||
} else {
|
||||
return Promise.reject(new Error('Wrong path'));
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -926,21 +928,23 @@ suite('ExtHostSearch', () => {
|
||||
});
|
||||
|
||||
test('multiroot sibling clause', async () => {
|
||||
mockPFS.readdir = (_path: string): any => {
|
||||
if (_path === joinPath(rootFolderA, 'folder').fsPath) {
|
||||
return Promise.resolve([
|
||||
'fileA.scss',
|
||||
'fileA.css',
|
||||
'file2.css'
|
||||
]);
|
||||
} else if (_path === rootFolderB.fsPath) {
|
||||
return Promise.resolve([
|
||||
'fileB.ts',
|
||||
'fileB.js',
|
||||
'file3.js'
|
||||
]);
|
||||
} else {
|
||||
return Promise.reject(new Error('Wrong path'));
|
||||
(mockPFS as any).Promises = {
|
||||
readdir: (_path: string): any => {
|
||||
if (_path === joinPath(rootFolderA, 'folder').fsPath) {
|
||||
return Promise.resolve([
|
||||
'fileA.scss',
|
||||
'fileA.css',
|
||||
'file2.css'
|
||||
]);
|
||||
} else if (_path === rootFolderB.fsPath) {
|
||||
return Promise.resolve([
|
||||
'fileB.ts',
|
||||
'fileB.js',
|
||||
'file3.js'
|
||||
]);
|
||||
} else {
|
||||
return Promise.reject(new Error('Wrong path'));
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -31,7 +31,7 @@ suite('MainThreadWorkspace', () => {
|
||||
assert.strictEqual(query.folderQueries.length, 1);
|
||||
assert.strictEqual(query.folderQueries[0].disregardIgnoreFiles, true);
|
||||
|
||||
assert.deepEqual(query.includePattern, { 'foo': true });
|
||||
assert.deepStrictEqual({ ...query.includePattern }, { 'foo': true });
|
||||
assert.strictEqual(query.maxResults, 10);
|
||||
|
||||
return Promise.resolve({ results: [], messages: [] });
|
||||
@@ -89,7 +89,7 @@ suite('MainThreadWorkspace', () => {
|
||||
instantiationService.stub(ISearchService, {
|
||||
fileSearch(query: IFileQuery) {
|
||||
assert.strictEqual(query.folderQueries[0].excludePattern, undefined);
|
||||
assert.deepEqual(query.excludePattern, { 'exclude/**': true });
|
||||
assert.deepStrictEqual({ ...query.excludePattern }, { 'exclude/**': true });
|
||||
|
||||
return Promise.resolve({ results: [], messages: [] });
|
||||
}
|
||||
|
||||
@@ -6,7 +6,6 @@
|
||||
import { Registry } from 'vs/platform/registry/common/platform';
|
||||
import { IColorRegistry, Extensions, ColorContribution } from 'vs/platform/theme/common/colorRegistry';
|
||||
import { asText } from 'vs/platform/request/common/request';
|
||||
import * as fs from 'fs';
|
||||
import * as pfs from 'vs/base/node/pfs';
|
||||
import * as path from 'vs/base/common/path';
|
||||
import * as assert from 'assert';
|
||||
@@ -102,11 +101,11 @@ function getDescription(color: ColorContribution) {
|
||||
|
||||
async function getColorsFromExtension(): Promise<{ [id: string]: string }> {
|
||||
let extPath = getPathFromAmdModule(require, '../../../../../extensions');
|
||||
let extFolders = await pfs.readDirsInDir(extPath);
|
||||
let extFolders = await pfs.Promises.readDirsInDir(extPath);
|
||||
let result: { [id: string]: string } = Object.create(null);
|
||||
for (let folder of extFolders) {
|
||||
try {
|
||||
let packageJSON = JSON.parse((await fs.promises.readFile(path.join(extPath, folder, 'package.json'))).toString());
|
||||
let packageJSON = JSON.parse((await pfs.Promises.readFile(path.join(extPath, folder, 'package.json'))).toString());
|
||||
let contributes = packageJSON['contributes'];
|
||||
if (contributes) {
|
||||
let colors = contributes['colors'];
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import { Color } from 'vs/base/common/color';
|
||||
import { Registry } from 'vs/platform/registry/common/platform';
|
||||
import { Extensions, IColorRegistry } from 'vs/platform/theme/common/colorRegistry';
|
||||
|
||||
suite('ColorRegistry', () => {
|
||||
if (process.env.VSCODE_COLOR_REGISTRY_EXPORT) {
|
||||
test('exports', () => {
|
||||
const themingRegistry = Registry.as<IColorRegistry>(Extensions.ColorContribution);
|
||||
const colors = themingRegistry.getColors();
|
||||
const replacer = (_key: string, value: unknown) =>
|
||||
value instanceof Color ? Color.Format.CSS.formatHexA(value) : value;
|
||||
console.log(`#colors:${JSON.stringify(colors, replacer)}\n`);
|
||||
});
|
||||
}
|
||||
});
|
||||
@@ -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 } from 'vs/platform/windows/common/windows';
|
||||
import { IOpenEmptyWindowOptions, IWindowOpenable, IOpenWindowOptions, IOpenedWindow, IPartsSplash } 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';
|
||||
@@ -53,7 +53,6 @@ export const TestWorkbenchConfiguration: INativeWorkbenchConfiguration = {
|
||||
machineId: 'testMachineId',
|
||||
logLevel: LogLevel.Error,
|
||||
mainPid: 0,
|
||||
partsSplashPath: '',
|
||||
appRoot: '',
|
||||
userEnv: {},
|
||||
execPath: process.execPath,
|
||||
@@ -136,7 +135,8 @@ export class TestTextFileService extends NativeTextFileService {
|
||||
etag: content.etag,
|
||||
encoding: 'utf8',
|
||||
value: await createTextBufferFactoryFromStream(content.value),
|
||||
size: 10
|
||||
size: 10,
|
||||
readonly: false
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -197,6 +197,7 @@ export class TestNativeHostService implements INativeHostService {
|
||||
async unmaximizeWindow(): Promise<void> { }
|
||||
async minimizeWindow(): Promise<void> { }
|
||||
async setMinimumSize(width: number | undefined, height: number | undefined): Promise<void> { }
|
||||
async saveWindowSplash(value: IPartsSplash): Promise<void> { }
|
||||
async focusWindow(options?: { windowId?: number | undefined; } | undefined): Promise<void> { }
|
||||
async showMessageBox(options: Electron.MessageBoxOptions): Promise<Electron.MessageBoxReturnValue> { throw new Error('Method not implemented.'); }
|
||||
async showSaveDialog(options: Electron.SaveDialogOptions): Promise<Electron.SaveDialogReturnValue> { throw new Error('Method not implemented.'); }
|
||||
@@ -216,13 +217,15 @@ export class TestNativeHostService implements INativeHostService {
|
||||
async setDocumentEdited(edited: boolean): Promise<void> { }
|
||||
async openExternal(url: string): Promise<boolean> { return false; }
|
||||
async updateTouchBar(): Promise<void> { }
|
||||
async moveItemToTrash(): Promise<boolean> { return false; }
|
||||
async moveItemToTrash(): Promise<void> { }
|
||||
async newWindowTab(): Promise<void> { }
|
||||
async showPreviousWindowTab(): Promise<void> { }
|
||||
async showNextWindowTab(): Promise<void> { }
|
||||
async moveWindowTabToNewWindow(): Promise<void> { }
|
||||
async mergeAllWindowTabs(): Promise<void> { }
|
||||
async toggleWindowTabsBar(): Promise<void> { }
|
||||
async installShellCommand(): Promise<void> { }
|
||||
async uninstallShellCommand(): Promise<void> { }
|
||||
async notifyReady(): Promise<void> { }
|
||||
async relaunch(options?: { addArgs?: string[] | undefined; removeArgs?: string[] | undefined; } | undefined): Promise<void> { }
|
||||
async reload(): Promise<void> { }
|
||||
|
||||
Reference in New Issue
Block a user