{"action":"created","issue":{"url":"https://api.github.com/repos/jpsim/SourceKitten/issues/295","repository_url":"https://api.github.com/repos/jpsim/SourceKitten","labels_url":"https://api.github.com/repos/jpsim/SourceKitten/issues/295/labels{/name}","comments_url":"https://api.github.com/repos/jpsim/SourceKitten/issues/295/comments","events_url":"https://api.github.com/repos/jpsim/SourceKitten/issues/295/events","html_url":"https://github.com/jpsim/SourceKitten/issues/295","id":187817800,"number":295,"title":"Get diagnostic information out of SourceKit responses","user":{"login":"pwntester","id":125701,"avatar_url":"https://avatars.githubusercontent.com/u/125701?v=3","gravatar_id":"","url":"https://api.github.com/users/pwntester","html_url":"https://github.com/pwntester","followers_url":"https://api.github.com/users/pwntester/followers","following_url":"https://api.github.com/users/pwntester/following{/other_user}","gists_url":"https://api.github.com/users/pwntester/gists{/gist_id}","starred_url":"https://api.github.com/users/pwntester/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pwntester/subscriptions","organizations_url":"https://api.github.com/users/pwntester/orgs","repos_url":"https://api.github.com/users/pwntester/repos","events_url":"https://api.github.com/users/pwntester/events{/privacy}","received_events_url":"https://api.github.com/users/pwntester/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":6,"created_at":"2016-11-07T20:25:25Z","updated_at":"2016-11-08T15:11:59Z","closed_at":null,"body":"Hi,\r\n\r\nWhen running XCode with `SOURCEKIT_LOGGING=3` I can see some diagnostic information being returned in the response:\r\n\r\n```\r\n  key.diagnostics: [\r\n    {\r\n      key.line: 3,\r\n      key.column: 16,\r\n      key.description: \"'loadItemForTypeIdentifier(_:options:completionHandler:)' has been renamed to 'loadItem(forTypeIdentifier:options:completionHandler:)'\",\r\n      key.filepath: \"/Users/alvaro/test/test.playground\",\r\n      key.severity: source.diagnostic.severity.error,\r\n      key.fixits: [\r\n        {\r\n          key.offset: 34,\r\n          key.length: 55,\r\n          key.sourcetext: \"loadItem\"\r\n        }\r\n      ],\r\n      key.diagnostic_stage: source.diagnostic.stage.swift.sema\r\n    }\r\n  ]\r\n```\r\n\r\nIm interested in getting this JSON but it doesnt seem to be included in any of the built-in commands. Could it be possible to include a new command to get this information?\r\n\r\nThanks,\r\nA"},"comment":{"url":"https://api.github.com/repos/jpsim/SourceKitten/issues/comments/259162508","html_url":"https://github.com/jpsim/SourceKitten/issues/295#issuecomment-259162508","issue_url":"https://api.github.com/repos/jpsim/SourceKitten/issues/295","id":259162508,"user":{"login":"pwntester","id":125701,"avatar_url":"https://avatars.githubusercontent.com/u/125701?v=3","gravatar_id":"","url":"https://api.github.com/users/pwntester","html_url":"https://github.com/pwntester","followers_url":"https://api.github.com/users/pwntester/followers","following_url":"https://api.github.com/users/pwntester/following{/other_user}","gists_url":"https://api.github.com/users/pwntester/gists{/gist_id}","starred_url":"https://api.github.com/users/pwntester/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pwntester/subscriptions","organizations_url":"https://api.github.com/users/pwntester/orgs","repos_url":"https://api.github.com/users/pwntester/repos","events_url":"https://api.github.com/users/pwntester/events{/privacy}","received_events_url":"https://api.github.com/users/pwntester/received_events","type":"User","site_admin":false},"created_at":"2016-11-08T15:11:59Z","updated_at":"2016-11-08T15:11:59Z","body":"No, but this is the request that Xcode sends to get the diagnostics data according to SurceKit logs:\r\n\r\n```\r\n2016-11-08 08:44:57.958 Xcode[19340:4918054] SourceKit-client: [2:request:1295:41896.4854] [93] {\r\n  key.request: source.request.editor.replacetext,\r\n  key.name: \"/Users/alvaro/Downloads/MyPlayground.playground\",\r\n  key.offset: 0,\r\n  key.length: 0,\r\n  key.sourcetext: \"\"\r\n}\r\n2016-11-08 08:44:57.959 Xcode[19340:4918054] SourceKit-client: [2:response:1295:41896.4860] [93] {\r\n  key.diagnostics: [\r\n    {\r\n      key.line: 1,\r\n      key.column: 34,\r\n      key.description: \"'loadItemForTypeIdentifier(_:options:completionHandler:)' has been renamed to 'loadItem(forTypeIdentifier:options:completionHandler:)'\",\r\n      key.filepath: \"/Users/alvaro/Downloads/MyPlayground.playground\",\r\n      key.severity: source.diagnostic.severity.error,\r\n      key.fixits: [\r\n        {\r\n          key.offset: 33,\r\n          key.length: 55,\r\n          key.sourcetext: \"loadItem\"\r\n        }\r\n      ],\r\n      key.diagnostic_stage: source.diagnostic.stage.swift.sema\r\n    }\r\n  ],\r\n  key.annotations: [\r\n    {\r\n      key.kind: source.lang.swift.ref.class,\r\n      key.offset: 18,\r\n      key.length: 14,\r\n      key.is_system: true\r\n    }\r\n  ],\r\n  key.diagnostic_stage: source.diagnostic.stage.swift.sema,\r\n  key.syntaxmap: [\r\n  ]\r\n}\r\n```\r\n\r\nIf Im correct these are request/response for request [93]\r\nDo you know if thats correct? Should I use a different request to get the diagnostics info?\r\n\r\nThanks,\r\nA"}}
{"actor":{"display_login":"pwntester"}}