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

Feature request: Parse swiftinterface files #106

Open
2 tasks done
tjprescott opened this issue Aug 25, 2021 · 2 comments
Open
2 tasks done

Feature request: Parse swiftinterface files #106

tjprescott opened this issue Aug 25, 2021 · 2 comments

Comments

@tjprescott
Copy link

🚨New Issue Checklist🚨

  • Updated swift-ast to the latest version
  • I am aware that the swift-ast -github-issue /path/to/file.swift might help me generate this file

Issue Summary

I am using swift-ast to parse Swift source code, and for that, it works great. However, I also need to be able to parse *.swiftinterface files, as that is what I can generate from Objective-C headers. Since I only care about the public interface, this is ideal. However, I can't parse these files with swift-ast because it exits with a DiagnosticStopper error.

I've had to try modifying the swiftinterface files to make them "look" like compilable Swift, for example, by adding empty brackets {} after function declarations. In this way I've been able to hackily use swift-ast for my purposes, but it's much too brittle to be effective.

I tried using SourceKitten directly to examine the structure, which was very promising as it works the same for swift and swiftinterface, but unfortunately it seems to be missing a bunch of stuff that I am currently able to get from swift-ast.

Reproduction Steps

Run swift-ast on any *.swiftinterface file

Expected Result

Code is parsed and I can navigate the tree, albeit with less detail.

Actual Behavior

DiagnosticStopped exit.

@ryuichi-assistant
Copy link

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates.

Please make sure to update to the latest version and check if that solves the issue. Let us know if that works for you by adding a comment.

@tjprescott
Copy link
Author

This has not been addressed. I have a private fork where I made this work for my use case,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants