microsoft / vscode

Visual Studio Code
https://code.visualstudio.com
MIT License
160.22k stars 28.06k forks source link

Add diff algorithm option behavior like idciff #211849

Open roachsinai opened 2 months ago

roachsinai commented 2 months ago

The git diff of my changes:

image

Diff result of VSCode:

image

As show in above two images, vscode show same diff with git.

But icdiff shows a more direct result:

image

Add result of icdiff is expected, thanks!

hediet commented 1 month ago

Please include the original/modified text. Thanks!

roachsinai commented 1 month ago

Hi @hediet

original text:

@dataclass
class CXXUnit:
    source: str
    entrance: Optional[str]= None
    includes: List[str]= field(default_factory=list)
    libraries: List[str]= field(default_factory=list)
    defines: List[str]= field(default_factory=list)

modified text:

@dataclass
class CXXUnit:
    source: str
    ent: Optional[str]= None
    includes: List[str]= field(factory=list)
    libraries: List[str]= field(default_factory=list)
    libraries: List[str]= field(default_factory=list)
hediet commented 1 month ago

For reference, here the playground.

With a small adjustment of the modified text, you can actually get a better diff.

roachsinai commented 1 month ago

@hediet Yeah, got it.