typescript VSCode 实现方法快捷方式

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/36110718/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-09 07:01:42  来源:igfitidea点击:

VSCode Implement Method Shortcut

typescriptvisual-studio-code

提问by Angel Angel

I'm using VSCode, Exist, a way to implement the methods that are within an interface in typescript using some shortcut keys or set for it.

我正在使用 VSCode,Exist,这是一种使用一些快捷键或为其设置的方法来实现打字稿中接口内的方法。

I searched on the website of Microsoft, and the web, but I have not found anything.

我在微软的网站和网络上搜索,但我没有找到任何东西。

采纳答案by toskv

There isn't such a shortcut by default.

默认没有这样的快捷方式。

You can search for an extension on the marketplace. I didn't find any.

您可以在市场上搜索扩展程序。我没有找到。

回答by knaos

UPDATE: VS Code now supports this functionality out of the box. Just add the interface, the compiler will highlight the controller with red, right click on the light bulb on the left and click implement interface. Enjoy!

更新:VS Code 现在开箱即用地支持此功能。只需添加接口,编译器会用红色突出显示控制器,右键单击左侧的灯泡,然后单击实现接口。享受!

Interface implementing

接口实现

回答by shanwu

It will be "ctrl+." for visual studio code linux version or click on the light bulb icon(enter image description here).

ctrl+.对于 Visual Studio Code linux 版本,它将是“ ”或单击light bulb icon( 在此处输入图片说明)。

回答by Tore Aurstad

Update: The shortcut in VsCode for accessing this quick action is the usual one: Ctrl + . (period).

更新:VsCode 中用于访问此快速操作的快捷方式是常用的: Ctrl + 。(时期)。

The built-in functionality of VsCode implementing an interface was first resolved for me by upgrading and using the Visual Studio Code -Insiders version instead.

通过升级和使用 Visual Studio Code -Insiders 版本,我首先解决了实现接口的 VsCode 的内置功能。

See: VsCode Insidersfor downloading this edition of VsCode.

请参阅:VsCode Insiders以下载此版本的 VsCode。

Note that using the insiders editions might impact other aspects of your apps, as the versions are more beta than the public VsCode editions.

请注意,使用内部版本可能会影响您的应用程序的其他方面,因为这些版本比公开的 VsCode 版本更多是测试版。

Implement Typescript interface built-in option in VsCode

在 VsCode 中实现 Typescript 接口内置选项

回答by Rasmus Christensen

If you are using mac, the shortcut is CMD + .

如果您使用的是 mac,则快捷方式是 CMD + 。