mrcrowl / vscode-hg

Integrated Mercurial source control for Visual Studio Code
MIT License
71 stars 37 forks source link

Inline diff is not displayed #198

Closed artem701 closed 1 year ago

artem701 commented 1 year ago

Inline diff view and change indicators stopped working recently (couple of weeks ago maybe) while changes in working directory still can be viewed.

The behaviour I got (right tab is working directory changes for comparison): image

The expected behaviour is as in git extensions (which was fine until some recent update): image

Tried reinstalling the extension, but it didn't help. Also I don't remember messing with extension's or mercurial's settings.

marcatec commented 1 year ago

I have the same issue. The gutter indicators stopped working and they are crucial to me. I am on Windows, on Linux the problem seams to not appear. Disabling all other extensions didn't help. A downgrade of VSCode from 1.76 back to 1.75 helped, but but I hope the issue can be resolved.

artem701 commented 1 year ago

By the way, on my side the bug is also happening on Windows, VSCode version 1.76.2. And switching to 1.75.1 helped, thanks @marcatec.

gbmahili commented 1 year ago

Yeah, I am getting the same issue. Switching to 1.75.1 (https://update.code.visualstudio.com/1.75.1/win32-x64-user/stable) helped me (Windows 10)

alexr00 commented 1 year ago

👋 @mrcrowl, I'm a developer on VS Code and I made the change that caused this breakage. Here's what's happening now:

  1. I made a change to how quick diff works such that if the quick diff provider has a root URI we filter to only quick diff providers where that URI is a parent or equal to the file we want to get quick diffs for. The old behavior took any quick diffs, even if the root URI didn't match
  2. On this line, you create the root URI that is used for the quick diffs: https://github.com/mrcrowl/vscode-hg/blob/795ed52333408fe6742f06fb71336e337b999891/src/repository.ts#L608-L609
  3. This works fine on linux and macOS, but on Windows, using Uri.parse causes the scheme of the URI to be set incorrectly. The best way to get file Uris is to do Uri.file instead. I don't know where else in SCM this root URI gets used, but if you have any longstanding Windows issues in the extension then this could be the cause.

@mrcrowl, if you're willing to make the fix to vscode-hg that would be ideal; however, we also don't want to break extensions. I can see if there's a change I can make in VS Code to work around the incorrect root URI if you can't make the change in vscode-hg.

gbmahili commented 1 year ago

👋 @mrcrowl, I'm a developer on VS Code and I made the change that caused this breakage. Here's what's happening now:

  1. I made a change to how quick diff works such that if the quick diff provider has a root URI we filter to only quick diff providers where that URI is a parent or equal to the file we want to get quick diffs for. The old behavior took any quick diffs, even if the root URI didn't match
  2. On this line, you create the root URI that is used for the quick diffs: https://github.com/mrcrowl/vscode-hg/blob/795ed52333408fe6742f06fb71336e337b999891/src/repository.ts#L608-L609
  3. This works fine on linux and macOS, but on Windows, using Uri.parse causes the scheme of the URI to be set incorrectly. The best way to get file Uris is to do Uri.file instead. I don't know where else in SCM this root URI gets used, but if you have any longstanding Windows issues in the extension then this could be the cause.

@mrcrowl, if you're willing to make the fix to vscode-hg that would be ideal; however, we also don't want to break extensions. I can see if there's a change I can make in VS Code to work around the incorrect root URI if you can't make the change in vscode-hg.

@alexr00 - Can you please make these changes in the next VSC release as we wait for the ones here to be made? Thank you in advance.

alexr00 commented 1 year ago

After discussing with others on the VS Code team, we've decided not to make any VS Code change to unblock quick diffs in Mercurial. There's definitely a bug in the extension, it was just more hidden before. Any change we make in VS Code for this is just a work around and wouldn't fix whatever other issues this path bug is causing in the extension.

I've created a PR here to make the change needed for Mercurial to get quick diffs again: https://github.com/mrcrowl/vscode-hg/pull/199

If you need quick diffs immediately I would recommend downgrading the version of VS Code you're using to 1.74.

incidentist commented 1 year ago

Thanks for looking into this @alexr00. I should be able to look at the PR this week.

BCGST commented 1 year ago

@incidentist any update on this? I am also am interested in how this bug might be resolved.

incidentist commented 1 year ago

@BCGST Sorry about the delay! I just merged a fix. @mrcrowl Can you release version 1.9.0 on master? It should be all set to go.

@alexr00 Thank you so much for the explanation and the PR!

mrcrowl commented 1 year ago

Done.