mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 18:46:40 -05:00
Merge from vscode 27ada910e121e23a6d95ecca9cae595fb98ab568
This commit is contained in:
@@ -9,6 +9,7 @@ import { LanguageId, LanguageIdentifier } from 'vs/editor/common/modes';
|
||||
import { LanguageConfigurationRegistry } from 'vs/editor/common/modes/languageConfigurationRegistry';
|
||||
import { ILanguageExtensionPoint } from 'vs/editor/common/services/modeService';
|
||||
import { Registry } from 'vs/platform/registry/common/platform';
|
||||
import { IDisposable } from 'vs/base/common/lifecycle';
|
||||
|
||||
// Define extension point ids
|
||||
export const Extensions = {
|
||||
@@ -30,9 +31,19 @@ export class EditorModesRegistry {
|
||||
|
||||
// --- languages
|
||||
|
||||
public registerLanguage(def: ILanguageExtensionPoint): void {
|
||||
public registerLanguage(def: ILanguageExtensionPoint): IDisposable {
|
||||
this._languages.push(def);
|
||||
this._onDidChangeLanguages.fire(undefined);
|
||||
return {
|
||||
dispose: () => {
|
||||
for (let i = 0, len = this._languages.length; i < len; i++) {
|
||||
if (this._languages[i] === def) {
|
||||
this._languages.splice(i, 1);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
public setDynamicLanguages(def: ILanguageExtensionPoint[]): void {
|
||||
this._dynamicLanguages = def;
|
||||
|
||||
Reference in New Issue
Block a user