dsh-code-studio: Edit Code and View Git Diffs in the DSH Workspace

Introduction

In DSH, we frequently open source code, configurations, and Markdown files within the workspace: most of the time, the native viewer is sufficient. However, once we need to change a few words or an entire paragraph, we have to find another editor, and the paths and file tree can easily become detached from the host. An independent “File Edit” tab also competes for focus with DSH’s built-in navigation. Below, I will introduce the community plugin dsh-code-studio (maintainer hh5631): it embeds a lightweight editor into DSH’s native file area, completes code and Markdown editing next to the file tree, and views Git change diffs within the same interface.

What is it

dsh-code-studio is a DSH client-side plugin (directory: SkillHub Plugin Page). Its positioning is a “lightweight editor integrated into DSH’s native file area”: editing, searching, and Git diffs stay within the workspace; images, PDFs, and Office documents are still handed over to DSH’s native preview. The repository hh5631/dsh-code-studio currently has a readme version of 2.0.1 and a license of MIT; implementation-wise, it derives from the packages/dsh-code-studio of Lenonss/DSH_VsCodeMode, redoing the panels and interactions while retaining the original license and copyright notices.

Core Features

Editor Integration with Native File Area

  • When opening DSH “Workspace Files” or clicking a file link, the default remains DSH’s native viewer. To edit code or text in place, select “Editor” in the original “Code/Plain Text/Markdown” view menu.
  • The plugin removes the independent “File Edit” entry and internal file tab bar; file names, navigation, and file tree expansion are managed by DSH.
  • When selecting another file from the side file tree, it switches content in the current tab; it attempts to save before switching. If saving fails, the current file content is retained; rapid consecutive clicks only submit the last selection.
  • On wide screens, the native file tree can be displayed upon first entry (can be collapsed using the folder button); narrow screens follow DSH’s overlay and collapse rules. The workspace file page, native preview, and editor path bar provide Git, search, swap sides, and file tree buttons; when the file tree is on the left, the button group shifts left and reverses order. On wide screens, the main content yields to the file tree; the position is remembered after refresh.
  • The same menu can be used to switch back to native preview; when exiting edit mode, it attempts to save, and if it fails, the content remains in the local edit buffer.

Settings and Saving

In DSH Settings → Code Workbench, you can change the editor font, font size, and the plugin interface font and size: real-time preview on input, saved and effective on blur; leaving it empty follows the host and uses the device’s existing fonts.

Auto-save after input, or use the save shortcut. When saving fails or external files are modified causing conflicts, local content is retained; when a conflict occurs, auto-save stops, and you can copy the local content or choose to reload. After closing the native tab, unsaved failures remain in the buffer and will prevent a direct page refresh, requiring you to reopen the original file to handle it.

Git Differences

Clicking a tracked changed file in the Git panel opens the diff view. The toolbar switches between Single Column Inline / Double Column Side-by-Side (current mode highlighted) and displays the number of changed segments. The double column presents a “Staging/HEAD → Workspace/Staging” left and right card with a central groove, aligning line by line, filling empty lines with diagonal stripes, and connecting adjacent modified blocks with vertical lines into clusters. Unstaged modifications can be restored to the left version segment by segment in the central groove using arrows; modification segment bars also have restore and edit icons (edit allows inputting a replacement for that segment). Untracked files are opened directly.

Preview and Size Limits

Images, PDFs, and Office documents are previewed natively by DSH; the plugin no longer includes built-in markdown tables or PDF editors. Text larger than 2 MiB uses a read-only paginated preview to avoid loading the entire file into the editor at once.

Editing Capabilities and Language Support

When selecting “Editor”, CodeMirror 6 is loaded on demand, first showing a loading feedback before mounting the editable area and enabling syntax highlighting. It supports syntax highlighting for common languages like Markdown, JSON, C/C++, JavaScript/TypeScript, Lua, C#, and Find & Replace, folding, undo, and redo. Lua and C# can use the language servers already available in the plugin; TypeScript only supports syntax highlighting and basic editing. Opened files reuse editing state and undo history, and auto-save is debounced per file.

Removed Capabilities (Expected Usage)

Compared to the upstream fork, this plugin has removed: Agent editing collection, cumulative diff baseline, Keep/Undo, diff decoration, review overlays, diff history and rollback; multi-edit grouping/floating windows; extra outline, diagnostic window, session size and session list status entries. Git repository modification diffs are still retained independently. Historical chats, disk files, and existing review archives will not be deleted due to functional simplification.

Installation and Activation

The plugin runs with the current DSH process permissions; it is recommended to review the repository source code and LICENSE before installing. The build artifacts lib/ are not included in repository commits; the official recommendation is to install a pre-built package:

dsh plugin --profile web add https://github.com/hh5631/dsh-code-studio/releases/latest/download/dsh-code-studio.tgz

If installing locally from source, a build must be completed first (engines requires Node ^22.19.0 || >=24.0.0, DSH >=0.1.0-rc.1 <0.3.0-0):

git clone https://github.com/hh5631/dsh-code-studio.git
cd dsh-code-studio && npm install && npm run build
dsh plugin --profile web add link:$PWD

Only build artifacts:

npm run build

The DeepSeek Harness ecosystem emphasizes “everything is a plugin”; community directories like SkillHub are independent sites with no official affiliation to DeepSeek or Huanfang, and installation sources are determined by the distribution page you trust.

Typical Usage

  1. Open the target file in the workspace (default native viewer).
  2. Select “Editor” in the view menu, wait for CodeMirror to load as needed, and start editing; large files enter paginated read-only mode and cannot be edited as a whole file.
  3. Auto-save during editing, or use the host save shortcut; handle conflicts by copying local content or reloading as prompted by the interface.
  4. When needing to see changes, open the Git panel, click a tracked file to enter diff view, switch between single/double column, and restore segments as needed.
  5. The path bar can use workspace capabilities like Search; fonts can be adjusted in Settings → Code Workbench.
  6. After editing, switch back to native preview in the same menu; images/PDF/Office don’t need to go through this plugin’s editor.

Applicable Scenarios and Notes

Suitable for: Developers and AI Agent workflow maintainers who, under DSH Web configuration, want to minimize jumping between views, minimize duplicate file trees, and edit code/Markdown within the workspace while verifying Git diffs.

Notes:

  • The plugin depends on DSH client UI and peer packages like Cordis; versions must satisfy engines and peerDependencies in package.json.
  • Text larger than 2 MiB can only be previewed in paginated read-only mode.
  • When you need Agent-side diff review, multi-floating edit windows, and other upstream capabilities, you should choose a fork that still retains these capabilities, rather than this minimal branch.

Conclusion

dsh-code-studio brings editing and Git diffs into DSH’s native file area, uses CodeMirror 6 and settings to meet daily coding needs, and leaves heavy-duty previewing to the host. For further information, visit the SkillHub directory page and the GitHub repository.

羽毛球分组比赛记分
小程序二维码

欢迎使用《羽毛球分组比赛记分》微信小程序

Xiaoye