本文整理汇总了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'
});
}
示例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'
});
示例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'
});
示例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'
});
示例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'
});
示例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'
});
示例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'
});