jpsim / SourceKitten

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

SourceKit asynchronous requests #759

Closed Mx-Iris closed 1 year ago

Mx-Iris commented 1 year ago

Why isn't there an interface for asynchronous requests? I looked around and the SourceKit function does exist, but it doesn't call callbacks when I actually use it.

jpsim commented 1 year ago

Does this work for you? https://github.com/jpsim/SourceKitten/compare/jp-async-send

Sample usage:

let request = SourceKittenFramework.Request.compilerVersion
print(toJSON(toNSDictionary(try await request.asyncSend())))
Mx-Iris commented 1 year ago

Does this work for you? https://github.com/jpsim/SourceKitten/compare/jp-async-send

Sample usage:

let request = SourceKittenFramework.Request.compilerVersion
print(toJSON(toNSDictionary(try await request.asyncSend())))

Yes, it is working and much faster, please consider merging into the main branch, thanks! You can close the issue