johnno1962 / GitDiff

Highlights deltas against git repo in Xcode
MIT License
891 stars 54 forks source link

Seems not working on Xcode 11.1 #73

Closed yam-liu closed 4 years ago

yam-liu commented 4 years ago

Xcode resigned, plugin loaded, LNProvider running, but no mark shows on gutter.

johnno1962 commented 4 years ago

I’m sorry, but as GitDiff has been well and truly “Sherlocked” it is no longer supported. I’ll update the README.md. What are you using it for that Apple’s implementation does not provide?

yam-liu commented 4 years ago

Color. Xcode shows all changes blue, but it should be added, deleted and modified.

johnno1962 commented 4 years ago

Yeah, they went a different way. Perhaps you could file a radar?

yam-liu commented 4 years ago

OK, I will try to find out if I can fix this. File a radar is a right way but not quick way. A year or two is too long to wait.

johnno1962 commented 4 years ago

Hi, I had a quick look and I’d say fixing it is not going to be straightforward. They are quietly rewriting the source code editor innards in Swift which is not very conducive to the type of reverse engineering the GitDiff requires. There are at least three problems including updating the DVTPlugInCompatibilityUUIDs and this change at LNXcodeSuport.mm line 244

    if (![lineNumberGutter isKindOfClass:gutterContentClasss] &&
        !(floating.count > 1 &&
          [lineNumberGutter = floating[1] isKindOfClass:gutterContentClasss]))
            return;

but more importantly the method editedDocPath is no longer reporting the current file name correctly. If you do go ahead (you’ll need to use the Xprobe plugin.) This is where I’d start. Let me know how you get on.

johnno1962 commented 4 years ago

I’ve been able to get it working by using the path of the last file saved. Not ideal but works for now.

yam-liu commented 4 years ago

Thanks!! It works.