@@ -16,9 +16,9 @@ import {ConfirmResult} from 'vs/workbench/common/editor';
1616import { IEventService } from 'vs/platform/event/common/event' ;
1717import { TextFileService as AbstractTextFileService } from 'vs/workbench/parts/files/browser/textFileServices' ;
1818import { CACHE , TextFileEditorModel } from 'vs/workbench/parts/files/common/editors/textFileEditorModel' ;
19- import { ITextFileOperationResult , AutoSaveMode } from 'vs/workbench/parts/files/common/files' ;
19+ import { ITextFileOperationResult , AutoSaveMode , IRawTextContent } from 'vs/workbench/parts/files/common/files' ;
2020import { IUntitledEditorService } from 'vs/workbench/services/untitled/common/untitledEditorService' ;
21- import { IFileService } from 'vs/platform/files/common/files' ;
21+ import { IFileService , IResolveContentOptions } from 'vs/platform/files/common/files' ;
2222import { BinaryEditorModel } from 'vs/workbench/common/editor/binaryEditorModel' ;
2323import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation' ;
2424import { IWorkspaceContextService } from 'vs/workbench/services/workspace/common/contextService' ;
@@ -30,6 +30,7 @@ import {IWorkbenchEditorService} from 'vs/workbench/services/editor/common/edito
3030import { IWindowService } from 'vs/workbench/services/window/electron-browser/windowService' ;
3131import { IEditorGroupService } from 'vs/workbench/services/group/common/groupService' ;
3232import { IModelService } from 'vs/editor/common/services/modelService' ;
33+ import { ModelBuilder } from 'vs/editor/node/model/modelBuilder' ;
3334
3435export class TextFileService extends AbstractTextFileService {
3536
@@ -63,6 +64,24 @@ export class TextFileService extends AbstractTextFileService {
6364 this . lifecycleService . onShutdown ( this . onShutdown , this ) ;
6465 }
6566
67+ public resolveTextContent ( resource : URI , options ?: IResolveContentOptions ) : TPromise < IRawTextContent > {
68+ return this . fileService . resolveStreamContent ( resource , options ) . then ( ( streamContent ) => {
69+ return ModelBuilder . fromStringStream ( streamContent . value , this . modelService . getCreationOptions ( ) ) . then ( ( res ) => {
70+ let r : IRawTextContent = {
71+ resource : streamContent . resource ,
72+ name : streamContent . name ,
73+ mtime : streamContent . mtime ,
74+ etag : streamContent . etag ,
75+ mime : streamContent . mime ,
76+ encoding : streamContent . encoding ,
77+ value : res . rawText ,
78+ valueLogicalHash : res . hash
79+ } ;
80+ return r ;
81+ } ) ;
82+ } ) ;
83+ }
84+
6685 public beforeShutdown ( ) : boolean | TPromise < boolean > {
6786
6887 // Dirty files need treatment on shutdown
0 commit comments