Skip to content
项目

关于

在 Xcode 中高亮显示相对于 Git 仓库的差异

其他项目

这些数字如何统计

实测星标增长

24小时
0
7天
0
15天
0
1个月
正在收集历史

各周期内的星标净变化,周期相互重叠,并非每日新增。缺失的测量保持空白。星标代表关注度,不代表软件质量。

README.md

原文

GitDiff9 - GitDiff for Xcode 9

As this plugin has rather been "Sherlocked" it is no longer supported and only just works in Xcode 11. You need to save the file before the highlights are visible.

A port of the "GitDiff" Xcode plugin to the Xcode 9 beta now that the Source editor has been implemented in Swift. It uses an extensible framework of generalised providers of line number gutter highlights with which it communicates using JSON IPC. This version of GitDiff includes the implementations for four types of line number highlighters:

  • Unstaged differences against a project's git repo
  • Highlight of changes committed in the last week
  • Format linting hints provided by swiftformat and clang-format
  • A viewer that makes explicit inferred types in declarations.

To use, clone this project and build target "LNXcodeSupport". You'll need to unsign your Xcode binary for the Xcode side of the plugin to load. The user interface is largely as it was before.

Icon

Lines that have been changed relative to the repo are highlighted in amber and new lines highlighted in blue. Code lint suggestions are highlighted in dark blue and lines with a recent commit to the repo (the last 7 days by default) are highlighted in light green, fading with time.

Hovering over a change or lint highlight will overlay the previous or suggested version over the source editor and if you would like to revert the code change or apply the lint suggestion, continue hovering over the highlight until a very small button appears and click on it. The plugin runs a menubar app that contains colour preferences and allows you to turn on and off individual highlights.

Icon

Expandability

The new implementation has been generalised to provide line number highlighting as a service from inside a new Legacy Xcode plugin. The project includes an menubar app "LNProvider" which is run to provide the default implementations using XPC. Any application can register with the plugin to provide line number highlights if it follows the Distributed Objects messaging protocol documented in "LNExtensionProtocol.h". Whenever a file is saved or reloaded, a call is made from the plugin to your application to provide JSON describing the intended highlights, their colours and any associated text. See the document "LineNumberPlugin.pages" for details about the architecture.

Code linting

This repo includes binary releases of swiftformat and clang-format under their respective licenses. To modify code linting preferences, edit the files swift_format.sh and clang_format.sh in the "FormatImpl" directory and rebuild the plugin.

探索相关项目

加载中…