提交 3843179a 编写于 作者: J Johannes Rieken

make sure to resolve editor input properly, fixes #2634

上级 40882b06
...@@ -17,7 +17,7 @@ import {Position} from 'vs/platform/editor/common/editor'; ...@@ -17,7 +17,7 @@ import {Position} from 'vs/platform/editor/common/editor';
import {ITelemetryService} from 'vs/platform/telemetry/common/telemetry'; import {ITelemetryService} from 'vs/platform/telemetry/common/telemetry';
import {IStorageService, StorageEventType, StorageScope} from 'vs/platform/storage/common/storage'; import {IStorageService, StorageEventType, StorageScope} from 'vs/platform/storage/common/storage';
import {IWorkbenchEditorService} from 'vs/workbench/services/editor/common/editorService'; import {IWorkbenchEditorService} from 'vs/workbench/services/editor/common/editorService';
import {ResourceEditorModel} from 'vs/workbench/common/editor/resourceEditorModel'; import {BaseTextEditorModel} from 'vs/workbench/common/editor/textEditorModel';
import {Preferences} from 'vs/workbench/common/constants'; import {Preferences} from 'vs/workbench/common/constants';
import {HtmlInput} from 'vs/workbench/parts/html/common/htmlInput'; import {HtmlInput} from 'vs/workbench/parts/html/common/htmlInput';
import {isLightTheme} from 'vs/platform/theme/common/themes'; import {isLightTheme} from 'vs/platform/theme/common/themes';
...@@ -137,8 +137,8 @@ export class HtmlPreviewPart extends BaseEditor { ...@@ -137,8 +137,8 @@ export class HtmlPreviewPart extends BaseEditor {
return TPromise.wrapError<void>('Invalid input'); return TPromise.wrapError<void>('Invalid input');
} }
return this._editorService.resolveEditorModel(input).then(model => { return this._editorService.resolveEditorModel({ resource: (<HtmlInput>input).getResource() }).then(model => {
if (model instanceof ResourceEditorModel) { if (model instanceof BaseTextEditorModel) {
this._model = model.textEditorModel this._model = model.textEditorModel
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册