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

sourcekitten is crashing on my Swift project #14

Closed
ndbroadbent opened this issue Dec 20, 2014 · 8 comments
Closed

sourcekitten is crashing on my Swift project #14

ndbroadbent opened this issue Dec 20, 2014 · 8 comments

Comments

@ndbroadbent
Copy link

I opened an issue on Jazzy before realizing that the stack trace points to sourcekitten.

Here's the crash log: https://gist.github.com/ndbroadbent/112350ea5f4cebc6b84e

Thanks!

@jpsim
Copy link
Owner

jpsim commented Dec 20, 2014

Looks like Spot.swift, Comment.swift and User.swift are all failing. Could you post the contents of those files here?

@jpsim
Copy link
Owner

jpsim commented Dec 20, 2014

I've pushed a fix to sourcekitten
1aa5f28, hopefully). I'd love to know if this allows docs to be built for your project (despite skipping Spot.swift, Comment.swift & User.swift).

You can install sourcekitten from master by running ./install.sh. Then run sourcekitten > MyProject.jazzy.json in the root of your project. Then you can run jazzy -s MyProject.jazzy.json to use that output.

@ndbroadbent
Copy link
Author

Hey, thanks for your help so far! I tried out 1aa5f28, but I'm still getting a crash. Here's the new crash logs: https://gist.github.com/ndbroadbent/527839925d5384c6bebc

Here's the source for Spot.swift, Comment.swift & User.swift: https://gist.github.com/ndbroadbent/3cce33c971f9340afda6

@jpsim
Copy link
Owner

jpsim commented Dec 23, 2014

@ndbroadbent I made a stupid mistake, printing an optional before unwrapping it. I just pushed jazzy 0.0.18 to rubygems, which should skip files that sourcekitten can't parse correctly, so your docs should build if you use that version.

I'll investigate why Spot.swift, Comment.swift & User.swift don't parse. At first, I thought they were failing because they all use @NSManaged, but other files using that are correctly parsed (see https://gist.github.com/ndbroadbent/112350ea5f4cebc6b84e#file-jazzy_crash-log-L8762-L8785).

@ndbroadbent
Copy link
Author

Sorry, I don't think it is fixed yet. It might be easier if I add your username to our GitHub organization so you can check out the repo and reproduce. Please feel free to accept the invite and checkout https://github.com/hdwr/hdwr-ios

@jpsim
Copy link
Owner

jpsim commented Dec 25, 2014

Thanks for the access, @ndbroadbent! Your project proved very useful in making sourcekitten/jazzy safer since it has a lot of code, yet no documentation comments, so it hit a lot of previously untested code.

Your project is properly parsed as of sourcekitten 0.2.5 and jazzy master (not pushed to rubygems yet), but as I mentioned, yields mostly empty docs since there are no documentation comments.

To add docs to your project, I'd recommend you read http://nshipster.com/swift-documentation/ to learn more about Swift's documentation comment format.

@jpsim
Copy link
Owner

jpsim commented Dec 25, 2014

@ndbroadbent and I just fixed the crash causing Spot.swift, Comment.swift & User.swift to not parse (see 79744a1). So I'm closing this issue 😄.

Thank you very much for your help in improving jazzy/sourcekitten!

PS: I just left the HDWR GitHub org.

@jpsim jpsim closed this as completed Dec 25, 2014
@ndbroadbent
Copy link
Author

@jpsim thanks very much for fixing! Hehe sorry my project didn't have any documentation yet, that must have been a curveball. About to go through and add a bunch of docs now that jazzy is up and running :)

Thanks again, and Merry Christmas!

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

No branches or pull requests

2 participants