Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

like image 950
Angel Angel Avatar asked Mar 20 '16 06:03

Angel Angel


People also ask

How do you enter method implementation in Visual Studio code?

Go to Implementation# Languages can also support jumping to the implementation of a symbol by pressing Ctrl+F12. For an interface, this shows all the implementors of that interface and for abstract methods, this shows all concrete implementations of that method.

How do you use Ctrl D in VS Code?

Ctrl+D selects the word at the cursor, or the next occurrence of the current selection. Tip: You can also add more cursors with Ctrl+Shift+L, which will add a selection at each occurrence of the current selected text.

What is the shortcut for run in VS Code?

The Shortcut to Run Code in VS Code In VS Code, you only need to use a shortcut to run your code. That shortcut is Ctrl + Alt + N. There are a few more ways to run code. Pressing F1 and then choosing “Run Code” also works.


2 Answers

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

like image 73
knaos Avatar answered Sep 20 '22 12:09

knaos


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

like image 21
Tore Aurstad Avatar answered Sep 22 '22 12:09

Tore Aurstad