Xcode 6.1.1: SourceKit treats public declarations as private

Originator:jp
Number:rdar://19274339 Date Originated:16-Dec-2014 07:31 PM
Status:Closed Resolved:13-Feb-2015 11:00 AM
Product:Developer Tools Product Version:Xcode 6.1.1 (6A2008a)
Classification:Other Bug Reproducible:Always
 
Summary:
SourceKit incorrectly adds a `source.decl.attribute.private` attribute to public declarations.

Steps to Reproduce:
1. Launch Xcode with the environment variable `SOURCEKIT_LOGGING=3` (e.g. by launching from the command line with `export SOURCEKIT_LOGGING=3 && /Applications/Xcode.app/Contents/MacOS/Xcode`)
2. Open a Swift file with a declaration using the `public` access control modifier (e.g. the attached sourcekit_acl_bug.swift file)
3. Look at the SourceKit logs (you should see the attached sourcekit_acl_bug.json output in your SourceKit logs)

Expected Results:
public declarations should have an attribute of `source.decl.attribute.public`

Actual Results:
public declarations have an attribute of `source.decl.attribute.private`

Regression:
All versions of Xcode that I could test exhibit this behavior.

Notes:
This functionality would be very useful for 3rd parties integrating with SourceKit. For example, the jazzy documentation generator (https://github.com/realm/jazzy) has to rely on regular expressions to detect the access control level of declarations, which causes many mis-categorizations.

Comments

This is now fixed as of Xcode 6.3b1.

Duplicate of rdar://18326724


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!