当前位置: 首页>>代码示例>>TypeScript>>正文


TypeScript ModesRegistry.getLanguages方法代码示例

本文整理汇总了TypeScript中vs/editor/common/modes/modesRegistry.ModesRegistry.getLanguages方法的典型用法代码示例。如果您正苦于以下问题:TypeScript ModesRegistry.getLanguages方法的具体用法?TypeScript ModesRegistry.getLanguages怎么用?TypeScript ModesRegistry.getLanguages使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在vs/editor/common/modes/modesRegistry.ModesRegistry的用法示例。


在下文中一共展示了ModesRegistry.getLanguages方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。

示例1: constructor

	constructor(useModesRegistry = true) {
		this._nextLanguageId = 1;
		this._languages = {};
		this._mimeTypesMap = {};
		this._nameMap = {};
		this._lowercaseNameMap = {};
		this._languageIds = [];

		if (useModesRegistry) {
			this._registerLanguages(ModesRegistry.getLanguages());
			ModesRegistry.onDidAddLanguages((m) => this._registerLanguages(m));
		}
	}
开发者ID:Chan-PH,项目名称:vscode,代码行数:13,代码来源:languagesRegistry.ts

示例2: _registerLanguages

	_registerLanguages(desc: ILanguageExtensionPoint[]): void {
		if (desc.length === 0) {
			return;
		}

		for (let i = 0; i < desc.length; i++) {
			this._registerLanguage(desc[i]);
		}

		// Rebuild fast path maps
		this._mimeTypesMap = {};
		this._nameMap = {};
		this._lowercaseNameMap = {};
		Object.keys(this._languages).forEach((langId) => {
			let language = this._languages[langId];
			if (language.name) {
				this._nameMap[language.name] = language.identifier;
			}
			language.aliases.forEach((alias) => {
				this._lowercaseNameMap[alias.toLowerCase()] = language.identifier;
			});
			language.mimetypes.forEach((mimetype) => {
				this._mimeTypesMap[mimetype] = language.identifier;
			});
		});

		Registry.as<IConfigurationRegistry>(Extensions.Configuration).registerOverrideIdentifiers(ModesRegistry.getLanguages().map(language => language.id));
	}
开发者ID:ramesius,项目名称:vscode,代码行数:28,代码来源:languagesRegistry.ts

示例3: getLanguages

export function getLanguages(): ILanguageExtensionPoint[] {
	let result: ILanguageExtensionPoint[] = [];
	result = result.concat(ModesRegistry.getLanguages());
	return result;
}
开发者ID:ramesius,项目名称:vscode,代码行数:5,代码来源:standaloneLanguages.ts


注:本文中的vs/editor/common/modes/modesRegistry.ModesRegistry.getLanguages方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。