DEV Community

Cover image for Revolutionize Your Refactoring with VS Code's Next Edit Suggestions
Andrea Liliana Griffiths
Andrea Liliana Griffiths

Posted on

1

Revolutionize Your Refactoring with VS Code's Next Edit Suggestions

Hey there, developers! Andrea Griffiths here, Senior Developer Advocate at GitHub.

Have you ever spent hours tediously hunting down every instance where you need to update code after changing a variable name or modifying a function signature? If you're like me, you know that refactoring can sometimes feel like searching for needles in a haystack frustrating, time-consuming, and prone to errors.

That's why I'm incredibly excited to share our latest GitHub Checkout episode featuring a game-changing VS Code feature: Next Edit Suggestions.

What is Next Edit Suggestions?

Next Edit Suggestions (NES) is the newest capability from GitHub Copilot that fundamentally transforms how we edit and refactor code. Unlike standard completions that help you write new code, NES anticipates what you need to change in your existing code.

Here's what makes it special:

  • Predicts intent: NES understands what you're trying to accomplish when you make a change
  • Anticipates edits: Automatically suggests related changes across your project
  • Maintains context: Keeps track of semantic relationships between different parts of your code
  • Streamlines workflow: Keeps you in flow without needing to manually hunt down every reference

See It In Action

In our latest GitHub Checkout episode, I sat down with Brigit Murtaugh, Senior Product Manager for VS Code, for a deep dive into how Next Edit Suggestions works.

We demonstrate real-world scenarios where NES shines:

  1. Changing intent: Converting a 2D point class to 3D by simply editing the class name
  2. Adding logic: Updating code throughout your project after adding new functionality
  3. Fixing logic: Updating all references when changing variable types or function behaviors
  4. Refactoring: Renaming variables, functions, or parameters and having all references update

What impressed me most during our demo was how fast the suggestions appear and how intelligent they areβ€”NES doesn't just find matching text, it understands the semantics of your code.

How to Enable It

Getting started with Next Edit Suggestions is super simple:

  1. Make sure you have GitHub Copilot installed
  2. In VS Code settings, check the box for "Copilot Next Edit Suggestions"
  3. For the best experience, use VS Code Insiders with the Copilot and Copilot Chat pre-release extensions

Watch the Full Episode

I encourage you to check out the full episode to see all the mind-blowing examples of how Next Edit Suggestions can transform your development workflow. Trust me, once you see it in action, you'll wonder how you ever lived without it!

Watch GitHub Checkout: Next Edit Suggestions now β†’

Share Your Experience

After you've had a chance to try Next Edit Suggestions, I'd love to hear about your experience. What type of edits has it helped you with the most? How has it changed your workflow?

The team is actively collecting feedback, so don't hesitate to share your thoughts on the VS Code Copilot GitHub repo.

Happy coding (and effortless refactoring)!

Andrea

API Trace View

How I Cut 22.3 Seconds Off an API Call with Sentry πŸ•’

Struggling with slow API calls? Dan Mindru walks through how he used Sentry's new Trace View feature to shave off 22.3 seconds from an API call.

Get a practical walkthrough of how to identify bottlenecks, split tasks into multiple parallel tasks, identify slow AI model calls, and more.

Read more β†’

Top comments (0)

Eliminate Context Switching and Maximize Productivity

Pieces.app

Pieces Copilot is your personalized workflow assistant, working alongside your favorite apps. Ask questions about entire repositories, generate contextualized code, save and reuse useful snippets, and streamline your development process.

Learn more

πŸ‘‹ Kindness is contagious

Please leave a ❀️ or a friendly comment on this post if you found it helpful!

Okay