VS Code tips — Add missing function quick fix for JavaScript and TypeScript

preview_player
Показать описание
The "add missing function" quick fix for JavaScript and TypeScrip stubs out missing functions.

Often instead of writing out a new function declaration, just try adding a function call to a function that does not exist yet and then use this quick fix. VS Code will even try inferring the types of the arguments if you're working in TypeScript.

#vscode #javascript #typescript #refactoring
Рекомендации по теме
Комментарии
Автор

thank you so much. I was looking for a way to do this as I write out tests first and I wanted the function to be created for me automatically - i was looking into many refactoring extensions, but this finally made it possible...

mailsiraj
Автор

Is this feature available in tsx files? I can't see the quick fix in react typescript code, is there something to do to activate it?

wytube