提交 f074a4cf 编写于 作者: E Erich Gamma

Enable emmet in jsx, tsx files #732

上级 35cc3550
......@@ -2,6 +2,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 {IPosition, Handler, ICommonCodeEditor} from 'vs/editor/common/editorCommon';
......@@ -18,7 +19,7 @@ export class EditorAccessor implements emmet.Editor {
lineStarts: number[] = null;
emmetSupportedModes = ['html', 'razor', 'css', 'less', 'sass', 'xml', 'xsl', 'jade', 'handlebars', '.hbs'];
emmetSupportedModes = ['html', 'razor', 'css', 'less', 'sass', 'xml', 'xsl', 'jade', 'handlebars', 'hbs', 'jsx', 'tsx'];
constructor(editor: ICommonCodeEditor) {
this.editor = editor;
......@@ -117,6 +118,9 @@ export class EditorAccessor implements emmet.Editor {
if (syntax === 'razor' || syntax === 'handlebars') { // treat like html
return 'html';
}
if (syntax === 'typescriptreact' || syntax == 'javascriptreact') { // treat like html
return 'jsx';
}
return syntax;
}
......@@ -191,4 +195,4 @@ export class EditorAccessor implements emmet.Editor {
let value = this.editor.getModel().getValue();
return strings.computeLineStarts(value);
}
}
}
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册