Skip to content

Please add an example of how to use Swift Syntax with XcodeKit Source Editor Extensions #2276

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

Closed
Eric-Catalyst opened this issue Oct 11, 2023 · 5 comments
Labels
enhancement New feature or request

Comments

@Eric-Catalyst
Copy link

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.

@Eric-Catalyst Eric-Catalyst added the enhancement New feature or request label Oct 11, 2023
@ahoppen
Copy link
Member

ahoppen commented Oct 11, 2023

Tracked in Apple’s issue tracker as rdar://116782712

@ahoppen
Copy link
Member

ahoppen commented Oct 11, 2023

We do already have one: https://github.com/apple/swift-syntax/tree/main/EditorExtension

Is this what you were looking for?

@Eric-Catalyst
Copy link
Author

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?

@ahoppen
Copy link
Member

ahoppen commented Oct 12, 2023

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

@ahoppen ahoppen closed this as completed Oct 12, 2023
@Eric-Catalyst
Copy link
Author

Thanks for your attention and assistance.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants