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

fatal error: Unsupported CXCursorKind value #374

Closed
lumaxis opened this issue Nov 16, 2015 · 6 comments
Closed

fatal error: Unsupported CXCursorKind value #374

lumaxis opened this issue Nov 16, 2015 · 6 comments
Assignees
Labels
Milestone

Comments

@lumaxis
Copy link

lumaxis commented Nov 16, 2015

Hey there! :)

I'm just trying to give jazzy a spin and see if it could be a fitting replacement for our current documentation workflow. Unfortunately, I'm running into this error:

fatal error: Unsupported CXCursorKind value: 2: file
/Users/jp/Projects/jazzy/SourceKitten/Source/SourceKittenFramework/ObjCDeclarationKind.swift, line 55

This is what's in my .jazzy.yaml:

objc_mode: true
clean: true
xcodebuild_arguments: [--objc, Classes/HockeySDK.h, -x, objective-c, -isysroot, /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator9.1.sdk, -I, /Users/lukas/Work/HockeySDK-iOS]
umbrella_header: Classes/HockeySDK.h
framework_root: .

Can you help me make this work? Thanks! I really like what I've seen so far of Jazzy.

Side questions:

  • What's the exact semantics of framework_root? Should that point to where the source files are or we're for example the .xcodeproj file is?
  • Is there already a list of all possible keys for thr .jazzy.yaml?
@pcantrell
Copy link
Collaborator

Can’t help with the other questions, but you can get a full description of configuration keys with jazzy --help config.

@lumaxis
Copy link
Author

lumaxis commented Nov 16, 2015

@pcantrell Oh, that's perfect! Totally overlooked it. Thanks.

@jpsim
Copy link
Collaborator

jpsim commented Nov 16, 2015

Thanks for trying out jazzy. ObjC support is still pretty basic at the moment, so please bear with me as I explain what's happening here, and fix your issue while you're at it!

1) Unsupported CXCursorKind value: 2

Jazzy uses libClang to parse documentation in Objective-C, and the way it's implemented right now, each "cursor kind" (i.e. declaration type) has to be whitelisted explicitly.

In your case, jazzy is encountering C-style structs & struct fields and those types haven't been enabled yet. jpsim/SourceKitten#100 fixes that.

2) What are the exact semantics of framework_root?

Right now the Objective-C API is really unforgiving. libClang needs the same compiler arguments as Xcode would provide in order to resolve all headers & frameworks. I have plans to automate this in the future (jpsim/SourceKitten#88) but I haven't gotten to that yet.

So I added framework_root and umbrella_header to generate clang compiler arguments for simple OS X ObjC projects with no dependencies, but that's really just temporary.

In other words, specifying umbrella_header and framework_root in your .jazzy.yaml file is superfluous, because you've already specified those in the xcodebuild_arguments.

@jpsim
Copy link
Collaborator

jpsim commented Nov 16, 2015

#375 adds support for C-style structs and struct fields when documenting Objective-C projects. With the following .jazzy.yaml file:

objc_mode: true
clean: true
xcodebuild_arguments: [--objc, Classes/HockeySDK.h, -x, objective-c, -isysroot, /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator9.1.sdk, -I, /Users/lukas/Work/HockeySDK-iOS]

I generated the following docs for HockeySDK: http://static.realm.io/jazzy_demo/HockeySDK/

@lumaxis
Copy link
Author

lumaxis commented Nov 16, 2015

Holy crap, @jpsim, you should get a 🏆 for fastest turnaround time on a fix! Thank you so much ☺️

@jpsim
Copy link
Collaborator

jpsim commented Nov 16, 2015

😄 glad I could help! Honestly, the ObjC interface to Jazzy is pretty janky right now so I feel like the least I can do is help people out.

@pigeondev2 pigeondev2 modified the milestone: The Past Nov 22, 2016
@pigeondev2 pigeondev2 added the bug label Nov 23, 2016
@pigeondev2 pigeondev2 assigned pcantrell and jpsim and unassigned pcantrell Nov 23, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants