sysmagine / semanticdiff Goto Github PK
View Code? Open in Web Editor NEWCommunity support for SemanticDiff, the programming language aware diff for Visual Studio Code and GitHub.
Home Page: https://semanticdiff.com
Community support for SemanticDiff, the programming language aware diff for Visual Studio Code and GitHub.
Home Page: https://semanticdiff.com
Is your feature request related to a problem? Please describe.
We work with terraform and it would be great if your tool would support merging terraform code as well. Terraform code is written in hcl, hashicorp configuration language.
Describe the solution you'd like
Hcl semantic merge support.
Describe alternatives you've considered
N/A
Additional context
N/A
Support for VisualBasic-Syntax in SemanticDiff
Is your feature request related to a problem? Please describe.
We currently only support a dark theme in the GitHub pull request viewer.
Describe the solution you'd like
It should be possible to switch between different themes, especially between a dark and light theme.
Describe the Bug
It is not possible to compare files if at least one of them hasn't been saved yet.
To Reproduce
Steps to reproduce the behavior:
File -> New Text Files
OPEN EDITORS
Select for Compare
Compare with Selected
Expected Behavior
The semantic diff should display.
Actual Behavior
The diff computation fails with Unsupported file extension:
.
SemanticDiff Version
0.8.1
VS Code Information
Version: 1.74.3
Commit: 97dec172d3256f8ca4bfb2143f3f76b503ca0534
Date: 2023-01-09T16:57:40.428Z
Electron: 19.1.8
Chromium: 102.0.5005.167
Node.js: 16.14.2
V8: 10.2.154.15-electron.0
OS: Linux x64 6.1.0-1-amd64
Sandboxed: No
Additional Context
SemanticDiff currently derives the programming language from the file extension which is not available if the file hasn't been saved yet. In this case, we may want to extract the language information from the open editor instead.
It'd be great if Semantic Diff was available as a plugin for the JetBrains IDEs.
Describe the Bug
Repos containing a dot (.
) do not work.
To Reproduce
Steps to reproduce the behavior:
https://github.com/vercel/next.js/pull/51733
Expected Behavior
Show diff
Actual Behavior
Error message "This URL does not belong to a GitHub PR or commit"
Link
You can also see a more detail error at https://app.semanticdiff.com/vercel/next.js/pull/51733/files
{"detail":[{"loc":["path","repo"],"msg":"string does not match regex \"^[a-zA-Z0-9_-]+$\"","type":"value_error.str.regex","ctx":{"pattern":"^[a-zA-Z0-9_-]+$"}}]}
Additional Context
Next.js is one of the most starred github repos.
There are several repos in the top 100 that contain a dot.
Describe the Bug
Hitting Cmd-Shift-P to search enable/switch to SemanticDiff in my go or tsx files through the error "This type of diff is not supported by SemanticDiff." (currently trying to resolve a merge conflict in my git repo)
To Reproduce
Steps to reproduce the behavior:
Expected Behavior
Actual Behavior
Screenshots
Source Code
SemanticDiff Version
v0.8.4
VS Code Information
Version: 1.81.0
Commit: 6445d93c81ebe42c4cbd7a60712e0b17d9463e97
Date: 2023-08-02T12:38:28.722Z
Electron: 22.3.18
ElectronBuildId: 22689846
Chromium: 108.0.5359.215
Node.js: 16.17.1
V8: 10.8.168.25-electron.0
OS: Darwin arm64 21.6.0
Additional Context
Add any other context about the problem here.
Latex is commonly used in a scientific context to write papers and notes. In this regard, it is primarily a text-based format similar to markdown.
There is not really a good parser for latex, so it's probably not easy to integrate a full semantic representation. However, already ignoring formatting changes would be a helpful addition. In the future, this could be enhanced to e.g. recognize renames of equation labels and their references.
Reference: https://www.latex-project.org
Since you were super quick to implement support for PO files, I dare to ask for PHP support as well.
I realize that this is something more complex, but PHP is still the seventh language by usage on GitHub and the first web development language not to be supported by SemanticDiff ;-)
I look forward to your response, have a great day!
Support for PO translation files will be a game changer. Diffs are often 99% comments changes, as they usually contain file/line references of where the translation is used.
Also, PO support may not be so difficult to implement, IMHO.
Thanks in advance!
Using semanticdiff with file "myfile.json" works correctly, but with "my.file.json" I get an error message:
"This type of diff is not supported by SemanticDiff."
Would be great if there was support for SQL ... and specifically if it also could ignore repeated "GO" statements that does not have any function.
Please add support for .pas and .dfm files
Separately on .tsx files, if you add a parent div which causes indentation changes inside the jsx, the diff will detect the added spaces as changes. It isn't something that major but would be nice to have it filtered out especially on bigger files.
Originally posted by @gustavoferrara in #31 (comment)
It would be nice if you could implement xml support in order to compare version ?
Actually, we get "Unsupported language: xml" message
SemanticDiff doesn't indicate any changes in JavaScript/TypeScript/TSX if the only difference is an automatically inserted semicolon.
return 1
vs.
return
1
The second example is parsed as:
return;
1;
Since we can't highlight any non-existing semicolons, we could highlight the added line break in the same way as we currently do for strings.
Thanks @ElianCordoba for reporting.
Describe the Problem
Searching for "semantic diff' in Market place of VSCodium does not show any result.
The Diff viewer works fine, but does not allow to edit text or move text segments from one file to the other in the diff viewer.
A behaviour such is in Meld (meldmerge.org) would be very helpfull.
Oftentimes i need to check all unchanged regions of my code and it becomes annoying having to click Show more
20 lines at a time.
Having a solution similar to Vscode's new diff editor would be great, essentially having a little icon which lets you expand the whole region (and be able to collapse it altogether if it's been expanded as well).
It would be even better if somewhere along the top diff menu an option was added to outright toggle all unchanged regions
Support for simple formats like json, graphql, yml ...
Is your feature request related to a problem? Please describe.
I wanted to add semanticdiff as my default diff viewer in VS code and then use the Github PR and Issues extensions.
The diff from semanticdiff is an improvement over the default diff, but i am missing the ability to add a comment to a change.
For this i would have to open the diff in the default viewer and then add the comment.
This kinda defeats the purpose imo of using semanticdiff as the default diff viewer.
Describe the solution you'd like
I have no idea if its possible, but the ability to add comments from the semanticdiff view into the PR.
Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.
Additional context
SemanticDiff fails to generate a color palette for certain themes. This leads to an exception during the initialization of the webview and renders SemanticDiff unusable. The problem can be identified by the following exception in the developer console:
Uncaught TypeError: Cannot read properties of undefined (reading '0')
at a2 (script.js:16:94457)
at Tu.updateColorTheme (script.js:16:98744)
at new Tu (script.js:16:96840)
at script.js:16:118631
at script.js:16:119322
One theme known to trigger this problem is Cobalt Next.
Describe the Bug
When I highlight text in a diff, text in both old and new files are selected.
To Reproduce
Steps to reproduce the behavior:
Expected Behavior
Only text in the old file should be highlighted. The VSCode diff does what I expect.
I'm not entirely positive if that is expected, but I don't think the current behavior is useful in any way.
Actual Behavior
Text on both sides of the diff are highlighted.
Source Code
Not relevant as it happens on any file with multiple changes.
SemanticDiff Version
v0.8.8
VS Code Information
Simply click Help -> About -> Copy
in VS Code and paste the information:
Version: 1.85.2 (user setup)
Commit: 8b3775030ed1a69b13e4f4c628c612102e30a681
Date: 2024-01-18T06:40:10.514Z
Electron: 25.9.7
ElectronBuildId: 26354273
Chromium: 114.0.5735.289
Node.js: 18.15.0
V8: 11.4.183.29-electron.0
OS: Windows_NT x64 10.0.22631
Additional Context
Add any other context about the problem here.
Describe the Bug
In C# removing the namespace block causes practically the whole file to be outdented one level. The outdent is threated as not meaningful (as expected), but not for the lines containing brackets.
To Reproduce
Steps to reproduce the behavior:
Expected Behavior
Only the braces of namespace block and the internal changes are highlighted. Any other braces shouldn't be highlighted.
Actual Behavior
The expected changes are highlighted, however the braces and flow control statements that were merely outdented are also highlighted despite not caring any semantic changes.
Source Code
// Old
using System;
using System.Collections.Generic;
using System.Text;
using ChatModel;
using ChatModel.Util;
namespace ChatServer.HandleStrategies
{
/// <summary>
/// Class handling request to add user to conversation.
/// </summary>
class HandleAddToConversationStrategy : IHandleStrategy
{
public void handleRequest(List<IClientHandler> allHandlers, IServerChatSystem chatSystem, IClientHandler handlerThread, byte[] messageBytes)
{
Console.WriteLine("DEBUG: {0} request received", "add user to conversation");
//decoding request - first 4 bytes are id of conversation to which the user is to be added, following bytes are user name
int conversationId = BitConverter.ToInt32(messageBytes, 0);
string nameToAdd = Encoding.UTF8.GetString(messageBytes, 4, messageBytes.Length - 4);
Console.WriteLine("DEBUG: trying to add user to conversation");
byte[] reply = new byte[1]; //boolean reply has only 1 byte
lock (allHandlers) //prohibit other threads from interfering
{
if (chatSystem.addUserToConversation(nameToAdd, conversationId))
{
reply[0] = 1; //if adding successful set reply byte to one
byte[] msg = messageBytes;
Conversation conversation = chatSystem.getConversation(conversationId);
//and broadcast the change to all active handlers handling users present in the conversation
foreach (var handler in allHandlers.FindAll(h => conversation.Users.Exists(u => u.Name == h.HandledUserName)))
{
if (handler.HandledUserName == nameToAdd) //newly added user has to receive the entire conversation
{
byte[] update = conversation.serialize(new ConcreteSerializer()).ToArray();
handler.sendMessage(5, update); //serialized conversation - type 5
}
else
{
handler.sendMessage(4, msg); //user added to conversation - type 4. Forwarding received request.
}
}
}
else
{
reply[0] = 0; //else set reply byte to one
}
}
handlerThread.sendMessage(1, reply);
}
}
}
/*
One of concrete strategies of the implemented strategy pattern.
This class has only one responsibility.
Complies with Liskov Substitution Principle - all interface methods are properly implemented.
*/
// New
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using ChatModel;
using ChatModel.Util;
namespace ChatServer.HandleStrategies;
/// <summary>
/// Class handling request to add user to conversation.
/// </summary>
class HandleAddToConversationStrategy : IHandleStrategy
{
public void handleRequest(List<IClientHandler> allHandlers, IServerChatSystem chatSystem,
IClientHandler handlerThread, byte[] messageBytes)
{
Console.WriteLine("DEBUG: {0} request received", "add user to conversation");
//decoding request - first 16 bytes are id of conversation to which the user is to be added, following bytes are user name
Guid conversationId = new Guid(messageBytes[0..16]);
string nameToAdd = Encoding.UTF8.GetString(messageBytes, 16, messageBytes.Length - 16);
Console.WriteLine("DEBUG: trying to add user to conversation");
byte[] reply = new byte[1]; //boolean reply has only 1 byte
lock (allHandlers) //prohibit other threads from interfering
{
if (chatSystem.AddUserToConversation(nameToAdd, conversationId))
{
reply[0] = 1; //if adding successful set reply byte to one
byte[] msg = chatSystem.GetUser(nameToAdd).Serialize(new ConcreteSerializer()).ToArray();
Conversation conversation = chatSystem.FindConversation(conversationId);
//and broadcast the change to all active handlers handling users present in the conversation
foreach (var handler in allHandlers.FindAll(h =>
conversation.Users.Any(u => u.Name == h.HandledUserName)))
{
if (handler.HandledUserName == nameToAdd) //newly added user has to receive the entire conversation
{
ConversationUpdates conversationUpdates = conversation.GetUpdates(DateTime.MinValue);
byte[] update = conversationUpdates.Serialize(new ConcreteSerializer()).ToArray();
handler.sendMessage(5, update); //serialized conversation - type 5
}
else
{
handler.sendMessage(7, msg); //user added to conversation - type 4. Forwarding received request.
}
}
}
else
{
reply[0] = 0; //else set reply byte to one
}
}
handlerThread.sendMessage(1, reply);
}
}
/*
One of concrete strategies of the implemented strategy pattern.
This class has only one responsibility.
Complies with Liskov Substitution Principle - all interface methods are properly implemented.
*/
SemanticDiff Version
v0.8.3
VS Code Information
Version: 176,0 (user setup)
Commit: 92da9481 c0904c6adfe372c12da3b7748d74bdcb
Date 2023-03-01 (2 mos ago)
Electron: 19.1.11
Chromium: 102.0.5005.196
Node.js: 16.14.2
V8: 10.2.154.26-electron.0
OS: Windows NTx64 10.022624
Sandboxed: No
Additional Context
This is C# 10 or so. Didn't check other versions/languages, neither did I mutate the code to check under what conditions the problem exactly occurs.
Java is used by a lot of people in a bunch of projects, supporting for Java would be great (create a plugin for IntelliJ IDEA would be even more better).
Describe the Bug
I'm getting a parse error diff'ng 2 CSS files.
To Reproduce
Steps to reproduce the behavior:
Diff 2 CSS files that contain keyframes with multiple selectors, such as:
@keyframes targettext2 {
0%, 50% {
color: #989898;
}
100%, 25% {
color: #000;
}
}
Expected Behavior
It should parse those CSS files.
Actual Behavior
I get the error and cannot continue diff'ing
SemanticDiff Version
0.8.2
VS Code Information
Version: 1.76.2 (user setup)
Commit: ee2b180d582a7f601fa6ecfdad8d9fd269ab1884
Date: 2023-03-14T17:55:54.936Z
Electron: 19.1.11
Chromium: 102.0.5005.196
Node.js: 16.14.2
V8: 10.2.154.26-electron.0
OS: Windows_NT x64 10.0.22621
Sandboxed: No
Is your feature request related to a problem? Please describe.
I deal with reviewing changes to Infra as Code (JSON/ARM) , which are JSON files (2 to 8 MB) in which the sections are always generated in different order. Ask the Azure guys why that happen. I need to compare those JSON files, and validate the changes, but since sections are in different order, they are shown as differences, which in JSON those are not.
Describe the solution you'd like
A flag to tell only show differences, do not mind the order, for JSON files.
Describe alternatives you've considered
Write my own code, but the visualiation part will be a challenge.
Additional context
None
The YAML file format (.yml
, .yaml
) is often used for configuration files.
Examples:
.gitlab-ci.yml
)Describe the Bug
The theme colour icon.foreground
is not respected by the editor action icon.
To Reproduce
Steps to reproduce the behavior:
Apply the following example to settings.json
"workbench.colorCustomizations": {
"icon.foreground": "#ff0000",
}
Open a diff
Expected Behavior
Icon to be red matching given colour.
VS Code's UX Guidelines for Editor Actions (https://code.visualstudio.com/api/ux-guidelines/editor-actions) should be respected:
โ Don't
- Add custom colors
Actual Behavior
Icon is inaccessible green-ish.
Screenshots
Above
Source Code
n/a
SemanticDiff Version
v0.8.9
VS Code Information
Version: 1.88.0-insider
Commit: 46b756b8434730593b3c911fd1ca43366b29eb03
Date: 2024-03-28T10:55:27.479Z
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.4.0
Additional Context
n/a
Describe the Bug
Parser reporting an error with the as
keyword when trying to choose a namespace with @use
.
To Reproduce
Steps to reproduce the behavior:
@use "./file" as namespace
.Expected Behavior
Should parse correctly.
Actual Behavior
Returns a parsing error and highlights the as
keyword.
SemanticDiff Version
0.8.4
VS Code Information
Version: 1.80.2 (user setup)
Commit: 2ccd690cbff1569e4a83d7c43d45101f817401dc
Date: 2023-07-27T20:40:28.909Z
Electron: 22.3.14
ElectronBuildId: 22695494
Chromium: 108.0.5359.215
Node.js: 16.17.1
V8: 10.8.168.25-electron.0
OS: Windows_NT x64 10.0.19045
'Support for C and C++ languages
Refactoring code sometimes moves code quite a bit around, and a semantically aware tool for diffs could be very useful.
SQL is a very common language used by many devs - mostly for migrations
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):
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
As the title implies, this issue is about adding support for the Dockerfile format in SemanticDiff.
Ruby is still used by many users.
Support for .graphql files
Haven't found a better representation on how files look like.
https://spec.graphql.org/October2021/#sec-Overview
https://github.com/bkegley/tree-sitter-graphql
Would be great to have support for the Scala language ๐
Would be great to have Lua added as a supported source code language.
Is your feature request related to a problem? Please describe.
When refactoring code, a common operation is extract to class
class A
{
method One
method Two {
// SOME CODE
// SOME CODE TO REFACTOR INTO NEW CLASS B
//SOME OTHER CODE
}
}
--->
class B {
method Three { // SOME CODE OF CLASS B }
}
class A {
(B)
method One
method Two {
// SOME CODE
B.Three(...)
//SOME OTHER CODE
}
}
Describe the solution you'd like
would be nice if extract interface and class, through added reference in the constructor, could show and navigate/compare to the same extracted methods among different classes
Describe alternatives you've considered
tried to compare different files manually now but is not easy to do...
Additional context
This would be super useful in the context of refactoring:
https://refactoring.guru/refactoring/techniques/moving-features-between-objects
Describe the Bug
The CSS parser reports an error when an attribute selector contains "i" at the end to indicate case-insensitive comparisson.
Example: a[href^="https://" i]
To Reproduce
Steps to reproduce the behavior:
Expected Behavior
Should parse correctly.
Actual Behavior
Shows the "i" as a parsing error.
SemanticDiff Version
v0.8.2
VS Code Information
Version: 1.77.3 (Universal)
Commit: 704ed70d4fd1c6bd6342c436f1ede30d1cff4710
Date: 2023-04-12T09:19:37.325Z
Electron: 19.1.11
Chromium: 102.0.5005.196
Node.js: 16.14.2
V8: 10.2.154.26-electron.0
OS: Darwin x64 21.6.0
Sandboxed: No
When I enable SemanticDiff for a Python file , all code coloring is lost no matter the color theme I use.
When I disable, all colors are back.
I have the folowing vscode extensions related to Python enabled:
Pylance, Python, Python Debugger and Python Indent.
SemanticDiff v 0.8.8
VsCode 1.87.1
As the title implies, this issue is about adding support for the Vue SFC format in SemanticDiff.
Describe the Bug
When moving code from one file to another, I'm expecting to see it moved in the viewer, but it's not.
To Reproduce
Expected Behavior
I see that code was moved from original.py
to one.py
, two.py
, three.py
Actual Behavior
No moved code is detected
Links
I created a simple repo to test: https://github.com/Kangaroux/semanticdiff-moved-code
This PR moves the code and deletes the original file: https://app.semanticdiff.com/Kangaroux/semanticdiff-moved-code/pull/1/#one.py
This PR moves the code and deletes all the content, but keeps the file intact: https://app.semanticdiff.com/Kangaroux/semanticdiff-moved-code/pull/2/#one.py
Hi, we would love to have standalone software that isn't tied to a particular IDE or repository, so that it can be used as an external merge tool with GitKraken.
Thanks :)
Please react to this issue if you are interested in an extension for Visual Studio 2022 (not VS Code).
It helps us decide which editors/IDEs to support next.
Describe the Bug
A clear and concise description of what the bug is.
When JSON files have the sequence of their properties changed without any semantic changes, semanticdiff is highlighting them as changes. The JSON standard specifies that object properties are unordered; some of the tools we use
To Reproduce
Open the diff for JSON file with only the property order changed.
Expected Behavior
non-semantic changes are not highlighted
Actual Behavior
See screenshot
Source Code
n/a
SemanticDiff Version
v0.8.2
VS Code Information
Simply click Help -> About -> Copy
in VS Code and paste the information:
Version: 1.76.2
Commit: ee2b180d582a7f601fa6ecfdad8d9fd269ab1884
Date: 2023-03-14T17:53:46.528Z (1 wk ago)
Electron: 19.1.11
Chromium: 102.0.5005.196
Node.js: 16.14.2
V8: 10.2.154.26-electron.0
OS: Darwin arm64 22.2.0
Sandboxed: No
Additional Context
n/a
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.