mainThreadLanguages.ts 1.1 KB
Newer Older
1 2 3 4 5 6
/*---------------------------------------------------------------------------------------------
 *  Copyright (c) Microsoft Corporation. All rights reserved.
 *  Licensed under the MIT License. See License.txt in the project root for license information.
 *--------------------------------------------------------------------------------------------*/
'use strict';

J
Johannes Rieken 已提交
7 8
import { TPromise } from 'vs/base/common/winjs.base';
import { IModeService } from 'vs/editor/common/services/modeService';
9 10
import { MainThreadLanguagesShape, MainContext, IExtHostContext } from '../node/extHost.protocol';
import { extHostNamedCustomer } from "vs/workbench/api/electron-browser/extHostCustomers";
11

12
@extHostNamedCustomer(MainContext.MainThreadLanguages)
13
export class MainThreadLanguages implements MainThreadLanguagesShape {
14 15 16 17

	private _modeService: IModeService;

	constructor(
18
		extHostContext: IExtHostContext,
19 20 21 22 23
		@IModeService modeService: IModeService
	) {
		this._modeService = modeService;
	}

24 25 26
	public dispose(): void {
	}

27
	$getLanguages(): TPromise<string[]> {
28 29 30
		return TPromise.as(this._modeService.getRegisteredModes());
	}
}