mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 10:58:30 -05:00
Merge from vscode 3a6dcb42008d509900b3a3b2d695564eeb4dbdac (#5098)
This commit is contained in:
@@ -38,6 +38,7 @@ import { parseExtensionDevOptions } from '../common/extensionDevOptions';
|
||||
import { VSBuffer } from 'vs/base/common/buffer';
|
||||
import { IExtensionHostDebugService } from 'vs/workbench/services/extensions/common/extensionHostDebug';
|
||||
import { IExtensionHostStarter } from 'vs/workbench/services/extensions/common/extensions';
|
||||
import { isEqualOrParent } from 'vs/base/common/resources';
|
||||
|
||||
export class ExtensionHostProcessWorker implements IExtensionHostStarter {
|
||||
|
||||
@@ -400,7 +401,8 @@ export class ExtensionHostProcessWorker implements IExtensionHostStarter {
|
||||
workspace: this._contextService.getWorkbenchState() === WorkbenchState.EMPTY ? undefined : {
|
||||
configuration: withNullAsUndefined(workspace.configuration),
|
||||
id: workspace.id,
|
||||
name: this._labelService.getWorkspaceLabel(workspace)
|
||||
name: this._labelService.getWorkspaceLabel(workspace),
|
||||
isUntitled: workspace.configuration ? isEqualOrParent(workspace.configuration, this._environmentService.untitledWorkspacesHome) : false
|
||||
},
|
||||
resolvedExtensions: [],
|
||||
hostExtensions: [],
|
||||
|
||||
@@ -8,7 +8,6 @@ import {
|
||||
IExtensionManagementService, ILocalExtension, IGalleryExtension, InstallExtensionEvent, DidInstallExtensionEvent, IExtensionIdentifier, DidUninstallExtensionEvent, IReportedExtension, IGalleryMetadata,
|
||||
IExtensionManagementServerService, IExtensionManagementServer, IExtensionGalleryService
|
||||
} from 'vs/platform/extensionManagement/common/extensionManagement';
|
||||
import { flatten } from 'vs/base/common/arrays';
|
||||
import { ExtensionType, IExtensionManifest, isLanguagePackExtension } from 'vs/platform/extensions/common/extensions';
|
||||
import { URI } from 'vs/base/common/uri';
|
||||
import { Disposable } from 'vs/base/common/lifecycle';
|
||||
@@ -46,8 +45,10 @@ export class MultiExtensionManagementService extends Disposable implements IExte
|
||||
}
|
||||
|
||||
getInstalled(type?: ExtensionType): Promise<ILocalExtension[]> {
|
||||
return Promise.all(this.servers.map(({ extensionManagementService }) => extensionManagementService.getInstalled(type)))
|
||||
.then(result => flatten(result));
|
||||
const installedExtensions: ILocalExtension[] = [];
|
||||
return Promise.all(this.servers.map(({ extensionManagementService }) => extensionManagementService.getInstalled(type).then(extensions => installedExtensions.push(...extensions))))
|
||||
.then(_ => installedExtensions)
|
||||
.catch(e => installedExtensions);
|
||||
}
|
||||
|
||||
async uninstall(extension: ILocalExtension, force?: boolean): Promise<void> {
|
||||
|
||||
@@ -17,6 +17,7 @@ import { ILogService } from 'vs/platform/log/common/log';
|
||||
import { VSBuffer, VSBufferReadable, readableToBuffer, bufferToReadable, streamToBuffer, bufferToStream, VSBufferReadableStream, writeableBufferStream, VSBufferWriteableStream } from 'vs/base/common/buffer';
|
||||
import { Queue } from 'vs/base/common/async';
|
||||
import { CancellationTokenSource, CancellationToken } from 'vs/base/common/cancellation';
|
||||
import { Schemas } from 'vs/base/common/network';
|
||||
|
||||
export class FileService extends Disposable implements IFileService {
|
||||
|
||||
@@ -101,7 +102,7 @@ export class FileService extends Disposable implements IFileService {
|
||||
|
||||
// Assert path is absolute
|
||||
if (!isAbsolutePath(resource)) {
|
||||
throw new FileOperationError(localize('invalidPath', "The path of resource '{0}' must be absolute", resource.toString(true)), FileOperationResult.FILE_INVALID_PATH);
|
||||
throw new FileOperationError(localize('invalidPath', "The path of resource '{0}' must be absolute", this.resourceForError(resource)), FileOperationResult.FILE_INVALID_PATH);
|
||||
}
|
||||
|
||||
// Activate provider
|
||||
@@ -110,11 +111,11 @@ export class FileService extends Disposable implements IFileService {
|
||||
// Assert provider
|
||||
const provider = this.provider.get(resource.scheme);
|
||||
if (!provider) {
|
||||
const err = new Error();
|
||||
err.name = 'ENOPRO';
|
||||
err.message = `No provider found for ${resource.toString()}`;
|
||||
const error = new Error();
|
||||
error.name = 'ENOPRO';
|
||||
error.message = localize('noProviderFound', "No file system provider found for {0}", resource.toString());
|
||||
|
||||
throw err;
|
||||
throw error;
|
||||
}
|
||||
|
||||
return provider;
|
||||
@@ -150,7 +151,7 @@ export class FileService extends Disposable implements IFileService {
|
||||
// Specially handle file not found case as file operation result
|
||||
if (toFileSystemProviderErrorCode(error) === FileSystemProviderErrorCode.FileNotFound) {
|
||||
throw new FileOperationError(
|
||||
localize('fileNotFoundError', "File not found ({0})", resource.toString(true)),
|
||||
localize('fileNotFoundError', "File not found ({0})", this.resourceForError(resource)),
|
||||
FileOperationResult.FILE_NOT_FOUND
|
||||
);
|
||||
}
|
||||
@@ -270,7 +271,7 @@ export class FileService extends Disposable implements IFileService {
|
||||
// validate overwrite
|
||||
const overwrite = !!(options && options.overwrite);
|
||||
if (!overwrite && await this.exists(resource)) {
|
||||
throw new FileOperationError(localize('fileExists', "File to create already exists ({0})", resource.toString(true)), FileOperationResult.FILE_MODIFIED_SINCE, options);
|
||||
throw new FileOperationError(localize('fileExists', "File to create already exists ({0})", this.resourceForError(resource)), FileOperationResult.FILE_MODIFIED_SINCE, options);
|
||||
}
|
||||
|
||||
// do write into file (this will create it too)
|
||||
@@ -305,7 +306,7 @@ export class FileService extends Disposable implements IFileService {
|
||||
await this.doWriteUnbuffered(provider, resource, bufferOrReadable);
|
||||
}
|
||||
} catch (error) {
|
||||
throw new FileOperationError(localize('err.write', "Failed to write file {0}", resource.toString(false)), toFileOperationResult(error), options);
|
||||
throw new FileOperationError(localize('err.write', "Unable to write file ({0})", error.toString()), toFileOperationResult(error), options);
|
||||
}
|
||||
|
||||
return this.resolve(resource, { resolveMetadata: true });
|
||||
@@ -321,7 +322,7 @@ export class FileService extends Disposable implements IFileService {
|
||||
|
||||
// file cannot be directory
|
||||
if ((stat.type & FileType.Directory) !== 0) {
|
||||
throw new FileOperationError(localize('fileIsDirectoryError', "Expected file {0} is actually a directory", resource.toString()), FileOperationResult.FILE_IS_DIRECTORY, options);
|
||||
throw new FileOperationError(localize('fileIsDirectoryError', "Expected file {0} is actually a directory", this.resourceForError(resource)), FileOperationResult.FILE_IS_DIRECTORY, options);
|
||||
}
|
||||
|
||||
// Dirty write prevention: if the file on disk has been changed and does not match our expected
|
||||
@@ -397,7 +398,7 @@ export class FileService extends Disposable implements IFileService {
|
||||
value: fileStream
|
||||
};
|
||||
} catch (error) {
|
||||
throw new FileOperationError(localize('err.read', "Failed to read file {0}", resource.toString(false)), toFileOperationResult(error), options);
|
||||
throw new FileOperationError(localize('err.read', "Unable to read file ({0})", error.toString()), toFileOperationResult(error), options);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -488,7 +489,7 @@ export class FileService extends Disposable implements IFileService {
|
||||
|
||||
// Return early if resource is a directory
|
||||
if (stat.isDirectory) {
|
||||
throw new FileOperationError(localize('fileIsDirectoryError', "Expected file {0} is actually a directory", resource.toString()), FileOperationResult.FILE_IS_DIRECTORY, options);
|
||||
throw new FileOperationError(localize('fileIsDirectoryError', "Expected file {0} is actually a directory", this.resourceForError(resource)), FileOperationResult.FILE_IS_DIRECTORY, options);
|
||||
}
|
||||
|
||||
// Return early if file not modified since
|
||||
@@ -692,7 +693,7 @@ export class FileService extends Disposable implements IFileService {
|
||||
try {
|
||||
const stat = await provider.stat(directory);
|
||||
if ((stat.type & FileType.Directory) === 0) {
|
||||
throw new Error(localize('mkdirExistsError', "{0} exists, but is not a directory", directory.toString()));
|
||||
throw new Error(localize('mkdirExistsError', "{0} exists, but is not a directory", this.resourceForError(directory)));
|
||||
}
|
||||
|
||||
break; // we have hit a directory that exists -> good
|
||||
@@ -732,7 +733,7 @@ export class FileService extends Disposable implements IFileService {
|
||||
if (!recursive && await this.exists(resource)) {
|
||||
const stat = await this.resolve(resource);
|
||||
if (stat.isDirectory && Array.isArray(stat.children) && stat.children.length > 0) {
|
||||
throw new Error(localize('deleteFailed', "Failed to delete non-empty folder '{0}'.", resource.toString()));
|
||||
throw new Error(localize('deleteFailed', "Unable to delete non-empty folder '{0}'.", this.resourceForError(resource)));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1006,5 +1007,13 @@ export class FileService extends Disposable implements IFileService {
|
||||
return true;
|
||||
}
|
||||
|
||||
private resourceForError(resource: URI): string {
|
||||
if (resource.scheme === Schemas.file) {
|
||||
return resource.fsPath;
|
||||
}
|
||||
|
||||
return resource.toString(true);
|
||||
}
|
||||
|
||||
//#endregion
|
||||
}
|
||||
|
||||
@@ -13,7 +13,7 @@ import { FileChangeType } from 'vs/platform/files/common/files';
|
||||
import { ThrottledDelayer } from 'vs/base/common/async';
|
||||
import { normalizeNFC } from 'vs/base/common/normalization';
|
||||
import { realcaseSync } from 'vs/base/node/extpath';
|
||||
import { isMacintosh } from 'vs/base/common/platform';
|
||||
import { isMacintosh, isLinux } from 'vs/base/common/platform';
|
||||
import { IDiskFileChange, normalizeFileChanges } from 'vs/workbench/services/files/node/watcher/watcher';
|
||||
import { IWatcherRequest, IWatcherService, IWatcherOptions, IWatchError } from 'vs/workbench/services/files/node/watcher/unix/watcher';
|
||||
import { Emitter, Event } from 'vs/base/common/event';
|
||||
@@ -114,12 +114,21 @@ export class ChokidarWatcherService implements IWatcherService {
|
||||
disableGlobbing: true // fix https://github.com/Microsoft/vscode/issues/4586
|
||||
};
|
||||
|
||||
const excludes: string[] = [];
|
||||
// if there's only one request, use the built-in ignore-filterering
|
||||
const isSingleFolder = requests.length === 1;
|
||||
if (isSingleFolder) {
|
||||
watcherOpts.ignored = requests[0].excludes;
|
||||
excludes.push(...requests[0].excludes);
|
||||
}
|
||||
|
||||
if ((isMacintosh || isLinux) && (basePath.length === 0 || basePath === '/')) {
|
||||
excludes.push('/dev/**');
|
||||
if (isLinux) {
|
||||
excludes.push('/proc/**', '/sys/**');
|
||||
}
|
||||
}
|
||||
watcherOpts.ignored = excludes;
|
||||
|
||||
// Chokidar fails when the basePath does not match case-identical to the path on disk
|
||||
// so we have to find the real casing of the path and do some path massaging to fix this
|
||||
// see https://github.com/paulmillr/chokidar/issues/418
|
||||
|
||||
@@ -1382,6 +1382,10 @@ suite('Disk File Service', () => {
|
||||
});
|
||||
|
||||
test('watch - file - multiple writes', done => {
|
||||
if (isWindows) {
|
||||
return done(); // not happy
|
||||
}
|
||||
|
||||
const toWatch = URI.file(join(testDir, 'index-watch1.html'));
|
||||
writeFileSync(toWatch.fsPath, 'Init');
|
||||
|
||||
@@ -1487,7 +1491,7 @@ suite('Disk File Service', () => {
|
||||
setTimeout(() => mkdirSync(folder.fsPath), 50);
|
||||
});
|
||||
|
||||
test('watch - folder (non recursive) - delete folder', done => {
|
||||
test.skip('watch - folder (non recursive) - delete folder', done => {
|
||||
const watchDir = URI.file(join(testDir, 'watch7'));
|
||||
mkdirSync(watchDir.fsPath);
|
||||
|
||||
|
||||
@@ -160,7 +160,7 @@ export class LabelService implements ILabelService {
|
||||
}
|
||||
|
||||
getWorkspaceLabel(workspace: (IWorkspaceIdentifier | ISingleFolderWorkspaceIdentifier | IWorkspace), options?: { verbose: boolean }): string {
|
||||
if (!isWorkspaceIdentifier(workspace) && !isSingleFolderWorkspaceIdentifier(workspace)) {
|
||||
if (IWorkspace.isIWorkspace(workspace)) {
|
||||
const identifier = toWorkspaceIdentifier(workspace);
|
||||
if (!identifier) {
|
||||
return '';
|
||||
@@ -176,23 +176,27 @@ export class LabelService implements ILabelService {
|
||||
return this.appendWorkspaceSuffix(label, workspace);
|
||||
}
|
||||
|
||||
// Workspace: Untitled
|
||||
if (isEqualOrParent(workspace.configPath, this.environmentService.untitledWorkspacesHome)) {
|
||||
return localize('untitledWorkspace', "Untitled (Workspace)");
|
||||
}
|
||||
if (isWorkspaceIdentifier(workspace)) {
|
||||
// Workspace: Untitled
|
||||
if (isEqualOrParent(workspace.configPath, this.environmentService.untitledWorkspacesHome)) {
|
||||
return localize('untitledWorkspace', "Untitled (Workspace)");
|
||||
}
|
||||
|
||||
// Workspace: Saved
|
||||
let filename = basename(workspace.configPath);
|
||||
if (endsWith(filename, WORKSPACE_EXTENSION)) {
|
||||
filename = filename.substr(0, filename.length - WORKSPACE_EXTENSION.length - 1);
|
||||
// Workspace: Saved
|
||||
let filename = basename(workspace.configPath);
|
||||
if (endsWith(filename, WORKSPACE_EXTENSION)) {
|
||||
filename = filename.substr(0, filename.length - WORKSPACE_EXTENSION.length - 1);
|
||||
}
|
||||
let label;
|
||||
if (options && options.verbose) {
|
||||
label = localize('workspaceNameVerbose', "{0} (Workspace)", this.getUriLabel(joinPath(dirname(workspace.configPath), filename)));
|
||||
} else {
|
||||
label = localize('workspaceName', "{0} (Workspace)", filename);
|
||||
}
|
||||
return this.appendWorkspaceSuffix(label, workspace.configPath);
|
||||
}
|
||||
let label;
|
||||
if (options && options.verbose) {
|
||||
label = localize('workspaceNameVerbose', "{0} (Workspace)", this.getUriLabel(joinPath(dirname(workspace.configPath), filename)));
|
||||
} else {
|
||||
label = localize('workspaceName', "{0} (Workspace)", filename);
|
||||
}
|
||||
return this.appendWorkspaceSuffix(label, workspace.configPath);
|
||||
return '';
|
||||
|
||||
}
|
||||
|
||||
getSeparator(scheme: string, authority?: string): '/' | '\\' {
|
||||
|
||||
@@ -154,7 +154,6 @@ export class TextFileEditorModelManager extends Disposable implements ITextFileE
|
||||
// Model does not exist
|
||||
else {
|
||||
const newModel = model = this.instantiationService.createInstance(TextFileEditorModel, resource, options ? options.encoding : undefined);
|
||||
model = newModel;
|
||||
modelPromise = model.load(options);
|
||||
|
||||
// Install state change listener
|
||||
@@ -192,24 +191,24 @@ export class TextFileEditorModelManager extends Disposable implements ITextFileE
|
||||
this.mapResourceToPendingModelLoaders.set(resource, modelPromise);
|
||||
|
||||
try {
|
||||
const model = await modelPromise;
|
||||
const resolvedModel = await modelPromise;
|
||||
|
||||
// Make known to manager (if not already known)
|
||||
this.add(resource, model);
|
||||
this.add(resource, resolvedModel);
|
||||
|
||||
// Model can be dirty if a backup was restored, so we make sure to have this event delivered
|
||||
if (model.isDirty()) {
|
||||
this._onModelDirty.fire(new TextFileModelChangeEvent(model, StateChange.DIRTY));
|
||||
if (resolvedModel.isDirty()) {
|
||||
this._onModelDirty.fire(new TextFileModelChangeEvent(resolvedModel, StateChange.DIRTY));
|
||||
}
|
||||
|
||||
// Remove from pending loads
|
||||
this.mapResourceToPendingModelLoaders.delete(resource);
|
||||
|
||||
return model;
|
||||
return resolvedModel;
|
||||
} catch (error) {
|
||||
|
||||
// Free resources of this invalid model
|
||||
if (model && typeof model.dispose === 'function') { // workaround for https://github.com/Microsoft/vscode/issues/72404
|
||||
if (model) {
|
||||
model.dispose();
|
||||
}
|
||||
|
||||
|
||||
@@ -39,6 +39,7 @@ import { coalesce } from 'vs/base/common/arrays';
|
||||
import { trim } from 'vs/base/common/strings';
|
||||
import { VSBuffer } from 'vs/base/common/buffer';
|
||||
import { ITextSnapshot } from 'vs/editor/common/model';
|
||||
import { ITextResourceConfigurationService } from 'vs/editor/common/services/resourceConfiguration';
|
||||
|
||||
/**
|
||||
* The workbench file service implementation implements the raw file service spec and adds additional methods on top.
|
||||
@@ -85,7 +86,8 @@ export abstract class TextFileService extends Disposable implements ITextFileSer
|
||||
@IContextKeyService contextKeyService: IContextKeyService,
|
||||
@IDialogService private readonly dialogService: IDialogService,
|
||||
@IFileDialogService private readonly fileDialogService: IFileDialogService,
|
||||
@IEditorService private readonly editorService: IEditorService
|
||||
@IEditorService private readonly editorService: IEditorService,
|
||||
@ITextResourceConfigurationService protected readonly textResourceConfigurationService: ITextResourceConfigurationService
|
||||
) {
|
||||
super();
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@ import { isMacintosh, isLinux } from 'vs/base/common/platform';
|
||||
import product from 'vs/platform/product/node/product';
|
||||
import { ITextResourceConfigurationService } from 'vs/editor/common/services/resourceConfiguration';
|
||||
import { IWorkspaceContextService } from 'vs/platform/workspace/common/workspace';
|
||||
import { UTF8, UTF8_with_bom, UTF16be, UTF16le, encodingExists, IDetectedEncodingResult, encodeStream, UTF8_BOM, UTF16be_BOM, UTF16le_BOM, toDecodeStream, IDecodeStreamResult, detectEncodingByBOMFromBuffer } from 'vs/base/node/encoding';
|
||||
import { UTF8, UTF8_with_bom, UTF16be, UTF16le, encodingExists, encodeStream, UTF8_BOM, UTF16be_BOM, UTF16le_BOM, toDecodeStream, IDecodeStreamResult, detectEncodingByBOMFromBuffer } from 'vs/base/node/encoding';
|
||||
import { WORKSPACE_EXTENSION } from 'vs/platform/workspaces/common/workspaces';
|
||||
import { joinPath, extname, isEqualOrParent } from 'vs/base/common/resources';
|
||||
import { Disposable } from 'vs/base/common/lifecycle';
|
||||
@@ -70,8 +70,8 @@ export class NodeTextFileService extends TextFileService {
|
||||
|
||||
// read through encoding library
|
||||
const decoder = await toDecodeStream(this.streamToNodeReadable(bufferStream.value), {
|
||||
guessEncoding: options && options.autoGuessEncoding,
|
||||
overwriteEncoding: detected => this.encoding.getReadEncoding(resource, options, { encoding: detected, seemsBinary: false })
|
||||
guessEncoding: (options && options.autoGuessEncoding) || this.textResourceConfigurationService.getValue(resource, 'files.autoGuessEncoding'),
|
||||
overwriteEncoding: detectedEncoding => this.encoding.getReadEncoding(resource, options, detectedEncoding)
|
||||
});
|
||||
|
||||
// validate binary
|
||||
@@ -417,7 +417,7 @@ export class EncodingOracle extends Disposable implements IResourceEncodings {
|
||||
const overwriteEncoding = options && options.overwriteEncoding;
|
||||
if (!overwriteEncoding && encoding === UTF8) {
|
||||
try {
|
||||
const buffer = (await this.fileService.readFile(resource, { length: 3 })).value;
|
||||
const buffer = (await this.fileService.readFile(resource, { length: UTF8_BOM.length })).value;
|
||||
if (detectEncodingByBOMFromBuffer(buffer, buffer.byteLength) === UTF8) {
|
||||
return { encoding, addBOM: true };
|
||||
}
|
||||
@@ -438,12 +438,12 @@ export class EncodingOracle extends Disposable implements IResourceEncodings {
|
||||
};
|
||||
}
|
||||
|
||||
getReadEncoding(resource: URI, options: IReadTextFileOptions | undefined, detected: IDetectedEncodingResult): string {
|
||||
getReadEncoding(resource: URI, options: IReadTextFileOptions | undefined, detectedEncoding: string | null): string {
|
||||
let preferredEncoding: string | undefined;
|
||||
|
||||
// Encoding passed in as option
|
||||
if (options && options.encoding) {
|
||||
if (detected.encoding === UTF8 && options.encoding === UTF8) {
|
||||
if (detectedEncoding === UTF8 && options.encoding === UTF8) {
|
||||
preferredEncoding = UTF8_with_bom; // indicate the file has BOM if we are to resolve with UTF 8
|
||||
} else {
|
||||
preferredEncoding = options.encoding; // give passed in encoding highest priority
|
||||
@@ -451,11 +451,11 @@ export class EncodingOracle extends Disposable implements IResourceEncodings {
|
||||
}
|
||||
|
||||
// Encoding detected
|
||||
else if (detected.encoding) {
|
||||
if (detected.encoding === UTF8) {
|
||||
else if (detectedEncoding) {
|
||||
if (detectedEncoding === UTF8) {
|
||||
preferredEncoding = UTF8_with_bom; // if we detected UTF-8, it can only be because of a BOM
|
||||
} else {
|
||||
preferredEncoding = detected.encoding;
|
||||
preferredEncoding = detectedEncoding;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -570,6 +570,13 @@ suite('Files - TextFileService i/o', () => {
|
||||
assert.equal(result.encoding, 'utf16be');
|
||||
});
|
||||
|
||||
test('readStream - autoguessEncoding', async () => {
|
||||
const resource = URI.file(join(testDir, 'some_cp1252.txt'));
|
||||
|
||||
const result = await service.readStream(resource, { autoGuessEncoding: true });
|
||||
assert.equal(result.encoding, 'windows1252');
|
||||
});
|
||||
|
||||
test('readStream - FILE_IS_BINARY', async () => {
|
||||
const resource = URI.file(join(testDir, 'binary.txt'));
|
||||
|
||||
@@ -586,4 +593,21 @@ suite('Files - TextFileService i/o', () => {
|
||||
const result = await service.readStream(URI.file(join(testDir, 'small.txt')), { acceptTextOnly: true });
|
||||
assert.equal(result.name, 'small.txt');
|
||||
});
|
||||
|
||||
test('read - FILE_IS_BINARY', async () => {
|
||||
const resource = URI.file(join(testDir, 'binary.txt'));
|
||||
|
||||
let error: TextFileOperationError | undefined = undefined;
|
||||
try {
|
||||
await service.read(resource, { acceptTextOnly: true });
|
||||
} catch (err) {
|
||||
error = err;
|
||||
}
|
||||
|
||||
assert.ok(error);
|
||||
assert.equal(error!.textFileOperationResult, TextFileOperationResult.FILE_IS_BINARY);
|
||||
|
||||
const result = await service.read(URI.file(join(testDir, 'small.txt')), { acceptTextOnly: true });
|
||||
assert.equal(result.name, 'small.txt');
|
||||
});
|
||||
});
|
||||
|
||||
@@ -6,19 +6,19 @@
|
||||
import * as nls from 'vs/nls';
|
||||
import * as types from 'vs/base/common/types';
|
||||
import { IExtensionService } from 'vs/workbench/services/extensions/common/extensions';
|
||||
import { IWorkbenchThemeService, IColorTheme, ITokenColorCustomizations, IFileIconTheme, ExtensionData, VS_LIGHT_THEME, VS_DARK_THEME, VS_HC_THEME, COLOR_THEME_SETTING, ICON_THEME_SETTING, CUSTOM_WORKBENCH_COLORS_SETTING, CUSTOM_EDITOR_COLORS_SETTING, DETECT_HC_SETTING, HC_THEME_ID } from 'vs/workbench/services/themes/common/workbenchThemeService';
|
||||
import { IWorkbenchThemeService, IColorTheme, ITokenColorCustomizations, IFileIconTheme, ExtensionData, VS_LIGHT_THEME, VS_DARK_THEME, VS_HC_THEME, COLOR_THEME_SETTING, ICON_THEME_SETTING, CUSTOM_WORKBENCH_COLORS_SETTING, CUSTOM_EDITOR_COLORS_SETTING, DETECT_HC_SETTING, HC_THEME_ID, IColorCustomizations } from 'vs/workbench/services/themes/common/workbenchThemeService';
|
||||
import { IStorageService, StorageScope } from 'vs/platform/storage/common/storage';
|
||||
import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry';
|
||||
import { Registry } from 'vs/platform/registry/common/platform';
|
||||
import * as errors from 'vs/base/common/errors';
|
||||
import { IConfigurationService, ConfigurationTarget } from 'vs/platform/configuration/common/configuration';
|
||||
import { IConfigurationRegistry, Extensions as ConfigurationExtensions, IConfigurationPropertySchema, IConfigurationNode } from 'vs/platform/configuration/common/configurationRegistry';
|
||||
import { ColorThemeData } from './colorThemeData';
|
||||
import { ColorThemeData } from 'vs/workbench/services/themes/common/colorThemeData';
|
||||
import { ITheme, Extensions as ThemingExtensions, IThemingRegistry } from 'vs/platform/theme/common/themeService';
|
||||
import { Event, Emitter } from 'vs/base/common/event';
|
||||
import { registerFileIconThemeSchemas } from 'vs/workbench/services/themes/common/fileIconThemeSchema';
|
||||
import { IDisposable, dispose } from 'vs/base/common/lifecycle';
|
||||
import { ColorThemeStore } from 'vs/workbench/services/themes/browser/colorThemeStore';
|
||||
import { ColorThemeStore } from 'vs/workbench/services/themes/common/colorThemeStore';
|
||||
import { FileIconThemeStore } from 'vs/workbench/services/themes/common/fileIconThemeStore';
|
||||
import { FileIconThemeData } from 'vs/workbench/services/themes/common/fileIconThemeData';
|
||||
import { removeClasses, addClasses } from 'vs/base/browser/dom';
|
||||
@@ -64,10 +64,6 @@ function validateThemeId(theme: string): string {
|
||||
return theme;
|
||||
}
|
||||
|
||||
export interface IColorCustomizations {
|
||||
[colorIdOrThemeSettingsId: string]: string | IColorCustomizations;
|
||||
}
|
||||
|
||||
export class WorkbenchThemeService implements IWorkbenchThemeService {
|
||||
_serviceBrand: any;
|
||||
|
||||
|
||||
@@ -6,8 +6,8 @@
|
||||
import { basename } from 'vs/base/common/path';
|
||||
import * as Json from 'vs/base/common/json';
|
||||
import { Color } from 'vs/base/common/color';
|
||||
import { ExtensionData, ITokenColorCustomizations, ITokenColorizationRule, IColorTheme, IColorMap, IThemeExtensionPoint, VS_LIGHT_THEME, VS_HC_THEME } from 'vs/workbench/services/themes/common/workbenchThemeService';
|
||||
import { convertSettings } from 'vs/workbench/services/themes/browser/themeCompatibility';
|
||||
import { ExtensionData, ITokenColorCustomizations, ITokenColorizationRule, IColorTheme, IColorMap, IThemeExtensionPoint, VS_LIGHT_THEME, VS_HC_THEME, IColorCustomizations } from 'vs/workbench/services/themes/common/workbenchThemeService';
|
||||
import { convertSettings } from 'vs/workbench/services/themes/common/themeCompatibility';
|
||||
import * as nls from 'vs/nls';
|
||||
import * as types from 'vs/base/common/types';
|
||||
import * as objects from 'vs/base/common/objects';
|
||||
@@ -15,7 +15,6 @@ import * as resources from 'vs/base/common/resources';
|
||||
import { Extensions, IColorRegistry, ColorIdentifier, editorBackground, editorForeground } from 'vs/platform/theme/common/colorRegistry';
|
||||
import { ThemeType } from 'vs/platform/theme/common/themeService';
|
||||
import { Registry } from 'vs/platform/registry/common/platform';
|
||||
import { IColorCustomizations } from 'vs/workbench/services/themes/browser/workbenchThemeService';
|
||||
import { getParseErrorMessage } from 'vs/base/common/jsonErrorMessages';
|
||||
import { URI } from 'vs/base/common/uri';
|
||||
import { IFileService } from 'vs/platform/files/common/files';
|
||||
@@ -9,7 +9,7 @@ import * as types from 'vs/base/common/types';
|
||||
import * as resources from 'vs/base/common/resources';
|
||||
import { ExtensionsRegistry, ExtensionMessageCollector } from 'vs/workbench/services/extensions/common/extensionsRegistry';
|
||||
import { ExtensionData, IThemeExtensionPoint, VS_LIGHT_THEME, VS_DARK_THEME, VS_HC_THEME } from 'vs/workbench/services/themes/common/workbenchThemeService';
|
||||
import { ColorThemeData } from 'vs/workbench/services/themes/browser/colorThemeData';
|
||||
import { ColorThemeData } from 'vs/workbench/services/themes/common/colorThemeData';
|
||||
import { IExtensionService } from 'vs/workbench/services/extensions/common/extensions';
|
||||
import { Event, Emitter } from 'vs/base/common/event';
|
||||
import { URI } from 'vs/base/common/uri';
|
||||
@@ -64,6 +64,10 @@ export interface IWorkbenchThemeService extends IThemeService {
|
||||
onDidFileIconThemeChange: Event<IFileIconTheme>;
|
||||
}
|
||||
|
||||
export interface IColorCustomizations {
|
||||
[colorIdOrThemeSettingsId: string]: string | IColorCustomizations;
|
||||
}
|
||||
|
||||
export interface ITokenColorCustomizations {
|
||||
comments?: string | ITokenColorizationSetting;
|
||||
strings?: string | ITokenColorizationSetting;
|
||||
|
||||
Reference in New Issue
Block a user