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

JSON::ParserError with the following code #126

Closed
jpsim opened this issue Dec 26, 2014 · 4 comments
Closed

JSON::ParserError with the following code #126

jpsim opened this issue Dec 26, 2014 · 4 comments

Comments

@jpsim
Copy link
Collaborator

jpsim commented Dec 26, 2014

See #94 (comment)

@juangamnik let's resume in here for clarity.

/// Extends array via a shuffled function which returns a copy
/// of the array in randomized order.
extension Array {
    func shuffled() -> [T] {
        var list = self
        for i in 0..<(list.count - 1) {
            let j = Int(arc4random_uniform(UInt32(list.count - i))) + i
            swap(&list[i], &list[j])
        }
        return list
    }
}
@jpsim
Copy link
Collaborator Author

jpsim commented Dec 26, 2014

This was fixed in jpsim/SourceKitten@64df462 and has now landed in jazzy 0.0.19 which was just released and pushed to rubygems.

@jpsim jpsim closed this as completed Dec 26, 2014
@juangamnik
Copy link

Sorry, that I did not open a new issue for that. with v0.0.19 the build process finishes without errors, but the result is unexpected. The original documentation of the struct Array is shown instead of my documentation. Furthermore even undocumented extensions show up now and present the documentation of the extended originial class, too.

@juangamnik
Copy link

I just skimmed through the open issues and I think my prob is related to #76.

@jpsim
Copy link
Collaborator Author

jpsim commented Dec 26, 2014

Yes, extensions are currently rendered awkwardly, which we're tracking in #76.

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