Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle key.educational_note_paths in SourceKit output #823

Merged
merged 1 commit into from
Oct 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,22 @@
## Main

#### Breaking

* None.

#### Enhancements

* Build without warnings with Swift 6 compiler.
[SimplyDanny](https://github.com/SimplyDanny)

* Generate docs cleanly with Swift 6 compiler.
[John Fairhurst](https://github.com/johnfairh)
[#821]((https://github.com/realm/SourceKitten/issues/821)

#### Bug Fixes

* None.

## 0.36.0

##### Breaking
Expand Down
20 changes: 10 additions & 10 deletions Source/SourceKittenFramework/JSONOutput.swift
Original file line number Diff line number Diff line change
Expand Up @@ -43,28 +43,28 @@ public func toJSON(_ object: Any, options: JSONSerialization.WritingOptions? = n
- returns: JSON-serializable value.
*/
public func toNSDictionary(_ dictionary: [String: SourceKitRepresentable]) -> NSDictionary {
var anyDictionary = [String: Any]()
for (key, object) in dictionary {
func toNSDictionaryValue(_ object: SourceKitRepresentable) -> Any {
switch object {
case let object as [SourceKitRepresentable]:
anyDictionary[key] = object.map { toNSDictionary($0 as! [String: SourceKitRepresentable]) }
return object.map { toNSDictionaryValue($0) }
case let object as [[String: SourceKitRepresentable]]:
anyDictionary[key] = object.map { toNSDictionary($0) }
return object.map { toNSDictionary($0) }
case let object as [String: SourceKitRepresentable]:
anyDictionary[key] = toNSDictionary(object)
return toNSDictionary(object)
case let object as String:
anyDictionary[key] = object
return object
case let object as Int64:
anyDictionary[key] = NSNumber(value: object)
return NSNumber(value: object)
case let object as Bool:
anyDictionary[key] = NSNumber(value: object)
return NSNumber(value: object)
case let object as Any:
anyDictionary[key] = object
return object
default:
fatalError("Should never happen because we've checked all SourceKitRepresentable types")
}
}
return anyDictionary.bridge()

return dictionary.mapValues(toNSDictionaryValue).bridge()
}

#if !os(Linux)
Expand Down
Loading