Angel Angel
Angel Angel

Reputation: 21748

VSCode Implement Method Shortcut

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.

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

Upvotes: 32

Views: 72777

Answers (6)

Dax
Dax

Reputation: 1413

ctrl+ as quick fix if you use vs code in windows

Upvotes: -1

Tore Aurstad
Tore Aurstad

Reputation: 3826

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

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.

See: VsCode Insiders for downloading this edition of 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.

Implement Typescript interface built-in option in VsCode

Upvotes: 12

Rasmus Christensen
Rasmus Christensen

Reputation: 8541

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

Upvotes: 5

shanwu
shanwu

Reputation: 1695

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

Upvotes: 11

knaos
knaos

Reputation: 850

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!

Interface implementing

Upvotes: 50

toskv
toskv

Reputation: 31622

There isn't such a shortcut by default.

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

Upvotes: 3

Related Questions