Please add an example of how to use Swift Syntax with XcodeKit Source Editor Extensions
Closed this issue · 5 comments
Description
The most natural use case for Swift Syntax would be parsing code being extracted and updated in an Xcode Source Editor Extension. Please add an example of this case.
Tracked in Apple’s issue tracker as rdar://116782712
We do already have one: https://github.com/apple/swift-syntax/tree/main/EditorExtension
Is this what you were looking for?
Yes, I think that will do it. I was looking in the Examples directory, so missed the extension. Might be helpful to mention it in the main read me.
The extension itself needs a little attention as it has the following build issue when built with Xcode 15:
ld: warning: object file (/Applications/Xcode.app/Contents/Developer/usr/lib/libXcodeExtension.a[x86_64][2](libXcodeExtension.a-x86_64-master.o)) was built for newer 'macOS' version (13.0) than being linked (11.0)
Should this be a separate issue?
Might be helpful to mention it in the main read me.
I don’t think that’s all too useful. There exists documentation of how to build an Xcode source editor extension and depending on swift-syntax should just be a matter of adding swift-syntax to your package dependencies.
Should this be a separate issue?
Thanks for noting. Fixing it in #2277
Thanks for your attention and assistance.