-
Notifications
You must be signed in to change notification settings - Fork 414
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Symbolgraph extension symbols (#1372)
Support the `-emit-extension-block-symbols` mode which is used by default by SPM/Xcode since Swift 5.9.
- Loading branch information
Showing
10 changed files
with
161 additions
and
55 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
# frozen_string_literal: true | ||
|
||
module Jazzy | ||
module SymbolGraph | ||
# An ExtKey identifies an extension of a type, made up of the USR of | ||
# the type and the constraints of the extension. With Swift 5.9 extension | ||
# symbols, the USR is the 'fake' USR invented by symbolgraph to solve the | ||
# same problem as this type, which means less merging takes place. | ||
class ExtKey | ||
attr_accessor :usr | ||
attr_accessor :constraints_text | ||
|
||
def initialize(usr, constraints) | ||
self.usr = usr | ||
self.constraints_text = constraints.map(&:to_swift).join | ||
end | ||
|
||
def hash_key | ||
usr + constraints_text | ||
end | ||
|
||
def eql?(other) | ||
hash_key == other.hash_key | ||
end | ||
|
||
def hash | ||
hash_key.hash | ||
end | ||
end | ||
|
||
class ExtSymNode | ||
def ext_key | ||
ExtKey.new(usr, all_constraints.ext) | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.