Skip to content

Add patch/diff file visualization extension with diff2html - #2

Merged
unknowIfGuestInDream merged 5 commits into
masterfrom
copilot/add-patch-diff-visualization-plugin
Jan 30, 2026
Merged

unknowIfGuestInDream merged 5 commits into
masterfrom
copilot/add-patch-diff-visualization-plugin

Conversation

Copilot AI commented Jan 30, 2026 •

Copy link
Copy Markdown
Contributor

VSCode extension for visualizing .patch and .diff files with diff2html, providing two-tab editing and theme-aware rendering.

Changes

Extension Core

  • Custom Editor Provider (src/patchEditorProvider.ts): Webview-based editor with two tabs—Visual Diff (diff2html rendered) and Raw Content
  • View Modes: Side-by-side and unified toggle with persisted preference
  • Theme Integration: Follows VSCode theme (Light/Dark/High Contrast) via onDidChangeActiveColorTheme, auto-refreshes on switch
  • Auto-render: Content changes trigger immediate re-render

Configuration

  • tlcsdm.patchReader.defaultViewMode: Default view mode setting (side-by-side | unified)
  • Command: tlcsdm.patchReader.toggleView for programmatic view switching

Internationalization

  • English (default), Chinese (zh-cn), and Japanese (ja) language support
  • Localized strings in package.nls.json, package.nls.zh-cn.json, package.nls.ja.json

Project Structure

  • GitHub workflows: build.yml, artifact.yml, publish.yml, release.yml, sync-gitee.yml
  • dependabot.yml for npm and GitHub Actions updates
  • CODEOWNERS for review routing
  • Standard VSCode extension scaffolding (tsconfig, eslint, .vscodeignore)
  • Extension icon at images/icon.png

Accessibility

  • ARIA attributes on tabs (role="tab", aria-selected) and view toggles (aria-pressed)
  • Proper tabpanel associations with aria-labelledby

Usage

// Opens automatically for .patch/.diff files
// Or configure default view mode:
{
  "tlcsdm.patchReader.defaultViewMode": "unified"
}
Original prompt

This section details on the original issue you should resolve

<issue_title>需求</issue_title>
<issue_description>1. vscode插件结构可以参考 我的别的项目,比如 https://github.com/tlcsdm/vscode-java-method-sorter
2. 主分支master
3. 提供.github 下dependabot,codeowner 工作流参考vscode-java-method-sorter
4. 具体功能可以参考https://github.com/tlcsdm/patchReader-extension
实现一个patch和diff文件的可视化插件,在打开patch和diff文件时提供两个tab
第一个tab是利用diff2html可视化,第二个tab显示原本的内容
在修改内容后自动渲染第一个tab
渲染的diff2html UI主题(Light/Dark)跟整个vscode主题走, 如果切换vscode主题,第一个tab的颜色主题也要刷新
提供SidebySide和Unified视图切换
</issue_description>

Comments on the Issue (you are @copilot in this section)


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Co-authored-by: unknowIfGuestInDream <57802425+unknowIfGuestInDream@users.noreply.github.com>
Co-authored-by: unknowIfGuestInDream <57802425+unknowIfGuestInDream@users.noreply.github.com>
@unknowIfGuestInDream
unknowIfGuestInDream marked this pull request as ready for review January 30, 2026 00:38
Copilot AI changed the title [WIP] Add patch and diff visualization plugin for VSCode Add patch/diff file visualization extension with diff2html Jan 30, 2026
@unknowIfGuestInDream

Copy link
Copy Markdown
Contributor

@copilot

  1. 缺少images/icon.png
  2. 支持国际化 (中日英) 默认英文
  3. Installation 添加从jenkins获取的信息
  4. README中 Setup 去掉 clone步骤,去掉Project Structure
  5. README中引用的images不存在

Co-authored-by: unknowIfGuestInDream <57802425+unknowIfGuestInDream@users.noreply.github.com>

Copilot AI commented Jan 30, 2026

Copy link
Copy Markdown
Contributor Author

@copilot

  1. 缺少images/icon.png
  2. 支持国际化 (中日英) 默认英文
    ...

Addressed in dc48618:

  1. Added images/icon.png
  2. Added i18n support with package.nls.json (English default), package.nls.zh-cn.json (Chinese), package.nls.ja.json (Japanese)
  3. Added Jenkins installation section in README
  4. Removed clone step and Project Structure from README
  5. Removed non-existent image references (Screenshots section) from README

@unknowIfGuestInDream
unknowIfGuestInDream merged commit 1d15a99 into master Jan 30, 2026
4 checks passed
@unknowIfGuestInDream
unknowIfGuestInDream deleted the copilot/add-patch-diff-visualization-plugin branch January 30, 2026 00:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

需求

2 participants