Skip to content

Commit fa7ce99

Browse files
author
Benjamin Pasero
committed
more fixes for microsoft#8578
1 parent 4d6ecd0 commit fa7ce99

6 files changed

Lines changed: 25 additions & 23 deletions

File tree

File renamed without changes.

src/vs/workbench/electron-browser/shell.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import {dispose, IDisposable, Disposables} from 'vs/base/common/lifecycle';
1717
import errors = require('vs/base/common/errors');
1818
import {ContextViewService} from 'vs/platform/contextview/browser/contextViewService';
1919
import timer = require('vs/base/common/timer');
20-
import {Workbench} from 'vs/workbench/browser/workbench';
20+
import {Workbench} from 'vs/workbench/electron-browser/workbench';
2121
import {Storage, inMemoryLocalStorageInstance} from 'vs/workbench/common/storage';
2222
import {ITelemetryService, NullTelemetryService} from 'vs/platform/telemetry/common/telemetry';
2323
import {ITelemetryAppenderChannel, TelemetryAppenderClient} from 'vs/platform/telemetry/common/telemetryIpc';
File renamed without changes.

src/vs/workbench/parts/files/browser/textFileServices.ts

Lines changed: 2 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ import {ITelemetryService} from 'vs/platform/telemetry/common/telemetry';
2121
import {IDisposable, dispose} from 'vs/base/common/lifecycle';
2222
import {IWorkbenchEditorService} from 'vs/workbench/services/editor/common/editorService';
2323
import {IEditorGroupService} from 'vs/workbench/services/group/common/groupService';
24-
import {ModelBuilder} from 'vs/editor/node/model/modelBuilder';
2524
import {IModelService} from 'vs/editor/common/services/modelService';
2625

2726
/**
@@ -49,7 +48,7 @@ export abstract class TextFileService implements ITextFileService {
4948
@IEditorGroupService private editorGroupService: IEditorGroupService,
5049
@IEventService private eventService: IEventService,
5150
@IFileService protected fileService: IFileService,
52-
@IModelService private modelService: IModelService
51+
@IModelService protected modelService: IModelService
5352
) {
5453
this.listenerToUnbind = [];
5554
this._onAutoSaveConfigurationChange = new Emitter<IAutoSaveConfiguration>();
@@ -64,23 +63,7 @@ export abstract class TextFileService implements ITextFileService {
6463
this.telemetryService.publicLog('autoSave', this.getAutoSaveConfiguration());
6564
}
6665

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-
}
66+
public abstract resolveTextContent(resource: URI, options?: IResolveContentOptions): TPromise<IRawTextContent>;
8467

8568
public get onAutoSaveConfigurationChange(): Event<IAutoSaveConfiguration> {
8669
return this._onAutoSaveConfigurationChange.event;

src/vs/workbench/parts/files/electron-browser/textFileServices.ts

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@ import {ConfirmResult} from 'vs/workbench/common/editor';
1616
import {IEventService} from 'vs/platform/event/common/event';
1717
import {TextFileService as AbstractTextFileService} from 'vs/workbench/parts/files/browser/textFileServices';
1818
import {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';
2020
import {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';
2222
import {BinaryEditorModel} from 'vs/workbench/common/editor/binaryEditorModel';
2323
import {IInstantiationService} from 'vs/platform/instantiation/common/instantiation';
2424
import {IWorkspaceContextService} from 'vs/workbench/services/workspace/common/contextService';
@@ -30,6 +30,7 @@ import {IWorkbenchEditorService} from 'vs/workbench/services/editor/common/edito
3030
import {IWindowService} from 'vs/workbench/services/window/electron-browser/windowService';
3131
import {IEditorGroupService} from 'vs/workbench/services/group/common/groupService';
3232
import {IModelService} from 'vs/editor/common/services/modelService';
33+
import {ModelBuilder} from 'vs/editor/node/model/modelBuilder';
3334

3435
export 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

src/vs/workbench/workbench.main.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ import 'vs/workbench/parts/output/browser/output.contribution';
5454

5555
import 'vs/workbench/parts/terminal/electron-browser/terminal.contribution';
5656

57-
import 'vs/workbench/browser/workbench';
57+
import 'vs/workbench/electron-browser/workbench';
5858

5959
import 'vs/workbench/parts/tasks/electron-browser/task.contribution';
6060

0 commit comments

Comments
 (0)