{"action":"opened","issue":{"url":"https://api.github.com/repos/realm/jazzy/issues/654","repository_url":"https://api.github.com/repos/realm/jazzy","labels_url":"https://api.github.com/repos/realm/jazzy/issues/654/labels{/name}","comments_url":"https://api.github.com/repos/realm/jazzy/issues/654/comments","events_url":"https://api.github.com/repos/realm/jazzy/issues/654/events","html_url":"https://github.com/realm/jazzy/issues/654","id":176770891,"number":654,"title":"Check for `available` attribute before logging \"no usr\" warning","user":{"login":"jpsim","id":474794,"avatar_url":"https://avatars.githubusercontent.com/u/474794?v=3","gravatar_id":"","url":"https://api.github.com/users/jpsim","html_url":"https://github.com/jpsim","followers_url":"https://api.github.com/users/jpsim/followers","following_url":"https://api.github.com/users/jpsim/following{/other_user}","gists_url":"https://api.github.com/users/jpsim/gists{/gist_id}","starred_url":"https://api.github.com/users/jpsim/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jpsim/subscriptions","organizations_url":"https://api.github.com/users/jpsim/orgs","repos_url":"https://api.github.com/users/jpsim/repos","events_url":"https://api.github.com/users/jpsim/events{/privacy}","received_events_url":"https://api.github.com/users/jpsim/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/realm/jazzy/labels/bug","name":"bug","color":"fc2929"},{"url":"https://api.github.com/repos/realm/jazzy/labels/d1:easy","name":"d1:easy","color":"00BB4D"}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-09-13T22:51:15Z","updated_at":"2016-09-13T22:51:15Z","closed_at":null,"body":"If a declaration is marked `@available(..., unavailable, ...)` like [this](https://github.com/realm/realm-cocoa/blob/c508dee7e99411e74370de7dda89461c1688c611/RealmSwift/LinkingObjects.swift#L428-L429), it won't have a USR and that's not a jazzy bug. For example:\r\n\r\n```swift\r\n@available(*, unavailable, renamed:\"isInvalidated\")\r\npublic var invalidated : Bool { fatalError() }\r\n```\r\n\r\nmakes jazzy log the following:\r\n\r\n```\r\n`invalidated` has no USR. First make sure all modules used in your project have been imported. If all used modules are imported, please report this problem by filing an issue at https://github.com/realm/jazzy/issues along with your Xcode project. If this token is declared in an `#if` block, please ignore this message.\r\n```\r\n\r\n---\r\n\r\nWe can skip the warning log if we find the `available` attribute, which these declarations have:\r\n\r\n```json\r\n{\r\n  \"key.bodylength\" : 14,\r\n  \"key.nameoffset\" : 16971,\r\n  \"key.offset\" : 16967,\r\n  \"key.accessibility\" : \"source.lang.swift.accessibility.public\",\r\n  \"key.length\" : 21,\r\n  \"key.typename\" : \"Bool\",\r\n  \"key.name\" : \"invalidated\",\r\n  \"key.bodyoffset\" : 16990,\r\n  \"key.attributes\" : [\r\n    {\r\n      \"key.attribute\" : \"source.decl.attribute.available\"\r\n    }\r\n  ],\r\n  \"key.kind\" : \"source.lang.swift.decl.var.instance\",\r\n  \"key.namelength\" : 11\r\n}\r\n```"}}
{"actor":{"display_login":"jpsim"}}