Visual Studio上的打字稿片段 [英] Typescript Snippets on Visual Studio

查看:113
本文介绍了Visual Studio上的打字稿片段的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道你们中是否有人知道一种在Visual Studio中启用以下功能(隐藏设置或扩展名)的方法:

I would like to know if any of you guys know a way to enable the following feature on Visual Studio (either a hidden setting or an extension):

我习惯于在Visual Studio上进行JavaScript开发,如果输入以下内容: "if" ,它向我显示了一个弹出窗口("if语句的代码段").按ENTER,添加以下内容:

I'm used to javascript development on Visual Studio where if I type: "if" on the text editor, it shows me a popup ("code snippet for an if statement"). Pressing ENTER the following is added:

if (true) {

}

这不适用于打字稿文件!

This is not available for typescript files!

这些摘录非常有用,这只是一个简单的示例

These snippets are really useful and this is just a simple example

我缺少的另一个基本功能是括号自动完成" .

Another basic feature I'm missing is "braces auto completion".

我不确定是否有启用它的方法,但确实希望这些基本功能可用.

I am not sure if there is a way to enable it or not, but really would like these basic features available.

这也适用于新发布的Visual Studio2015.另一方面,Visual Studio Code似乎可以很好地处理它.

This also applies for the newly released Visual Studio 2015. On the other hand, Visual Studio Code seems to handle it very well.

推荐答案

Github上存在一个问题,即能够在Typescript文件中使用Javascript代码片段,并使代码段代码管理器能够将Typescript识别为一种语言. https://github.com/Microsoft/TypeScript/issues/312

There is an issue on Github about being able to use Javascript snippets in Typescript files, and to make the Snippet Code Manager being able to recognize Typescript as a Language. https://github.com/Microsoft/TypeScript/issues/312

这篇关于Visual Studio上的打字稿片段的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆