jpsim / SourceKitten

An adorable little framework and command line tool for interacting with SourceKit.
MIT License
2.31k stars 226 forks source link

Handle key.educational_note_paths in SourceKit output #823

Closed johnfairh closed 1 month ago

johnfairh commented 1 month ago

We've never had straight arrays of strings before, this is new in Swift 6 ("key.educational_note_paths"):

{
  "\/Users\/johnf\/project\/JazzyEx\/JazzyEx\/JazzyEx.swift" : {
    "key.diagnostic_stage" : "source.diagnostic.stage.swift.parse",
    "key.diagnostics" : [
      {
        "key.column" : 12,
        "key.description" : "extraneous whitespace between attribute name and '('; this is an error in the Swift 6 language mode",
        "key.diagnostic_stage" : "source.diagnostic.stage.swift.parse",
        "key.educational_note_paths" : [
          "error-in-future-swift-version.md"
        ],
        "key.id" : "error_in_future_swift_version",
        "key.line" : 2,
        "key.severity" : "source.diagnostic.severity.warning"
      }
    ],
    "key.length" : 43,
...

Attempt refactor to remove the assumption causing the force-unwrap fail. New version runs the breaking code cleanly, passes the tests here, and also passes the full jazzy spec suite without breaking anything.

Fixes #821.