more renames
This commit is contained in:
parent
12e86c5033
commit
cc7ec60f62
12 changed files with 43 additions and 43 deletions
|
@ -104,12 +104,12 @@ export interface IFileService {
|
|||
/**
|
||||
* @deprecated use readFile() instead.
|
||||
*/
|
||||
resolveContent(resource: URI, options?: IResolveContentOptions): Promise<IContent>;
|
||||
resolveContent(resource: URI, options?: IReadTextFileOptions): Promise<IContent>;
|
||||
|
||||
/**
|
||||
* @deprecated use readFileStream() instead.
|
||||
*/
|
||||
resolveStreamContent(resource: URI, options?: IResolveContentOptions): Promise<IStreamContent>;
|
||||
resolveStreamContent(resource: URI, options?: IReadTextFileOptions): Promise<IStreamContent>;
|
||||
|
||||
/**
|
||||
* Read the contents of the provided resource unbuffered.
|
||||
|
@ -787,7 +787,7 @@ export interface IReadFileOptions {
|
|||
};
|
||||
}
|
||||
|
||||
export interface IResolveContentOptions extends IReadFileOptions {
|
||||
export interface IReadTextFileOptions extends IReadFileOptions {
|
||||
|
||||
/**
|
||||
* The optional acceptTextOnly parameter allows to fail this request early if the file
|
||||
|
@ -878,7 +878,7 @@ export interface ICreateFileOptions {
|
|||
}
|
||||
|
||||
export class FileOperationError extends Error {
|
||||
constructor(message: string, public fileOperationResult: FileOperationResult, public options?: IResolveContentOptions & IWriteTextFileOptions & ICreateFileOptions) {
|
||||
constructor(message: string, public fileOperationResult: FileOperationResult, public options?: IReadTextFileOptions & IWriteTextFileOptions & ICreateFileOptions) {
|
||||
super(message);
|
||||
}
|
||||
|
||||
|
@ -1209,7 +1209,7 @@ export interface ILegacyFileService extends IDisposable {
|
|||
|
||||
registerProvider(scheme: string, provider: IFileSystemProvider): IDisposable;
|
||||
|
||||
resolveContent(resource: URI, options?: IResolveContentOptions): Promise<IContent>;
|
||||
resolveContent(resource: URI, options?: IReadTextFileOptions): Promise<IContent>;
|
||||
|
||||
resolveStreamContent(resource: URI, options?: IResolveContentOptions): Promise<IStreamContent>;
|
||||
resolveStreamContent(resource: URI, options?: IReadTextFileOptions): Promise<IStreamContent>;
|
||||
}
|
|
@ -5,12 +5,12 @@
|
|||
|
||||
import { URI } from 'vs/base/common/uri';
|
||||
import { createDecorator } from 'vs/platform/instantiation/common/instantiation';
|
||||
import { IResolveContentOptions, ITextSnapshot } from 'vs/platform/files/common/files';
|
||||
import { IReadTextFileOptions, ITextSnapshot } from 'vs/platform/files/common/files';
|
||||
import { ITextBufferFactory } from 'vs/editor/common/model';
|
||||
|
||||
export const IBackupFileService = createDecorator<IBackupFileService>('backupFileService');
|
||||
|
||||
export const BACKUP_FILE_RESOLVE_OPTIONS: IResolveContentOptions = { acceptTextOnly: true, encoding: 'utf8' };
|
||||
export const BACKUP_FILE_RESOLVE_OPTIONS: IReadTextFileOptions = { acceptTextOnly: true, encoding: 'utf8' };
|
||||
|
||||
/**
|
||||
* A service that handles any I/O and state associated with the backup system.
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
import { WORKSPACE_EXTENSION } from 'vs/platform/workspaces/common/workspaces';
|
||||
import * as encoding from 'vs/base/node/encoding';
|
||||
import { URI } from 'vs/base/common/uri';
|
||||
import { IResolveContentOptions, isParent, IResourceEncodings, IResourceEncoding } from 'vs/platform/files/common/files';
|
||||
import { IReadTextFileOptions, isParent, IResourceEncodings, IResourceEncoding } from 'vs/platform/files/common/files';
|
||||
import { isLinux } from 'vs/base/common/platform';
|
||||
import { extname } from 'vs/base/common/path';
|
||||
import { ITextResourceConfigurationService } from 'vs/editor/common/services/resourceConfiguration';
|
||||
|
@ -49,7 +49,7 @@ export class ResourceEncodings extends Disposable implements IResourceEncodings
|
|||
}));
|
||||
}
|
||||
|
||||
getReadEncoding(resource: URI, options: IResolveContentOptions | undefined, detected: encoding.IDetectedEncodingResult): string {
|
||||
getReadEncoding(resource: URI, options: IReadTextFileOptions | undefined, detected: encoding.IDetectedEncodingResult): string {
|
||||
let preferredEncoding: string | undefined;
|
||||
|
||||
// Encoding passed in as option
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
import * as paths from 'vs/base/common/path';
|
||||
import * as fs from 'fs';
|
||||
import * as assert from 'assert';
|
||||
import { FileOperationEvent, IContent, IResolveContentOptions, IFileStat, IStreamContent, FileOperationError, FileOperationResult, IContentData, ILegacyFileService, IFileService, IFileSystemProvider } from 'vs/platform/files/common/files';
|
||||
import { FileOperationEvent, IContent, IReadTextFileOptions, IFileStat, IStreamContent, FileOperationError, FileOperationResult, IContentData, ILegacyFileService, IFileService, IFileSystemProvider } from 'vs/platform/files/common/files';
|
||||
import { MAX_FILE_SIZE, MAX_HEAP_SIZE } from 'vs/platform/files/node/fileConstants';
|
||||
import { URI as uri } from 'vs/base/common/uri';
|
||||
import * as nls from 'vs/nls';
|
||||
|
@ -55,7 +55,7 @@ export class LegacyFileService extends Disposable implements ILegacyFileService
|
|||
|
||||
//#region Read File
|
||||
|
||||
resolveContent(resource: uri, options?: IResolveContentOptions): Promise<IContent> {
|
||||
resolveContent(resource: uri, options?: IReadTextFileOptions): Promise<IContent> {
|
||||
return this.resolveStreamContent(resource, options).then(streamContent => {
|
||||
return new Promise<IContent>((resolve, reject) => {
|
||||
|
||||
|
@ -79,7 +79,7 @@ export class LegacyFileService extends Disposable implements ILegacyFileService
|
|||
});
|
||||
}
|
||||
|
||||
resolveStreamContent(resource: uri, options?: IResolveContentOptions): Promise<IStreamContent> {
|
||||
resolveStreamContent(resource: uri, options?: IReadTextFileOptions): Promise<IStreamContent> {
|
||||
|
||||
// Guard early against attempts to resolve an invalid file path
|
||||
if (resource.scheme !== Schemas.file || !resource.fsPath) {
|
||||
|
@ -220,14 +220,14 @@ export class LegacyFileService extends Disposable implements ILegacyFileService
|
|||
});
|
||||
}
|
||||
|
||||
private fillInContents(content: Partial<IStreamContent>, resource: uri, options: IResolveContentOptions | undefined, token: CancellationToken): Promise<void> {
|
||||
private fillInContents(content: Partial<IStreamContent>, resource: uri, options: IReadTextFileOptions | undefined, token: CancellationToken): Promise<void> {
|
||||
return this.resolveFileData(resource, options, token).then(data => {
|
||||
content.encoding = data.encoding;
|
||||
content.value = data.stream;
|
||||
});
|
||||
}
|
||||
|
||||
private resolveFileData(resource: uri, options: IResolveContentOptions | undefined, token: CancellationToken): Promise<IContentData> {
|
||||
private resolveFileData(resource: uri, options: IReadTextFileOptions | undefined, token: CancellationToken): Promise<IContentData> {
|
||||
const chunkBuffer = Buffer.allocUnsafe(64 * 1024);
|
||||
|
||||
const result: Partial<IContentData> = {
|
||||
|
|
|
@ -11,7 +11,7 @@ import { IDecodeStreamOptions, toDecodeStream } from 'vs/base/node/encoding';
|
|||
import { ITextResourceConfigurationService } from 'vs/editor/common/services/resourceConfiguration';
|
||||
import { localize } from 'vs/nls';
|
||||
import { IEnvironmentService } from 'vs/platform/environment/common/environment';
|
||||
import { FileOperationError, FileOperationResult, IContent, IFileSystemProvider, IResolveContentOptions, IStreamContent, ILegacyFileService, IFileService } from 'vs/platform/files/common/files';
|
||||
import { FileOperationError, FileOperationResult, IContent, IFileSystemProvider, IReadTextFileOptions, IStreamContent, ILegacyFileService, IFileService } from 'vs/platform/files/common/files';
|
||||
import { IWorkspaceContextService } from 'vs/platform/workspace/common/workspace';
|
||||
import { LegacyFileService } from 'vs/workbench/services/files/node/fileService';
|
||||
import { createReadableOfProvider } from 'vs/workbench/services/files/node/streams';
|
||||
|
@ -77,7 +77,7 @@ export class LegacyRemoteFileService extends LegacyFileService {
|
|||
|
||||
// --- resolve
|
||||
|
||||
resolveContent(resource: URI, options?: IResolveContentOptions): Promise<IContent> {
|
||||
resolveContent(resource: URI, options?: IReadTextFileOptions): Promise<IContent> {
|
||||
if (resource.scheme === Schemas.file) {
|
||||
return super.resolveContent(resource, options);
|
||||
} else {
|
||||
|
@ -85,7 +85,7 @@ export class LegacyRemoteFileService extends LegacyFileService {
|
|||
}
|
||||
}
|
||||
|
||||
resolveStreamContent(resource: URI, options?: IResolveContentOptions): Promise<IStreamContent> {
|
||||
resolveStreamContent(resource: URI, options?: IReadTextFileOptions): Promise<IStreamContent> {
|
||||
if (resource.scheme === Schemas.file) {
|
||||
return super.resolveStreamContent(resource, options);
|
||||
} else {
|
||||
|
@ -93,7 +93,7 @@ export class LegacyRemoteFileService extends LegacyFileService {
|
|||
}
|
||||
}
|
||||
|
||||
private _readFile(resource: URI, options: IResolveContentOptions = Object.create(null)): Promise<IStreamContent> {
|
||||
private _readFile(resource: URI, options: IReadTextFileOptions = Object.create(null)): Promise<IStreamContent> {
|
||||
return this._withProvider(resource).then(provider => {
|
||||
|
||||
return this.fileService.resolve(resource).then(fileStat => {
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
|
||||
import { FileService2 } from 'vs/workbench/services/files2/common/fileService2';
|
||||
import { URI } from 'vs/base/common/uri';
|
||||
import { IResolveContentOptions, IStreamContent, IStringStream, IContent, IFileSystemProvider, FileOperationError, FileOperationResult } from 'vs/platform/files/common/files';
|
||||
import { IReadTextFileOptions, IStreamContent, IStringStream, IContent, IFileSystemProvider, FileOperationError, FileOperationResult } from 'vs/platform/files/common/files';
|
||||
import { basename } from 'vs/base/common/resources';
|
||||
import { VSBuffer } from 'vs/base/common/buffer';
|
||||
import { localize } from 'vs/nls';
|
||||
|
@ -13,7 +13,7 @@ import { localize } from 'vs/nls';
|
|||
// TODO@ben temporary for testing only
|
||||
export class FileService3 extends FileService2 {
|
||||
|
||||
async resolveContent(resource: URI, options?: IResolveContentOptions): Promise<IContent> {
|
||||
async resolveContent(resource: URI, options?: IReadTextFileOptions): Promise<IContent> {
|
||||
return this.resolveStreamContent(resource, options).then(streamContent => {
|
||||
return new Promise<IContent>((resolve, reject) => {
|
||||
|
||||
|
@ -37,7 +37,7 @@ export class FileService3 extends FileService2 {
|
|||
});
|
||||
}
|
||||
|
||||
async resolveStreamContent(resource: URI, options?: IResolveContentOptions): Promise<IStreamContent> {
|
||||
async resolveStreamContent(resource: URI, options?: IReadTextFileOptions): Promise<IStreamContent> {
|
||||
const provider = await this.withProvider(resource);
|
||||
if (provider && provider.readFile) {
|
||||
const listeners: { [type: string]: any[]; } = Object.create(null);
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import { Disposable, IDisposable, toDisposable, combinedDisposable, dispose } from 'vs/base/common/lifecycle';
|
||||
import { IFileService, IResolveFileOptions, FileChangesEvent, FileOperationEvent, IFileSystemProviderRegistrationEvent, IFileSystemProvider, IFileStat, IResolveFileResult, IResolveContentOptions, IContent, IStreamContent, ICreateFileOptions, IFileSystemProviderActivationEvent, FileOperationError, FileOperationResult, FileOperation, FileSystemProviderCapabilities, FileType, toFileSystemProviderErrorCode, FileSystemProviderErrorCode, IStat, IFileStatWithMetadata, IResolveMetadataFileOptions, etag, hasReadWriteCapability, hasFileFolderCopyCapability, hasOpenReadWriteCloseCapability, toFileOperationResult, IFileSystemProviderWithOpenReadWriteCloseCapability, IFileSystemProviderWithFileReadWriteCapability, IResolveFileResultWithMetadata, IWatchOptions, ILegacyFileService, IWriteFileOptions, IReadFileOptions, IFileStreamContent, IFileContent } from 'vs/platform/files/common/files';
|
||||
import { IFileService, IResolveFileOptions, FileChangesEvent, FileOperationEvent, IFileSystemProviderRegistrationEvent, IFileSystemProvider, IFileStat, IResolveFileResult, IReadTextFileOptions, IContent, IStreamContent, ICreateFileOptions, IFileSystemProviderActivationEvent, FileOperationError, FileOperationResult, FileOperation, FileSystemProviderCapabilities, FileType, toFileSystemProviderErrorCode, FileSystemProviderErrorCode, IStat, IFileStatWithMetadata, IResolveMetadataFileOptions, etag, hasReadWriteCapability, hasFileFolderCopyCapability, hasOpenReadWriteCloseCapability, toFileOperationResult, IFileSystemProviderWithOpenReadWriteCloseCapability, IFileSystemProviderWithFileReadWriteCapability, IResolveFileResultWithMetadata, IWatchOptions, ILegacyFileService, IWriteFileOptions, IReadFileOptions, IFileStreamContent, IFileContent } from 'vs/platform/files/common/files';
|
||||
import { URI } from 'vs/base/common/uri';
|
||||
import { Event, Emitter } from 'vs/base/common/event';
|
||||
import { ServiceIdentifier } from 'vs/platform/instantiation/common/instantiation';
|
||||
|
@ -528,11 +528,11 @@ export class FileService2 extends Disposable implements IFileService {
|
|||
return stat;
|
||||
}
|
||||
|
||||
resolveContent(resource: URI, options?: IResolveContentOptions): Promise<IContent> {
|
||||
resolveContent(resource: URI, options?: IReadTextFileOptions): Promise<IContent> {
|
||||
return this.joinOnLegacy.then(legacy => legacy.resolveContent(resource, options));
|
||||
}
|
||||
|
||||
async resolveStreamContent(resource: URI, options?: IResolveContentOptions): Promise<IStreamContent> {
|
||||
async resolveStreamContent(resource: URI, options?: IReadTextFileOptions): Promise<IStreamContent> {
|
||||
return this.joinOnLegacy.then(legacy => legacy.resolveStreamContent(resource, options));
|
||||
}
|
||||
|
||||
|
|
|
@ -12,7 +12,7 @@ import { URI } from 'vs/base/common/uri';
|
|||
import { isUndefinedOrNull, withUndefinedAsNull } from 'vs/base/common/types';
|
||||
import { IWorkspaceContextService } from 'vs/platform/workspace/common/workspace';
|
||||
import { IEnvironmentService } from 'vs/platform/environment/common/environment';
|
||||
import { ITextFileService, IAutoSaveConfiguration, ModelState, ITextFileEditorModel, ISaveOptions, ISaveErrorHandler, ISaveParticipant, StateChange, SaveReason, IRawTextContent, ILoadOptions, LoadReason, IResolvedTextFileEditorModel } from 'vs/workbench/services/textfile/common/textfiles';
|
||||
import { ITextFileService, IAutoSaveConfiguration, ModelState, ITextFileEditorModel, ISaveOptions, ISaveErrorHandler, ISaveParticipant, StateChange, SaveReason, ITextFileContent, ILoadOptions, LoadReason, IResolvedTextFileEditorModel } from 'vs/workbench/services/textfile/common/textfiles';
|
||||
import { EncodingMode } from 'vs/workbench/common/editor';
|
||||
import { BaseTextEditorModel } from 'vs/workbench/common/editor/textEditorModel';
|
||||
import { IBackupFileService } from 'vs/workbench/services/backup/common/backup';
|
||||
|
@ -266,7 +266,7 @@ export class TextFileEditorModel extends BaseTextEditorModel implements ITextFil
|
|||
|
||||
// If we have a backup, continue loading with it
|
||||
if (!!backup) {
|
||||
const content: IRawTextContent = {
|
||||
const content: ITextFileContent = {
|
||||
resource: this.resource,
|
||||
name: basename(this.resource),
|
||||
mtime: Date.now(),
|
||||
|
@ -346,7 +346,7 @@ export class TextFileEditorModel extends BaseTextEditorModel implements ITextFil
|
|||
}
|
||||
}
|
||||
|
||||
private async loadWithContent(content: IRawTextContent, options?: ILoadOptions, backup?: URI): Promise<TextFileEditorModel> {
|
||||
private async loadWithContent(content: ITextFileContent, options?: ILoadOptions, backup?: URI): Promise<TextFileEditorModel> {
|
||||
const model = await this.doLoadWithContent(content, backup);
|
||||
|
||||
// Telemetry: We log the fileGet telemetry event after the model has been loaded to ensure a good mimetype
|
||||
|
@ -372,7 +372,7 @@ export class TextFileEditorModel extends BaseTextEditorModel implements ITextFil
|
|||
return model;
|
||||
}
|
||||
|
||||
private doLoadWithContent(content: IRawTextContent, backup?: URI): Promise<TextFileEditorModel> {
|
||||
private doLoadWithContent(content: ITextFileContent, backup?: URI): Promise<TextFileEditorModel> {
|
||||
this.logService.trace('load() - resolved content', this.resource);
|
||||
|
||||
// Update our resolved disk stat model
|
||||
|
|
|
@ -11,11 +11,11 @@ import { Event, Emitter } from 'vs/base/common/event';
|
|||
import * as platform from 'vs/base/common/platform';
|
||||
import { IWindowsService } from 'vs/platform/windows/common/windows';
|
||||
import { IBackupFileService } from 'vs/workbench/services/backup/common/backup';
|
||||
import { IResult, ITextFileOperationResult, ITextFileService, IRawTextContent, IAutoSaveConfiguration, AutoSaveMode, SaveReason, ITextFileEditorModelManager, ITextFileEditorModel, ModelState, ISaveOptions, AutoSaveContext, IWillMoveEvent } from 'vs/workbench/services/textfile/common/textfiles';
|
||||
import { IResult, ITextFileOperationResult, ITextFileService, ITextFileContent, IAutoSaveConfiguration, AutoSaveMode, SaveReason, ITextFileEditorModelManager, ITextFileEditorModel, ModelState, ISaveOptions, AutoSaveContext, IWillMoveEvent } from 'vs/workbench/services/textfile/common/textfiles';
|
||||
import { ConfirmResult, IRevertOptions } from 'vs/workbench/common/editor';
|
||||
import { ILifecycleService, ShutdownReason, LifecyclePhase } from 'vs/platform/lifecycle/common/lifecycle';
|
||||
import { IWorkspaceContextService, WorkbenchState } from 'vs/platform/workspace/common/workspace';
|
||||
import { IFileService, IResolveContentOptions, IFilesConfiguration, FileOperationError, FileOperationResult, AutoSaveConfiguration, HotExitConfiguration, ITextSnapshot, IWriteTextFileOptions, IFileStatWithMetadata, toBufferOrReadable, ICreateFileOptions, IResourceEncodings } from 'vs/platform/files/common/files';
|
||||
import { IFileService, IReadTextFileOptions, IFilesConfiguration, FileOperationError, FileOperationResult, AutoSaveConfiguration, HotExitConfiguration, ITextSnapshot, IWriteTextFileOptions, IFileStatWithMetadata, toBufferOrReadable, ICreateFileOptions, IResourceEncodings } from 'vs/platform/files/common/files';
|
||||
import { IConfigurationService } from 'vs/platform/configuration/common/configuration';
|
||||
import { Disposable } from 'vs/base/common/lifecycle';
|
||||
import { IWorkbenchEnvironmentService } from 'vs/workbench/services/environment/common/environmentService';
|
||||
|
@ -368,7 +368,7 @@ export abstract class TextFileService extends Disposable implements ITextFileSer
|
|||
|
||||
//#region primitives (resolve, create, move, delete, update)
|
||||
|
||||
async read(resource: URI, options?: IResolveContentOptions): Promise<IRawTextContent> {
|
||||
async read(resource: URI, options?: IReadTextFileOptions): Promise<ITextFileContent> {
|
||||
const streamContent = await this.fileService.resolveStreamContent(resource, options);
|
||||
const value = await createTextBufferFactoryFromStream(streamContent.value);
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@ import { URI } from 'vs/base/common/uri';
|
|||
import { Event } from 'vs/base/common/event';
|
||||
import { IDisposable } from 'vs/base/common/lifecycle';
|
||||
import { IEncodingSupport, ConfirmResult, IRevertOptions } from 'vs/workbench/common/editor';
|
||||
import { IResolveContentOptions, ITextSnapshot, IBaseStatWithMetadata, IWriteTextFileOptions, IFileStatWithMetadata, IResourceEncodings } from 'vs/platform/files/common/files';
|
||||
import { IReadTextFileOptions, ITextSnapshot, IBaseStatWithMetadata, IWriteTextFileOptions, IFileStatWithMetadata, IResourceEncodings } from 'vs/platform/files/common/files';
|
||||
import { createDecorator, ServiceIdentifier } from 'vs/platform/instantiation/common/instantiation';
|
||||
import { ITextEditorModel } from 'vs/editor/common/services/resolverService';
|
||||
import { ITextBufferFactory, ITextModel } from 'vs/editor/common/model';
|
||||
|
@ -103,7 +103,7 @@ export interface ITextFileService extends IDisposable {
|
|||
/**
|
||||
* Read the contents of a file identified by the resource.
|
||||
*/
|
||||
read(resource: URI, options?: IResolveContentOptions): Promise<IRawTextContent>;
|
||||
read(resource: URI, options?: IReadTextFileOptions): Promise<ITextFileContent>;
|
||||
|
||||
/**
|
||||
* Update a file with given contents.
|
||||
|
@ -262,7 +262,7 @@ export const enum LoadReason {
|
|||
OTHER = 3
|
||||
}
|
||||
|
||||
export interface IRawTextContent extends IBaseStatWithMetadata {
|
||||
export interface ITextFileContent extends IBaseStatWithMetadata {
|
||||
|
||||
/**
|
||||
* The line grouped content of a text file.
|
||||
|
|
|
@ -9,7 +9,7 @@ import { TextFileService } from 'vs/workbench/services/textfile/common/textFileS
|
|||
import { ITextFileService } from 'vs/workbench/services/textfile/common/textfiles';
|
||||
import { registerSingleton } from 'vs/platform/instantiation/common/extensions';
|
||||
import { URI } from 'vs/base/common/uri';
|
||||
import { ITextSnapshot, IWriteTextFileOptions, IFileStatWithMetadata, IResourceEncoding, IResolveContentOptions, stringToSnapshot, ICreateFileOptions, FileOperationError, FileOperationResult, IResourceEncodings } from 'vs/platform/files/common/files';
|
||||
import { ITextSnapshot, IWriteTextFileOptions, IFileStatWithMetadata, IResourceEncoding, IReadTextFileOptions, stringToSnapshot, ICreateFileOptions, FileOperationError, FileOperationResult, IResourceEncodings } from 'vs/platform/files/common/files';
|
||||
import { Schemas } from 'vs/base/common/network';
|
||||
import { exists, stat, chmod, rimraf } from 'vs/base/node/pfs';
|
||||
import { join, dirname } from 'vs/base/common/path';
|
||||
|
@ -311,7 +311,7 @@ export class EncodingOracle extends Disposable implements IResourceEncodings {
|
|||
};
|
||||
}
|
||||
|
||||
getReadEncoding(resource: URI, options: IResolveContentOptions | undefined, detected: IDetectedEncodingResult): string {
|
||||
getReadEncoding(resource: URI, options: IReadTextFileOptions | undefined, detected: IDetectedEncodingResult): string {
|
||||
let preferredEncoding: string | undefined;
|
||||
|
||||
// Encoding passed in as option
|
||||
|
|
|
@ -25,11 +25,11 @@ import { IUntitledEditorService, UntitledEditorService } from 'vs/workbench/serv
|
|||
import { IWorkspaceContextService, IWorkspace as IWorkbenchWorkspace, WorkbenchState, IWorkspaceFolder, IWorkspaceFoldersChangeEvent, Workspace } from 'vs/platform/workspace/common/workspace';
|
||||
import { ILifecycleService, BeforeShutdownEvent, ShutdownReason, StartupKind, LifecyclePhase, WillShutdownEvent } from 'vs/platform/lifecycle/common/lifecycle';
|
||||
import { ServiceCollection } from 'vs/platform/instantiation/common/serviceCollection';
|
||||
import { FileOperationEvent, IFileService, IResolveContentOptions, FileOperationError, IFileStat, IResolveFileResult, FileChangesEvent, IResolveFileOptions, IContent, IStreamContent, ICreateFileOptions, ITextSnapshot, IResourceEncoding, IFileSystemProvider, FileSystemProviderCapabilities, IFileChange, IWatchOptions, IStat, FileType, FileDeleteOptions, FileOverwriteOptions, FileWriteOptions, FileOpenOptions, IFileStatWithMetadata, IResolveMetadataFileOptions, IWriteFileOptions, IReadFileOptions, IFileContent, IFileStreamContent } from 'vs/platform/files/common/files';
|
||||
import { FileOperationEvent, IFileService, IReadTextFileOptions, FileOperationError, IFileStat, IResolveFileResult, FileChangesEvent, IResolveFileOptions, IContent, IStreamContent, ICreateFileOptions, ITextSnapshot, IResourceEncoding, IFileSystemProvider, FileSystemProviderCapabilities, IFileChange, IWatchOptions, IStat, FileType, FileDeleteOptions, FileOverwriteOptions, FileWriteOptions, FileOpenOptions, IFileStatWithMetadata, IResolveMetadataFileOptions, IWriteFileOptions, IReadFileOptions, IFileContent, IFileStreamContent } from 'vs/platform/files/common/files';
|
||||
import { IModelService } from 'vs/editor/common/services/modelService';
|
||||
import { ModeServiceImpl } from 'vs/editor/common/services/modeServiceImpl';
|
||||
import { ModelServiceImpl } from 'vs/editor/common/services/modelServiceImpl';
|
||||
import { IRawTextContent, ITextFileService } from 'vs/workbench/services/textfile/common/textfiles';
|
||||
import { ITextFileContent, ITextFileService } from 'vs/workbench/services/textfile/common/textfiles';
|
||||
import { parseArgs } from 'vs/platform/environment/node/argv';
|
||||
import { IModeService } from 'vs/editor/common/services/modeService';
|
||||
import { IHistoryService } from 'vs/workbench/services/history/common/history';
|
||||
|
@ -235,7 +235,7 @@ export class TestTextFileService extends BrowserTextFileService {
|
|||
this.resolveTextContentError = error;
|
||||
}
|
||||
|
||||
public read(resource: URI, options?: IResolveContentOptions): Promise<IRawTextContent> {
|
||||
public read(resource: URI, options?: IReadTextFileOptions): Promise<ITextFileContent> {
|
||||
if (this.resolveTextContentError) {
|
||||
const error = this.resolveTextContentError;
|
||||
this.resolveTextContentError = null;
|
||||
|
@ -243,7 +243,7 @@ export class TestTextFileService extends BrowserTextFileService {
|
|||
return Promise.reject(error);
|
||||
}
|
||||
|
||||
return this.fileService.resolveContent(resource, options).then((content): IRawTextContent => {
|
||||
return this.fileService.resolveContent(resource, options).then((content): ITextFileContent => {
|
||||
return {
|
||||
resource: content.resource,
|
||||
name: content.name,
|
||||
|
@ -949,7 +949,7 @@ export class TestFileService implements IFileService {
|
|||
return Promise.resolve(true);
|
||||
}
|
||||
|
||||
resolveContent(resource: URI, _options?: IResolveContentOptions): Promise<IContent> {
|
||||
resolveContent(resource: URI, _options?: IReadTextFileOptions): Promise<IContent> {
|
||||
return Promise.resolve({
|
||||
resource: resource,
|
||||
value: this.content,
|
||||
|
@ -961,7 +961,7 @@ export class TestFileService implements IFileService {
|
|||
});
|
||||
}
|
||||
|
||||
resolveStreamContent(resource: URI, _options?: IResolveContentOptions): Promise<IStreamContent> {
|
||||
resolveStreamContent(resource: URI, _options?: IReadTextFileOptions): Promise<IStreamContent> {
|
||||
return Promise.resolve({
|
||||
resource: resource,
|
||||
value: {
|
||||
|
|
Loading…
Reference in a new issue