This Visual Studio Code extension allows you to apply a diff from your clipboard to the currently open file. It is particularly useful when you need to apply a specific set of changes from code reviews, emails, or other sources directly to your files within the editor.
- Apply diffs from your clipboard to the currently open file with a simple command or keybinding.
- Error messages are shown when the diff cannot be applied or if there are conflicts.
- Download or clone this repository to your local machine.
- Open the project folder in Visual Studio Code.
- Press
F5
to run the extension in a new Extension Development Host window.
- Copy the diff text to your clipboard. Make sure it is in Unified Diff format.
- Open the file you want to apply the diff to in Visual Studio Code.
- Press
Ctrl+Shift+P
(Windows/Linux) orCmd+Shift+P
(Mac) to open the Command Palette. - Type "Apply Diff" in the Command Palette and press Enter, or use the keybinding
Ctrl+Alt+D
(Windows/Linux) orCmd+Alt+D
(Mac) to run the "Apply Diff from Clipboard" command. - The extension will attempt to apply the diff to the currently open file. If the diff is applied successfully, a success message will be shown. If there are any issues or conflicts, an error message will be displayed.
Coding, Debugging, Refactoring, Testing, Running, Question