Visual Studio上的打字稿片段

编程入门 行业动态 更新时间:2024-10-27 08:33:06
本文介绍了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识别为一种语言. github/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. github/Microsoft/TypeScript/issues/312

更多推荐

Visual Studio上的打字稿片段

本文发布于:2023-11-17 06:38:25,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1609178.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:片段   Visual   Studio

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!