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


TypeScript ModesRegistry.registerCompatMode方法代码示例

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


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

示例1:

/*---------------------------------------------------------------------------------------------
 *  Copyright (c) Microsoft Corporation. All rights reserved.
 *  Licensed under the MIT License. See License.txt in the project root for license information.
 *--------------------------------------------------------------------------------------------*/
'use strict';

import {ModesRegistry} from 'vs/editor/common/modes/modesRegistry';

const register = false;
if (register) {
	ModesRegistry.registerCompatMode({
		id: 'markdown',
		extensions: ['.md', '.markdown', '.mdown', '.mkdn', '.mkd', '.mdwn', '.mdtxt', '.mdtext'],
		aliases: ['Markdown', 'markdown'],
		mimetypes: ['text/x-web-markdown'],
		moduleId: 'vs/languages/markdown/common/markdown',
		ctorName: 'MarkdownMode'
	});
}
开发者ID:DiLRandI,项目名称:vscode,代码行数:19,代码来源:markdown.contribution.ts

示例2:

/*---------------------------------------------------------------------------------------------
 *  Copyright (c) Microsoft Corporation. All rights reserved.
 *  Licensed under the MIT License. See License.txt in the project root for license information.
 *--------------------------------------------------------------------------------------------*/
'use strict';

import {ModesRegistry} from 'vs/editor/common/modes/modesRegistry';

ModesRegistry.registerCompatMode({
	id: 'php',
	extensions: ['.php', '.phtml', '.ctp'],
	aliases: ['PHP', 'php'],
	mimetypes: ['application/x-php'],
	moduleId: 'vs/languages/php/common/php',
	ctorName: 'PHPMode'
});
开发者ID:BMGburger,项目名称:vscode,代码行数:16,代码来源:php.contribution.ts

示例3:

/*---------------------------------------------------------------------------------------------
 *  Copyright (c) Microsoft Corporation. All rights reserved.
 *  Licensed under the MIT License. See License.txt in the project root for license information.
 *--------------------------------------------------------------------------------------------*/
'use strict';

import {ModesRegistry} from 'vs/editor/common/modes/modesRegistry';

// ----- Registration and Configuration --------------------------------------------------------

ModesRegistry.registerCompatMode({
	id: 'typescript',
	extensions: ['.ts'],
	aliases: ['TypeScript', 'ts', 'typescript'],
	mimetypes: ['text/typescript'],
	moduleId: 'vs/languages/typescript/common/mode',
	ctorName: 'TypeScriptMode'
});

ModesRegistry.registerCompatMode({
	id: 'javascript',
	extensions: ['.js', '.es6'],
	firstLine: '^#!.*\\bnode',
	filenames: ['jakefile'],
	aliases: ['JavaScript', 'javascript', 'js'],
	mimetypes: ['text/javascript'],
	moduleId: 'vs/languages/typescript/common/mode',
	ctorName: 'JavaScriptMode'
});
开发者ID:Janatbek,项目名称:vscode,代码行数:29,代码来源:typescript.contribution.ts

示例4:

/*---------------------------------------------------------------------------------------------
 *  Copyright (c) Microsoft Corporation. All rights reserved.
 *  Licensed under the MIT License. See License.txt in the project root for license information.
 *--------------------------------------------------------------------------------------------*/
'use strict';

// Load plain text in the main code

import 'vs/languages/plaintext/common/plaintext';
import {ModesRegistry} from 'vs/editor/common/modes/modesRegistry';

ModesRegistry.registerCompatMode({
	id: 'plaintext',
	extensions: ['.txt', '.gitignore'],
	aliases: ['Plain Text', 'text'],
	mimetypes: ['text/plain'],
	moduleId: 'vs/languages/plaintext/common/plaintext',
	ctorName: 'Mode'
});
开发者ID:ErickWendel,项目名称:vscode,代码行数:19,代码来源:plaintext.contribution.ts

示例5:

/*---------------------------------------------------------------------------------------------
 *  Copyright (c) Microsoft Corporation. All rights reserved.
 *  Licensed under the MIT License. See License.txt in the project root for license information.
 *--------------------------------------------------------------------------------------------*/
'use strict';

import {ModesRegistry} from 'vs/editor/common/modes/modesRegistry';

ModesRegistry.registerCompatMode({
	id: 'handlebars',
	extensions: ['.handlebars', '.hbs'],
	aliases: ['Handlebars', 'handlebars'],
	mimetypes: ['text/x-handlebars-template'],
	moduleId: 'vs/languages/handlebars/common/handlebars',
	ctorName: 'HandlebarsMode'
});
开发者ID:13572293130,项目名称:vscode,代码行数:16,代码来源:handlebars.contribution.ts

示例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';

import {ModesRegistry} from 'vs/editor/common/modes/modesRegistry';

ModesRegistry.registerCompatMode({
	id: 'razor',
	extensions: ['.cshtml'],
	aliases: ['Razor', 'razor'],
	mimetypes: ['text/x-cshtml'],
	moduleId: 'vs/languages/razor/common/razor',
	ctorName: 'RAZORMode'
});
开发者ID:13572293130,项目名称:vscode,代码行数:16,代码来源:razor.contribution.ts

示例7:

/*---------------------------------------------------------------------------------------------
 *  Copyright (c) Microsoft Corporation. All rights reserved.
 *  Licensed under the MIT License. See License.txt in the project root for license information.
 *--------------------------------------------------------------------------------------------*/
'use strict';

import {ModesRegistry} from 'vs/editor/common/modes/modesRegistry';

ModesRegistry.registerCompatMode({
	id: 'html',
	extensions: ['.html', '.htm', '.shtml', '.mdoc', '.jsp', '.asp', '.aspx', '.jshtm'],
	aliases: ['HTML', 'htm', 'html', 'xhtml'],
	mimetypes: ['text/html', 'text/x-jshtm', 'text/template', 'text/ng-template'],
	moduleId: 'vs/languages/html/common/html',
	ctorName: 'HTMLMode'
});
开发者ID:BMGburger,项目名称:vscode,代码行数:16,代码来源:html.contribution.ts


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