mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-26 17:23:15 -05:00
Merge from master
This commit is contained in:
@@ -2,22 +2,31 @@
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
'use strict';
|
||||
|
||||
import { TPromise } from 'vs/base/common/winjs.base';
|
||||
import { MainContext, MainThreadLanguagesShape, IMainContext } from './extHost.protocol';
|
||||
import * as vscode from 'vscode';
|
||||
import { ExtHostDocuments } from 'vs/workbench/api/node/extHostDocuments';
|
||||
|
||||
export class ExtHostLanguages {
|
||||
|
||||
private _proxy: MainThreadLanguagesShape;
|
||||
private readonly _proxy: MainThreadLanguagesShape;
|
||||
private readonly _documents: ExtHostDocuments;
|
||||
|
||||
constructor(
|
||||
mainContext: IMainContext
|
||||
mainContext: IMainContext,
|
||||
documents: ExtHostDocuments
|
||||
) {
|
||||
this._proxy = mainContext.getProxy(MainContext.MainThreadLanguages);
|
||||
this._documents = documents;
|
||||
}
|
||||
|
||||
getLanguages(): TPromise<string[]> {
|
||||
getLanguages(): Thenable<string[]> {
|
||||
return this._proxy.$getLanguages();
|
||||
}
|
||||
|
||||
changeLanguage(uri: vscode.Uri, languageId: string): Thenable<vscode.TextDocument> {
|
||||
return this._proxy.$changeLanguage(uri, languageId).then(() => {
|
||||
return this._documents.getDocumentData(uri).document;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user