Copilot Tips: Sync/Async

Bobby Galli
Working Dev’s Hero
1 min readAug 11, 2023

Use Copilot Chat to Quickly Refactor Function Signatures

GitHub Copilot Tips & Tricks: Sync/Async

Video 🎥

Check out the following YouTube video to learn how to use GitHub Copilot’s Inline Chat to refactor async function signatures and make them sync or vice versa.

Convert Async to Sync and Back Again with Copilot Chat

Summary 📝

  1. To use this tip, TypeScript developers need to instal Visual Studio Code 1.80.1 or newer. — GitHub Copilot and Copilot Chat also need to be installed.
  2. With Copilot Chat you can easily refactor your code to make an async function synchronous.
  3. Highlight the code block, hit cmd + i to bring up inline chat, and ask Copilot to make the function synchronous.
  4. The tip also mentions that this can be done in reverse, making a synchronous function asynchronous.
  5. Follow Working Devs Hero for more tips, tricks, and AI news.

Memorable quote: “Generate test data that matches the interface.”

Conclusion: This tip provides a quick and efficient way for TypeScript developers to refactor their code and update function signatures by leveraging Visual Studio Code and Copilot Chat.

Want to Connect?

If you found the information in this tutorial useful please subscribe on Medium, follow @workingdevshero on X, and/or subscribe to the Working Dev's Hero YouTube channel.

--

--

Bobby Galli
Working Dev’s Hero

Software developer at BugSplat. Big friendly giant, golf ball whacker guy, goofball, lover of tacos.