提交 638ea3af 编写于 作者: J Johannes Rieken

snippets - static snippets should be TextMate

上级 aa6ddd89
...@@ -110,16 +110,16 @@ export class DefineKeybindingController implements editorCommon.IEditorContribut ...@@ -110,16 +110,16 @@ export class DefineKeybindingController implements editorCommon.IEditorContribut
let snippetText = [ let snippetText = [
'{', '{',
'\t"key": "' + keybinding + '",', '\t"key": "' + keybinding + '",',
'\t"command": "{{commandId}}",', '\t"command": "${1:commandId}",',
'\t"when": "{{editorTextFocus}}"', '\t"when": "${2:editorTextFocus}"',
'}{{}}' '}$0'
].join('\n'); ].join('\n');
let smartInsertInfo = SmartSnippetInserter.insertSnippet(this._editor.getModel(), this._editor.getPosition()); let smartInsertInfo = SmartSnippetInserter.insertSnippet(this._editor.getModel(), this._editor.getPosition());
snippetText = smartInsertInfo.prepend + snippetText + smartInsertInfo.append; snippetText = smartInsertInfo.prepend + snippetText + smartInsertInfo.append;
this._editor.setPosition(smartInsertInfo.position); this._editor.setPosition(smartInsertInfo.position);
SnippetController.get(this._editor).run(CodeSnippet.fromInternal(snippetText), 0, 0); SnippetController.get(this._editor).run(CodeSnippet.fromTextmate(snippetText), 0, 0);
} }
private _onModel(): void { private _onModel(): void {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册