Skip to main content
Back to Extensions Directory
coc.nvim fallback icon

Diff/patch language server support for coc.nvim

Installation CommandVim prompt
:CocInstall coc-diff
GitHub owner
Jelmer Vernooij
Version
v0.1.0
npm package
coc-diff
Requirements
coc ^0.0.80
License
Apache-2.0
Repository
GitHub
npm latest published 2026-03-30Registry checked 2026-10-08Registry summary

A practical first workflow

Use this extension when editing a saved unified diff or patch. It connects coc.nvim to the separate diff-lsp executable. Installing the coc extension alone does not install that server. This workflow checks a patch file; for repository status and changed-line gutters, compare coc-git.

Check the server before the patch

Build or install diff-lsp using its upstream instructions, then run the following inside the editor. If the executable lookup is empty, make the server available on the editor’s PATH or set diff.serverPath to its absolute executable path in coc-settings.json.

vim snippet
1:echo exepath('diff-lsp')
2:CocInstall coc-diff

Save this as example.patch. The header deliberately claims two old and two new lines while the hunk contains one of each:

example.patch
1--- a/example.txt
2+++ b/example.txt
3@@ -1,2 +1,2 @@
4-before
5+after

Run :CocDiagnostics. A server supporting the documented hunk-count check should report the mismatch. Change the header to @@ -1 +1 @@, save and check that the count diagnostic clears. This exercise does not apply the patch or establish that it applies cleanly to your repository.

If there is no result, check :set filetype? for diff, diff.enable, then the Diff Language Server output through :CocCommand workspace.showOutput. An executable-not-found error is a server installation problem; editing the hunk cannot repair it.

Configuration and server launch verified in coc-diff 0.1.0; diagnostic expectations follow the diff-lsp documentation. The separately installed server determines its available features; this patch check has not been run against every server version.

Site-authored guidance reviewed on 2026-09-11. Content sources and maintainers · Choose extension responsibilities

Published Package Summary

Diff/patch language server support for coc.nvim

  • Diff/patch language server support for coc.nvim
Activation Events
  • onLanguage:diff
Developer Resources

Want to build, test, or contribute to coc.nvim extensions? Explore our official SDK and testing toolkits.

Open Developer Guide

Version History

This published npm package does not include a history.md or changelog.md file. Browse its npm versions or repository releases for available release information.