Sysmagine / SemanticDiff

Community support for SemanticDiff, the programming language aware diff for Visual Studio Code and GitHub.
https://semanticdiff.com
49 stars 0 forks source link

SemanticDiff ignores enablePreview #61

Open Boxap opened 5 months ago

Boxap commented 5 months ago

Describe the Bug The only possibility to compare two branches (for example changes in Merge Request) is to consequently open file by file and check diffs per file (from what I could find). So in this process when selecting multiple files one by one, when using the default diff created tab is reused (preview used, workbench.editor.enablePreview setting is "true"), which means that for any amount of open diffs only one tab is created. (20 diffs clicked -> only one tab opened in the window in the end)

However SemanticDiff extension creates a permanent tab for every diff (20 diffs clicked -> 20 tabs opened in the window in the end)

To Reproduce Steps to reproduce the behavior (GitLens example):

  1. Set workbench.editor.enablePreview to true
  2. In "Search & Compare" section in GitLens Inspect tab compare 2 branches
  3. Click n changed files

Expected Behavior Only 1 original diff tab and 1 SemanticDiff tab should be opened

Actual Behavior 1 original diff and n SemanticDiff tabs are opened

SemanticDiff Version 0.8.10

VS Code Information

Version: 1.89.1 (Universal)
Commit: dc96b837cf6bb4af9cd736aa3af08cf8279f7685
Date: 2024-05-07T05:14:24.611Z
Electron: 28.2.8
ElectronBuildId: 27744544
Chromium: 120.0.6099.291
Node.js: 18.18.2
V8: 12.0.267.19-electron.0
OS: Darwin arm64 23.5.0
mmueller2012 commented 5 months ago

Thank you for your detailed bug report.

Unfortunately, we cannot implement a preview mode for SemanticDiff tabs due to limitations of the VS Code extension API.

In an ideal world, SemanticDiff would simply integrate its diff visualization into the regular editor. This is not possible, however, as it provides very limited ways to modify the rendering for extensions. Instead, we have to resort to using webview panels and implement all the text rendering ourselves. Webview panels offer the most flexibility, but they are also not very well integrated into VS Code and many features are not available. One of them is creating preview tabs. There is a feature request open since 2020 to allow creating preview tabs, but there doesn't seem to be much progress.