Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IFileService doesn't support binary data #41543

Closed
jrieken opened this issue Jan 12, 2018 · 9 comments
Closed

IFileService doesn't support binary data #41543

jrieken opened this issue Jan 12, 2018 · 9 comments
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug file-io File I/O remote Remote system operations issues verified Verification succeeded
Milestone

Comments

@jrieken
Copy link
Member

jrieken commented Jan 12, 2018

The contract for resolving a file is to return IContent with value: string (or the string-stream equivalent). That API prevents us from doing a few things, such as previewing images from remote sources (see #34773) and things like drag and drop of files between different file systems, esp between the file-support and others.

An easy way to corrupt your data is:

  • have a workspace folder from disk and one from ftp
  • have an image file in the workspace folder from disk
  • dnd that onto a folder in the ftp workspace
  • 🐛 the image is now garbage...

IMO the better API would be to just talk about bytes or chunks of bytes and turn things into a string later, e.g in the text file service. That would allow to pump data from one provider onto another provider, it would also allow to build data-uris for remote images.

@jrieken jrieken added the remote Remote system operations issues label Jan 12, 2018
jrieken added a commit that referenced this issue Jan 12, 2018
@jrieken
Copy link
Member Author

jrieken commented Jan 12, 2018

I have pushed a workaround that prevent data loss tho the issue remains...

@bpasero
Copy link
Member

bpasero commented Jan 14, 2018

I think changing from string to Buffer would be relatively easy in the file service, but I fear that we have lots of clients of the IFileService in browser where we would need to lift it up to node because Buffer is a node.js thing. And that does include things which live in editor (like bulkEdit.ts, quickFixCommands.ts) that would then need to move to workbench I guess.

Since 99% of all users of this method want the string and not a Buffer, I would probably introduce a new method (resolveBinary?) to explicitly resolve content as Buffer and not make it any harder for clients to convert to a string.

Still, the issue with layering remains.

@bpasero bpasero added the feature-request Request for new features or functionality label Jan 14, 2018
@jrieken
Copy link
Member Author

jrieken commented Jan 15, 2018

the IFileService in browser where we would need to lift it up to node because Buffer is a node.js thing

A buffer is just an Unit8Array which is available anywhere so I don't believe that's a problem. See https://nodejs.org/dist/latest-v8.x/docs/api/buffer.html#buffer_buffers_and_typedarray.

@bpasero
Copy link
Member

bpasero commented Jan 15, 2018

Ok so that is helpful.

@bpasero bpasero removed their assignment Jan 24, 2018
@jrieken
Copy link
Member Author

jrieken commented Apr 13, 2018

As discussed - We should have methods that return streams (readable, writable) which return bytes or strings depending on the presence of a encoding. Maybe no encoding guessing in those methods?

@jrieken
Copy link
Member Author

jrieken commented Aug 15, 2018

This also prevents copying data from a 'remote' file onto the local disk

@GinoMan
Copy link

GinoMan commented Jan 28, 2019

I've added the proper interface for a binary file and the interface method, but I don't want to pull request anything until I've fully implemented everything that needs to exist for this to work.

As of right now it's just extra optional code that's been added that doesn't change much of anything. I'm not a typescript programmer specifically but I know enough to be dangerous. I'm also not really familiar with the codebase yet, but there's no reason that VSCode can't have a kick-butt FTP/SFTP/etc client built in without the need for an extra client like Cyberduck or Filezilla. remote-workspace shows a lot of promise in that area but it doesn't work completely and part of that has to do with the lack of binary support in the filesystem provider.

I would love some feedback on what needs to be done or even to work with one of the developers to make this happen. But this is what I've done so far:

index b007b6f184..2fe8e61d9f 100644
--- a/src/vs/platform/files/common/files.ts
+++ b/src/vs/platform/files/common/files.ts
@@ -90,6 +90,13 @@ export interface IFileService {
         */
        resolveContent(resource: URI, options?: IResolveContentOptions): Promise<IContent>;

+       /**
+        * Resolve the contents of a binary file identified by the resource.
+        *
+        * The returned object contains properties of the file and the full contents as a byte array.
+        */
+       resolveBinaryContent?(resource: URI, options?: IResolveContentOptions): Promise<IBinaryContent> // This should be optional for now.
+
        /**
         * Resolve the contents of a file identified by the resource.
         *
@@ -465,6 +472,32 @@ export interface IContent extends IBaseStat {
         */
        value: string;

+       /**
+        * The Mime Type of the file if known
+        */
+       mimeType?: string;
+
+       /**
+        * The encoding of the content if known.
+        */
+       encoding: string;
+}
+
+/**
+ * Content and meta information of a binary file.
+ */
+export interface IBinaryContent extends IBaseStat {
+
+       /**
+        * The content of a binary file or text file treated as binary.
+        */
+       value: Uint8Array;
+
+       /**
+        * The Mime Type of the file if known
+        */
+       mimeType?: string;
+
        /**
         * The encoding of the content if known.
         */

@GinoMan
Copy link

GinoMan commented Jan 29, 2019

The lines below seem to reference the IFileService interface. This might help us figure out where code changes need to be made to make this work:

../../../../../src/vs/platform/files/common/files.ts:17:export const IFileService = createDecorator<IFileService>('fileService');
../../../../../src/vs/platform/files/common/files.ts:23:export interface IFileService {

../../../../../src/vs/workbench/api/electron-browser/mainThreadDocuments.ts:14:import { IFileService } from 'vs/platform/files/common/files';
../../../../../src/vs/workbench/api/electron-browser/mainThreadDocuments.ts:70: private _fileService: IFileService;
../../../../../src/vs/workbench/api/electron-browser/mainThreadDocuments.ts:85:         @IFileService fileService: IFileService,

../../../../../src/vs/workbench/api/electron-browser/mainThreadDocumentsAndEditors.ts:18:import { IFileService } from 'vs/platform/files/common/files';
../../../../../src/vs/workbench/api/electron-browser/mainThreadDocumentsAndEditors.ts:328:              @IFileService fileService: IFileService,

../../../../../src/vs/workbench/api/electron-browser/mainThreadFileSystem.ts:9:import { FileWriteOptions, FileSystemProviderCapabilities, IFileChange, IFileService, IFileSystemProvider, IStat, IWatchOptions, FileType, FileOverwriteOptions, FileDeleteOptions } from 'vs/platform/files/common/files';
../../../../../src/vs/workbench/api/electron-browser/mainThreadFileSystem.ts:22:                @IFileService private readonly _fileService: IFileService,
../../../../../src/vs/workbench/api/electron-browser/mainThreadFileSystem.ts:62:                fileService: IFileService,

../../../../../src/vs/workbench/api/electron-browser/mainThreadFileSystemEventService.ts:7:import { FileChangeType, IFileService, FileOperation } from 'vs/platform/files/common/files';
../../../../../src/vs/workbench/api/electron-browser/mainThreadFileSystemEventService.ts:19:            @IFileService fileService: IFileService,

../../../../../src/vs/workbench/browser/dnd.ts:8:import { IFileService } from 'vs/platform/files/common/files';
../../../../../src/vs/workbench/browser/dnd.ts:156:             @IFileService private readonly fileService: IFileService,

../../../../../src/vs/workbench/browser/parts/editor/binaryEditor.ts:18:import { IFileService } from 'vs/platform/files/common/files';
../../../../../src/vs/workbench/browser/parts/editor/binaryEditor.ts:50:                @IFileService private readonly _fileService: IFileService,

../../../../../src/vs/workbench/browser/parts/editor/breadcrumbsControl.ts:29:import { FileKind, IFileService, IFileStat } from 'vs/platform/files/common/files';
../../../../../src/vs/workbench/browser/parts/editor/breadcrumbsControl.ts:165:         @IFileService private readonly _fileService: IFileService,

../../../../../src/vs/workbench/browser/parts/editor/breadcrumbsPicker.ts:23:import { FileKind, IFileService, IFileStat } from 'vs/platform/files/common/files';
../../../../../src/vs/workbench/browser/parts/editor/breadcrumbsPicker.ts:211:          @IFileService private readonly _fileService: IFileService,

../../../../../src/vs/workbench/browser/parts/editor/editorStatus.ts:31:import { SUPPORTED_ENCODINGS, IFileService, FILES_ASSOCIATIONS_CONFIG } from 'vs/platform/files/common/files';
../../../../../src/vs/workbench/browser/parts/editor/editorStatus.ts:1151:              @IFileService private readonly fileService: IFileService

../../../../../src/vs/workbench/browser/parts/editor/resourceViewer.ts:24:import { IFileService } from 'vs/platform/files/common/files';
../../../../../src/vs/workbench/browser/parts/editor/resourceViewer.ts:75:              fileService: IFileService,
../../../../../src/vs/workbench/browser/parts/editor/resourceViewer.ts:117:             fileService: IFileService,
../../../../../src/vs/workbench/browser/parts/editor/resourceViewer.ts:360:             fileService: IFileService,
../../../../../src/vs/workbench/browser/parts/editor/resourceViewer.ts:572:     private static imageSrc(descriptor: IResourceDescriptor, fileService: IFileService): Promise<string> {

../../../../../src/vs/workbench/browser/parts/editor/tabsTitleControl.ts:42:import { IFileService } from 'vs/platform/files/common/files';
../../../../../src/vs/workbench/browser/parts/editor/tabsTitleControl.ts:84:            @IFileService fileService: IFileService,

../../../../../src/vs/workbench/browser/parts/editor/titleControl.ts:41:import { IFileService } from 'vs/platform/files/common/files';
../../../../../src/vs/workbench/browser/parts/editor/titleControl.ts:79:                @IFileService private readonly fileService: IFileService,

../../../../../src/vs/workbench/browser/parts/quickopen/quickOpenController.ts:40:import { IFileService } from 'vs/platform/files/common/files';
../../../../../src/vs/workbench/browser/parts/quickopen/quickOpenController.ts:650:             @IFileService private readonly fileService: IFileService
../../../../../src/vs/workbench/browser/parts/quickopen/quickOpenController.ts:737:             @IFileService fileService: IFileService
../../../../../src/vs/workbench/browser/parts/quickopen/quickOpenController.ts:809:function resourceForEditorHistory(input: EditorInput, fileService: IFileService): URI {../../../../../src/vs/workbench/common/editor/binaryEditorModel.ts:8:import { IFileService } from 'vs/platform/files/common/files';

../../../../../src/vs/workbench/common/editor/binaryEditorModel.ts:25:          @IFileService private readonly fileService: IFileService

../../../../../src/vs/workbench/common/resources.ts:10:import { IFileService } from 'vs/platform/files/common/files';
../../../../../src/vs/workbench/common/resources.ts:33:         @IFileService private readonly _fileService: IFileService,

../../../../../src/vs/workbench/electron-browser/window.ts:13:import { IFileService } from 'vs/platform/files/common/files';
../../../../../src/vs/workbench/electron-browser/window.ts:79:          @IFileService private readonly fileService: IFileService,

../../../../../src/vs/workbench/electron-browser/workbench.ts:53:import { IFileService } from 'vs/platform/files/common/files';
../../../../../src/vs/workbench/electron-browser/workbench.ts:211:      private fileService: IFileService;
../../../../../src/vs/workbench/electron-browser/workbench.ts:400:              serviceCollection.set(IFileService, this.fileService);

../../../../../src/vs/workbench/parts/codeEditor/electron-browser/languageConfiguration/languageConfigurationExtensionPoint.ts:15:import { IFileService } from 'vs/platform/files/common/files';
../../../../../src/vs/workbench/parts/codeEditor/electron-browser/languageConfiguration/languageConfigurationExtensionPoint.ts:71:              @IFileService private readonly _fileService: IFileService,

../../../../../src/vs/workbench/parts/debug/browser/debugActions.ts:12:import { IFileService } from 'vs/platform/files/common/files';
../../../../../src/vs/workbench/parts/debug/browser/debugActions.ts:199:                @IFileService fileService: IFileService,

../../../../../src/vs/workbench/parts/debug/electron-browser/debugConfigurationManager.ts:20:import { IFileService } from 'vs/platform/files/common/files';
../../../../../src/vs/workbench/parts/debug/electron-browser/debugConfigurationManager.ts:478:          @IFileService private readonly fileService: IFileService,
../../../../../src/vs/workbench/parts/debug/electron-browser/debugConfigurationManager.ts:596:          @IFileService fileService: IFileService,
../../../../../src/vs/workbench/parts/debug/electron-browser/debugConfigurationManager.ts:628:          @IFileService fileService: IFileService,

../../../../../src/vs/workbench/parts/debug/electron-browser/debugService.ts:18:import { FileChangesEvent, FileChangeType, IFileService } from 'vs/platform/files/common/files';
../../../../../src/vs/workbench/parts/debug/electron-browser/debugService.ts:110:               @IFileService private readonly fileService: IFileService,

../../../../../src/vs/workbench/parts/execution/electron-browser/execution.contribution.ts:23:import { IFileService } from 'vs/platform/files/common/files';
../../../../../src/vs/workbench/parts/execution/electron-browser/execution.contribution.ts:88:          const fileService = accessor.get(IFileService);

../../../../../src/vs/workbench/parts/extensions/electron-browser/extensionsActions.ts:26:import { IFileService, IContent } from 'vs/platform/files/common/files';
../../../../../src/vs/workbench/parts/extensions/electron-browser/extensionsActions.ts:1645:            @IFileService private readonly fileService: IFileService,
../../../../../src/vs/workbench/parts/extensions/electron-browser/extensionsActions.ts:1811:            @IFileService fileService: IFileService,
../../../../../src/vs/workbench/parts/extensions/electron-browser/extensionsActions.ts:1852:            @IFileService fileService: IFileService,
../../../../../src/vs/workbench/parts/extensions/electron-browser/extensionsActions.ts:1897:            @IFileService fileService: IFileService,
../../../../../src/vs/workbench/parts/extensions/electron-browser/extensionsActions.ts:1980:            @IFileService fileService: IFileService,
../../../../../src/vs/workbench/parts/extensions/electron-browser/extensionsActions.ts:2199:            @IFileService private readonly fileService: IFileService,

../../../../../src/vs/workbench/parts/extensions/electron-browser/extensionTipsService.ts:24:import { IFileService } from 'vs/platform/files/common/files';
../../../../../src/vs/workbench/parts/extensions/electron-browser/extensionTipsService.ts:99:           @IFileService private readonly fileService: IFileService,

../../../../../src/vs/workbench/parts/extensions/node/extensionsWorkbenchService.ts:36:import { IFileService } from 'vs/platform/files/common/files';
../../../../../src/vs/workbench/parts/extensions/node/extensionsWorkbenchService.ts:54:         private fileService: IFileService
../../../../../src/vs/workbench/parts/extensions/node/extensionsWorkbenchService.ts:384:                @IFileService private readonly fileService: IFileService

../../../../../src/vs/workbench/parts/extensions/test/electron-browser/extensionsTipsService.test.ts:29:import { IFileService } from 'vs/platform/files/common/files';
../../../../../src/vs/workbench/parts/extensions/test/electron-browser/extensionsTipsService.test.ts:281:               instantiationService.stub(IFileService, new FileService(workspaceService, TestEnvironmentService, new TestTextResourceConfigurationService(), new TestConfigurationService(), new TestLifecycleService(), new TestStorageService(), new TestNotificationService(), { disableWatcher: true }));

../../../../../src/vs/workbench/parts/files/browser/editors/binaryFileEditor.ts:15:import { IFileService } from 'vs/platform/files/common/files';
../../../../../src/vs/workbench/parts/files/browser/editors/binaryFileEditor.ts:29:             @IFileService fileService: IFileService,

../../../../../src/vs/workbench/parts/files/browser/editors/fileEditorTracker.ts:12:import { FileOperationEvent, FileOperation, IFileService, FileChangeType, FileChangesEvent } from 'vs/platform/files/common/files';
../../../../../src/vs/workbench/parts/files/browser/editors/fileEditorTracker.ts:43:            @IFileService private readonly fileService: IFileService,

../../../../../src/vs/workbench/parts/files/browser/editors/textFileEditor.ts:18:import { FileOperationError, FileOperationResult, FileChangesEvent, IFileService, FALLBACK_MAX_MEMORY_SIZE_MB, MIN_MAX_MEMORY_SIZE_MB } from 'vs/platform/files/common/files';
../../../../../src/vs/workbench/parts/files/browser/editors/textFileEditor.ts:45:               @IFileService private readonly fileService: IFileService,

../../../../../src/vs/workbench/parts/files/common/explorerModel.ts:11:import { IFileStat, IFileService } from 'vs/platform/files/common/files';
../../../../../src/vs/workbench/parts/files/common/explorerModel.ts:245:        fetchChildren(fileService: IFileService): Promise<ExplorerItem[]> {

../../../../../src/vs/workbench/parts/files/common/files.ts:9:import { IFilesConfiguration, FileChangeType, IFileService } from 'vs/platform/files/common/files';
../../../../../src/vs/workbench/parts/files/common/files.ts:151:                @IFileService private readonly fileService: IFileService,

../../../../../src/vs/workbench/parts/files/electron-browser/explorerService.ts:12:import { FileOperationEvent, FileOperation, IFileStat, IFileService, FileChangesEvent, FILES_EXCLUDE_CONFIG, FileChangeType, IResolveFileOptions } from 'vs/platform/files/common/files';
../../../../../src/vs/workbench/parts/files/electron-browser/explorerService.ts:44:             @IFileService private fileService: IFileService,

../../../../../src/vs/workbench/parts/files/electron-browser/fileActions.ts:19:import { IFileService, AutoSaveConfiguration } from 'vs/platform/files/common/files';
../../../../../src/vs/workbench/parts/files/electron-browser/fileActions.ts:108:                @IFileService private fileService: IFileService,
../../../../../src/vs/workbench/parts/files/electron-browser/fileActions.ts:162:                @IFileService private fileService: IFileService,
../../../../../src/vs/workbench/parts/files/electron-browser/fileActions.ts:235:                @IFileService private readonly fileService: IFileService,
../../../../../src/vs/workbench/parts/files/electron-browser/fileActions.ts:443:                @IFileService private fileService: IFileService,
../../../../../src/vs/workbench/parts/files/electron-browser/fileActions.ts:963:                @IFileService private readonly fileService: IFileService

../../../../../src/vs/workbench/parts/files/electron-browser/fileCommands.ts:23:import { IFileService } from 'vs/platform/files/common/files';
../../../../../src/vs/workbench/parts/files/electron-browser/fileCommands.ts:98:        fileService: IFileService,
../../../../../src/vs/workbench/parts/files/electron-browser/fileCommands.ts:270:               const fileService = accessor.get(IFileService);
../../../../../src/vs/workbench/parts/files/electron-browser/fileCommands.ts:493:               return save(resource, true, undefined, editorService, accessor.get(IFileService), accessor.get(IUntitledEditorService), accessor.get(ITextFileService), accessor.get(IEditorGroupsService));
../../../../../src/vs/workbench/parts/files/electron-browser/fileCommands.ts:508:                       return save(resources[0], false, undefined, editorService, accessor.get(IFileService), accessor.get(IUntitledEditorService), accessor.get(ITextFileService), accessor.get(IEditorGroupsService));
../../../../../src/vs/workbench/parts/files/electron-browser/fileCommands.ts:525:                       return save(resource, false, { skipSaveParticipants: true }, editorService, accessor.get(IFileService), accessor.get(IUntitledEditorService), accessor.get(ITextFileService), accessor.get(IEditorGroupsService));
../../../../../src/vs/workbench/parts/files/electron-browser/fileCommands.ts:548:                       const fileService = accessor.get(IFileService);

../../../../../src/vs/workbench/parts/files/electron-browser/views/explorerViewer.ts:12:import { IFileService, FileKind, IFileStat, FileOperationError, FileOperationResult } from 'vs/platform/files/common/files';
../../../../../src/vs/workbench/parts/files/electron-browser/views/explorerViewer.ts:70:                @IFileService private fileService: IFileService
../../../../../src/vs/workbench/parts/files/electron-browser/views/explorerViewer.ts:425:               @IFileService private fileService: IFileService,

../../../../../src/vs/workbench/parts/files/test/browser/fileEditorTracker.test.ts:14:import { FileChangesEvent, FileChangeType, IFileService, snapshotToString } from 'vs/platform/files/common/files';
../../../../../src/vs/workbench/parts/files/test/browser/fileEditorTracker.test.ts:28:          @IFileService public fileService: TestFileService

../../../../../src/vs/workbench/parts/localizations/electron-browser/localizationsActions.ts:8:import { IFileService } from 'vs/platform/files/common/files';
../../../../../src/vs/workbench/parts/localizations/electron-browser/localizationsActions.ts:31:                @IFileService private readonly fileService: IFileService,

../../../../../src/vs/workbench/parts/output/electron-browser/outputServices.ts:29:import { IFileService } from 'vs/platform/files/common/files';
../../../../../src/vs/workbench/parts/output/electron-browser/outputServices.ts:95:             protected fileService: IFileService,
../../../../../src/vs/workbench/parts/output/electron-browser/outputServices.ts:182:            @IFileService fileService: IFileService,
../../../../../src/vs/workbench/parts/output/electron-browser/outputServices.ts:292:            private readonly fileService: IFileService
../../../../../src/vs/workbench/parts/output/electron-browser/outputServices.ts:348:            @IFileService fileService: IFileService,

../../../../../src/vs/workbench/parts/search/browser/openFileHandler.ts:33:import { IFileService } from 'vs/platform/files/common/files';
../../../../../src/vs/workbench/parts/search/browser/openFileHandler.ts:128:            @IFileService private readonly fileService: IFileService,

../../../../../src/vs/workbench/parts/search/browser/searchView.ts:34:import { FileChangesEvent, FileChangeType, IFileService } from 'vs/platform/files/common/files';
../../../../../src/vs/workbench/parts/search/browser/searchView.ts:173:         @IFileService private readonly fileService: IFileService,

../../../../../src/vs/workbench/parts/search/electron-browser/search.contribution.ts:27:import { IFileService } from 'vs/platform/files/common/files';
../../../../../src/vs/workbench/parts/search/electron-browser/search.contribution.ts:346:       const fileService = accessor.get(IFileService);

../../../../../src/vs/workbench/parts/snippets/electron-browser/configureSnippets.ts:21:import { IFileService } from 'vs/platform/files/common/files';
../../../../../src/vs/workbench/parts/snippets/electron-browser/configureSnippets.ts:123:async function createGlobalSnippetFile(defaultPath: URI, windowService: IWindowService, notificationService: INotificationService, fileService: IFileService, opener: IOpenerService) {
../../../../../src/vs/workbench/parts/snippets/electron-browser/configureSnippets.ts:166:async function createLanguageSnippetFile(pick: ISnippetPick, fileService: IFileService) {
../../../../../src/vs/workbench/parts/snippets/electron-browser/configureSnippets.ts:200:       const fileService = accessor.get(IFileService);

../../../../../src/vs/workbench/parts/snippets/electron-browser/snippetsFile.ts:15:import { IFileService } from 'vs/platform/files/common/files';
../../../../../src/vs/workbench/parts/snippets/electron-browser/snippetsFile.ts:153:            private readonly _fileService: IFileService

../../../../../src/vs/workbench/parts/snippets/electron-browser/snippetsService.ts:19:import { FileChangeType, IFileService } from 'vs/platform/files/common/files';
../../../../../src/vs/workbench/parts/snippets/electron-browser/snippetsService.ts:117:function watch(service: IFileService, resource: URI, callback: (type: FileChangeType, resource: URI) => any): IDisposable {
../../../../../src/vs/workbench/parts/snippets/electron-browser/snippetsService.ts:147:         @IFileService private readonly _fileService: IFileService,

../../../../../src/vs/workbench/parts/stats/node/workspaceStats.ts:10:import { IFileService, IFileStat, IResolveFileResult } from 'vs/platform/files/common/files';
../../../../../src/vs/workbench/parts/stats/node/workspaceStats.ts:196:export function getHashedRemotesFromUri(workspaceUri: URI, fileService: IFileService, stripEndingDotGit: boolean = false): Promise<string[]> {
../../../../../src/vs/workbench/parts/stats/node/workspaceStats.ts:214:         @IFileService private readonly fileService: IFileService,

../../../../../src/vs/workbench/parts/tasks/electron-browser/task.contribution.ts:37:import { IFileService, IFileStat } from 'vs/platform/files/common/files';
../../../../../src/vs/workbench/parts/tasks/electron-browser/task.contribution.ts:472:          @IFileService private readonly fileService: IFileService,

../../../../../src/vs/workbench/parts/tasks/node/processRunnerDetector.ts:13:import { IFileService } from 'vs/platform/files/common/files';
../../../../../src/vs/workbench/parts/tasks/node/processRunnerDetector.ts:142:  private fileService: IFileService;
../../../../../src/vs/workbench/parts/tasks/node/processRunnerDetector.ts:151:  constructor(workspaceFolder: IWorkspaceFolder, fileService: IFileService, contextService: IWorkspaceContextService, configurationResolverService: IConfigurationResolverService, config: TaskConfig.ExternalTaskRunnerConfiguration | null = null) {

../../../../../src/vs/workbench/parts/webview/electron-browser/webviewElement.ts:11:import { IFileService } from 'vs/platform/files/common/files';
../../../../../src/vs/workbench/parts/webview/electron-browser/webviewElement.ts:50:            private readonly _fileService: IFileService,
../../../../../src/vs/workbench/parts/webview/electron-browser/webviewElement.ts:245:           @IFileService fileService: IFileService,

../../../../../src/vs/workbench/parts/webview/electron-browser/webviewProtocols.ts:10:import { IFileService } from 'vs/platform/files/common/files';
../../../../../src/vs/workbench/parts/webview/electron-browser/webviewProtocols.ts:18:function resolveContent(fileService: IFileService, resource: URI, mime: string, callback: any): void {
../../../../../src/vs/workbench/parts/webview/electron-browser/webviewProtocols.ts:33:  fileService: IFileService,

../../../../../src/vs/workbench/parts/welcome/page/electron-browser/welcomePage.ts:42:import { IFileService } from 'vs/platform/files/common/files';
../../../../../src/vs/workbench/parts/welcome/page/electron-browser/welcomePage.ts:58:          @IFileService fileService: IFileService,

../../../../../src/vs/workbench/services/backup/node/backupFileService.ts:12:import { IFileService, ITextSnapshot } from 'vs/platform/files/common/files';
../../../../../src/vs/workbench/services/backup/node/backupFileService.ts:121:          @IFileService private readonly fileService: IFileService

../../../../../src/vs/workbench/services/bulkEdit/electron-browser/bulkEditService.ts:18:import { IFileService } from 'vs/platform/files/common/files';
../../../../../src/vs/workbench/services/bulkEdit/electron-browser/bulkEditService.ts:29:       static start(fileService: IFileService): Recording {
../../../../../src/vs/workbench/services/bulkEdit/electron-browser/bulkEditService.ts:241:              @IFileService private readonly _fileService: IFileService,
../../../../../src/vs/workbench/services/bulkEdit/electron-browser/bulkEditService.ts:380:              @IFileService private readonly _fileService: IFileService,

../../../../../src/vs/workbench/services/configuration/node/configuration.ts:16:import { FileChangeType, FileChangesEvent, IContent, IFileService } from 'vs/platform/files/common/files';
../../../../../src/vs/workbench/services/configuration/node/configuration.ts:42:        private _fileService: IFileService | null = null;
../../../../../src/vs/workbench/services/configuration/node/configuration.ts:55:        adopt(fileService: IFileService): Promise<boolean> {
../../../../../src/vs/workbench/services/configuration/node/configuration.ts:217:       constructor(private fileService: IFileService, from?: AbstractWorkspaceConfiguration) {
../../../../../src/vs/workbench/services/configuration/node/configuration.ts:462:       constructor(folder: URI, private configFolderRelativePath: string, workbenchState: WorkbenchState, private fileService: IFileService, from?: AbstractFolderConfiguration) {
../../../../../src/vs/workbench/services/configuration/node/configuration.ts:616:               fileService?: IFileService
../../../../../src/vs/workbench/services/configuration/node/configuration.ts:646:       adopt(fileService: IFileService): Promise<boolean> {
../../../../../src/vs/workbench/services/configuration/node/configuration.ts:659:       private adoptFromCachedConfiguration(fileService: IFileService): Promise<boolean> {
../../../../../src/vs/workbench/services/configuration/node/configuration.ts:670:       private adoptFromNodeBasedConfiguration(fileService: IFileService): Promise<boolean> {

../../../../../src/vs/workbench/services/configuration/node/configurationEditingService.ts:24:import { IFileService } from 'vs/platform/files/common/files';
../../../../../src/vs/workbench/services/configuration/node/configurationEditingService.ts:128:         @IFileService private readonly fileService: IFileService,

../../../../../src/vs/workbench/services/configuration/node/configurationService.ts:18:import { IFileService } from 'vs/platform/files/common/files';
../../../../../src/vs/workbench/services/configuration/node/configurationService.ts:67: private fileService: IFileService;
../../../../../src/vs/workbench/services/configuration/node/configurationService.ts:303:        acquireFileService(fileService: IFileService): void {

../../../../../src/vs/workbench/services/configuration/node/jsonEditingService.ts:19:import { IFileService } from 'vs/platform/files/common/files';
../../../../../src/vs/workbench/services/configuration/node/jsonEditingService.ts:31:           @IFileService private readonly fileService: IFileService,

../../../../../src/vs/workbench/services/configuration/test/electron-browser/configurationEditingService.test.ts:25:import { IFileService } from 'vs/platform/files/common/files';
../../../../../src/vs/workbench/services/configuration/test/electron-browser/configurationEditingService.test.ts:106:                   instantiationService.stub(IFileService, new FileService(workspaceService, TestEnvironmentService, new TestTextResourceConfigurationService(), new TestConfigurationService(), new TestLifecycleService(), new TestStorageService(), new TestNotificationService(), { disableWatcher: true }));

../../../../../src/vs/workbench/services/configuration/test/electron-browser/configurationService.test.ts:22:import { IFileService, FileChangesEvent, FileChangeType } from 'vs/platform/files/common/files';
../../../../../src/vs/workbench/services/configuration/test/electron-browser/configurationService.test.ts:165:                                  instantiationService.stub IFileService, fileService);
../../../../../src/vs/workbench/services/configuration/test/electron-browser/configurationService.test.ts:299:                          instantiationService.get(IFileService).updateContent(testObject.getWorkspace().configuration, JSON.stringify(workspace, null, '\t'))
../../../../../src/vs/workbench/services/configuration/test/electron-browser/configurationService.test.ts:433:                                  instantiationService.stub IFileService, fileService);
../../../../../src/vs/workbench/services/configuration/test/electron-browser/configurationService.test.ts:688:                                  instantiationService.stub IFileService, fileService);
../../../../../src/vs/workbench/services/configuration/test/electron-browser/configurationService.test.ts:966:                                  instantiationService.stub IFileService, fileService);

../../../../../src/vs/workbench/services/editor/browser/editorService.ts:14:import { IFileService } from 'vs/platform/files/common/files';
../../../../../src/vs/workbench/services/editor/browser/editorService.ts:65:            @IFileService private readonly fileService: IFileService,
../../../../../src/vs/workbench/services/editor/browser/editorService.ts:612:           @IFileService fileService: IFileService,

../../../../../src/vs/workbench/services/files/electron-browser/fileService.ts:11:import { isParent, FileOperation, FileOperationEvent, IContent, IFileService, IResolveFileOptions, IResolveFileResult, IResolveContentOptions, IFileStat, IStreamContent, FileOperationError, FileOperationResult, IUpdateContentOptions, FileChangeType, FileChangesEvent, ICreateFileOptions, IContentData, ITextSnapshot, IFilesConfiguration, IFileSystemProviderRegistrationEvent, IFileSystemProvider } from 'vs/platform/files/common/files';
../../../../../src/vs/workbench/services/files/electron-browser/fileService.ts:46:export interface IFileServiceTestOptions {
../../../../../src/vs/workbench/services/files/electron-browser/fileService.ts:51:export class FileService extends Disposable implements IFileService {
../../../../../src/vs/workbench/services/files/electron-browser/fileService.ts:88:              private options: IFileServiceTestOptions = Object.create(null)

../../../../../src/vs/workbench/services/history/electron-browser/history.ts:13:import { FileChangesEvent, IFileService, FileChangeType, FILES_EXCLUDE_CONFIG } from 'vs/platform/files/common/files';
../../../../../src/vs/workbench/services/history/electron-browser/history.ts:137:               @IFileService private readonly fileService: IFileService,

../../../../../src/vs/workbench/services/keybinding/common/keybindingEditing.ts:22:import { IFileService } from 'vs/platform/files/common/files';
../../../../../src/vs/workbench/services/keybinding/common/keybindingEditing.ts:52:             @IFileService private readonly fileService: IFileService,

../../../../../src/vs/workbench/services/keybinding/test/electron-browser/keybindingEditing.test.ts:27:import { IFileService } from 'vs/platform/files/common/files';
../../../../../src/vs/workbench/services/keybinding/test/electron-browser/keybindingEditing.test.ts:87:                 instantiationService.stub(IFileService, new FileService(

../../../../../src/vs/workbench/services/preferences/browser/preferencesService.ts:24:import { FileOperationError, FileOperationResult, IFileService } from 'vs/platform/files/common/files';
../../../../../src/vs/workbench/services/preferences/browser/preferencesService.ts:60:          @IFileService private readonly fileService: IFileService,

../../../../../src/vs/workbench/services/textfile/common/textFileEditorModel.ts:19:import { IFileService, IFileStat, FileOperationError, FileOperationResult, CONTENT_CHANGE_EVENT_BUFFER_DELAY, FileChangesEvent, FileChangeType } from 'vs/platform/files/common/files';
../../../../../src/vs/workbench/services/textfile/common/textFileEditorModel.ts:84:             @IFileService private readonly fileService: IFileService,

../../../../../src/vs/workbench/services/textfile/common/textFileService.ts:19:import { IFileService, IResolveContentOptions, IFilesConfiguration, FileOperationError, FileOperationResult, AutoSaveConfiguration, HotExitConfiguration } from 'vs/platform/files/common/files';
../../../../../src/vs/workbench/services/textfile/common/textFileService.ts:70:         protected fileService: IFileService,

../../../../../src/vs/workbench/services/textfile/electron-browser/textFileService.ts:15:import { IFileService, IResolveContentOptions } from 'vs/platform/files/common/files';
../../../../../src/vs/workbench/services/textfile/electron-browser/textFileService.ts:37:               @IFileService fileService: IFileService,

../../../../../src/vs/workbench/services/textfile/test/textFileEditorModel.test.ts:14:import { FileOperationResult, FileOperationError, IFileService, snapshotToString } from 'vs/platform/files/common/files';
../../../../../src/vs/workbench/services/textfile/test/textFileEditorModel.test.ts:19:  constructor(@ITextFileService public textFileService: TestTextFileService, @IModelService public modelService: IModelService, @IFileService public fileService: TestFileService) {

../../../../../src/vs/workbench/services/textfile/test/textFileEditorModelManager.test.ts:13:import { IFileService, FileChangesEvent, FileChangeType } from 'vs/platform/files/common/files';
../../../../../src/vs/workbench/services/textfile/test/textFileEditorModelManager.test.ts:26:           @IFileService public fileService: TestFileService,

../../../../../src/vs/workbench/services/textfile/test/textFileService.test.ts:19:import { HotExitConfiguration, IFileService } from 'vs/platform/files/common/files';
../../../../../src/vs/workbench/services/textfile/test/textFileService.test.ts:34:              @IFileService public fileService: TestFileService

../../../../../src/vs/workbench/services/textMate/electron-browser/TMSyntax.ts:19:import { IFileService } from 'vs/platform/files/common/files';
../../../../../src/vs/workbench/services/textMate/electron-browser/TMSyntax.ts:159:             @IFileService private readonly _fileService: IFileService,

../../../../../src/vs/workbench/services/textmodelResolver/common/textModelResolverService.ts:18:import { IFileService } from 'vs/platform/files/common/files';
../../../../../src/vs/workbench/services/textmodelResolver/common/textModelResolverService.ts:28:               @IFileService private readonly fileService: IFileService

../../../../../src/vs/workbench/services/themes/electron-browser/colorThemeData.ts:21:import { IFileService } from 'vs/platform/files/common/files';
../../../../../src/vs/workbench/services/themes/electron-browser/colorThemeData.ts:138: public ensureLoaded(fileService: IFileService): Promise<void> {
../../../../../src/vs/workbench/services/themes/electron-browser/colorThemeData.ts:142: public reload(fileService: IFileService): Promise<void> {
../../../../../src/vs/workbench/services/themes/electron-browser/colorThemeData.ts:146: private load(fileService: IFileService): Promise<void> {
../../../../../src/vs/workbench/services/themes/electron-browser/colorThemeData.ts:285:function _loadColorTheme(fileService: IFileService, themeLocation: URI, resultRules: ITokenColorizationRule[], resultColors: IColorMap): Promise<any> {
../../../../../src/vs/workbench/services/themes/electron-browser/colorThemeData.ts:342:function _loadSyntaxTokens(fileService: IFileService, themeLocation: URI, resultRules: ITokenColorizationRule[], resultColors: IColorMap): Promise<any> {

../../../../../src/vs/workbench/services/themes/electron-browser/fileIconThemeData.ts:12:import { IFileService } from 'vs/platform/files/common/files';
../../../../../src/vs/workbench/services/themes/electron-browser/fileIconThemeData.ts:32:       public ensureLoaded(fileService: IFileService): Promise<string> {
../../../../../src/vs/workbench/services/themes/electron-browser/fileIconThemeData.ts:36:       public reload(fileService: IFileService): Promise<string> {
../../../../../src/vs/workbench/services/themes/electron-browser/fileIconThemeData.ts:40:       private load(fileService: IFileService): Promise<string> {
../../../../../src/vs/workbench/services/themes/electron-browser/fileIconThemeData.ts:183:function _loadIconThemeDocument(fileService: IFileService, location: URI): Promise<IconThemeDocument> {

../../../../../src/vs/workbench/services/themes/electron-browser/workbenchThemeService.ts:28:import { IFileService, FileChangeType } from 'vs/platform/files/common/files';
../../../../../src/vs/workbench/services/themes/electron-browser/workbenchThemeService.ts:73:   private fileService: IFileService;
../../../../../src/vs/workbench/services/themes/electron-browser/workbenchThemeService.ts:198:  acquireFileService(fileService: IFileService): void {

../../../../../src/vs/workbench/test/electron-browser/api/mainThreadDocumentsAndEditors.test.ts:21:import { IFileService } from 'vs/platform/files/common/files';
../../../../../src/vs/workbench/test/electron-browser/api/mainThreadDocumentsAndEditors.test.ts:58:             const fileService = new class extends mock<IFileService>() {

../../../../../src/vs/workbench/test/workbenchTestServices.ts:29:import { FileOperationEvent, IFileService, IResolveContentOptions, FileOperationError, IFileStat, IResolveFileResult, FileChangesEvent, IResolveFileOptions, IContent, IUpdateContentOptions, IStreamContent, ICreateFileOptions, ITextSnapshot, IResourceEncodings } from 'vs/platform/files/common/files';
../../../../../src/vs/workbench/test/workbenchTestServices.ts:183:              @IFileService fileService: IFileService,
../../../../../src/vs/workbench/test/workbenchTestServices.ts:262:      instantiationService.stub(IFileService, new TestFileService());
../../../../../src/vs/workbench/test/workbenchTestServices.ts:761:export class TestFileService implements IFileService {

@bpasero
Copy link
Member

bpasero commented Mar 25, 2019

via deab785

The remaining task to make file read/write use the new service is tracked via #34840

@bpasero bpasero closed this as completed Mar 25, 2019
@bpasero bpasero added bug Issue identified by VS Code Team member as probable bug and removed feature-request Request for new features or functionality labels Mar 25, 2019
@jrieken jrieken added the verified Verification succeeded label Mar 28, 2019
@vscodebot vscodebot bot locked and limited conversation to collaborators May 9, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug file-io File I/O remote Remote system operations issues verified Verification succeeded
Projects
None yet
Development

No branches or pull requests

3 participants