debugEditorInputs.ts 1.7 KB
Newer Older
E
Erich Gamma 已提交
1 2 3 4 5 6 7 8
/*---------------------------------------------------------------------------------------------
 *  Copyright (c) Microsoft Corporation. All rights reserved.
 *  Licensed under the MIT License. See License.txt in the project root for license information.
 *--------------------------------------------------------------------------------------------*/

import { TPromise } from 'vs/base/common/winjs.base';
import mime = require('vs/base/common/mime');
import wbeditorcommon = require('vs/workbench/common/editor');
9
import strinput = require('vs/workbench/common/editor/stringEditorInput');
E
Erich Gamma 已提交
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49
import uri from 'vs/base/common/uri';
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';

export class DebugStringEditorInput extends strinput.StringEditorInput {

	constructor(
		name: string,
		private resourceUrl: uri,
		description: string,
		value: string,
		mimeType: string,
		singleton: boolean,
		@IInstantiationService instantiationService: IInstantiationService
	) {
		super(name, description, value, mimeType || mime.MIME_TEXT, singleton, instantiationService);
	}

	public getResource(): uri {
		return this.resourceUrl;
	}
}

export class ReplEditorInput extends wbeditorcommon.EditorInput {

	private static instance: ReplEditorInput;
	public static ID = 'workbench.editors.replEditorInput';
	public static NAME = 'Debug Console';

	public static getInstance(): ReplEditorInput {
		if (!ReplEditorInput.instance) {
			ReplEditorInput.instance = new ReplEditorInput();
		}

		return ReplEditorInput.instance;
	}

	public getId(): string {
		return ReplEditorInput.ID;
	}

I
isidor 已提交
50
	public getName(): string {
E
Erich Gamma 已提交
51 52 53
		return ReplEditorInput.NAME;
	}

I
isidor 已提交
54
	public resolve(refresh?: boolean): TPromise<wbeditorcommon.EditorModel> {
E
Erich Gamma 已提交
55 56 57
		return TPromise.as(null);
	}
}