{"action":"created","issue":{"url":"https://api.github.com/repos/Microsoft/TypeScript/issues/2454","labels_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/2454/labels{/name}","comments_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/2454/comments","events_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/2454/events","html_url":"https://github.com/Microsoft/TypeScript/issues/2454","id":63462908,"number":2454,"title":"getSemanticDiagnostics() returns an undefined \"diagnostic\" for definition files","user":{"login":"derekcicerone","id":1081904,"avatar_url":"https://avatars.githubusercontent.com/u/1081904?v=3","gravatar_id":"","url":"https://api.github.com/users/derekcicerone","html_url":"https://github.com/derekcicerone","followers_url":"https://api.github.com/users/derekcicerone/followers","following_url":"https://api.github.com/users/derekcicerone/following{/other_user}","gists_url":"https://api.github.com/users/derekcicerone/gists{/gist_id}","starred_url":"https://api.github.com/users/derekcicerone/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/derekcicerone/subscriptions","organizations_url":"https://api.github.com/users/derekcicerone/orgs","repos_url":"https://api.github.com/users/derekcicerone/repos","events_url":"https://api.github.com/users/derekcicerone/events{/privacy}","received_events_url":"https://api.github.com/users/derekcicerone/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/Microsoft/TypeScript/labels/API","name":"API","color":"bfe5bf"},{"url":"https://api.github.com/repos/Microsoft/TypeScript/labels/Bug","name":"Bug","color":"e11d21"}],"state":"open","locked":false,"assignee":{"login":"DanielRosenwasser","id":972891,"avatar_url":"https://avatars.githubusercontent.com/u/972891?v=3","gravatar_id":"","url":"https://api.github.com/users/DanielRosenwasser","html_url":"https://github.com/DanielRosenwasser","followers_url":"https://api.github.com/users/DanielRosenwasser/followers","following_url":"https://api.github.com/users/DanielRosenwasser/following{/other_user}","gists_url":"https://api.github.com/users/DanielRosenwasser/gists{/gist_id}","starred_url":"https://api.github.com/users/DanielRosenwasser/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DanielRosenwasser/subscriptions","organizations_url":"https://api.github.com/users/DanielRosenwasser/orgs","repos_url":"https://api.github.com/users/DanielRosenwasser/repos","events_url":"https://api.github.com/users/DanielRosenwasser/events{/privacy}","received_events_url":"https://api.github.com/users/DanielRosenwasser/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/Microsoft/TypeScript/milestones/7","html_url":"https://github.com/Microsoft/TypeScript/milestones/TypeScript%201.5","labels_url":"https://api.github.com/repos/Microsoft/TypeScript/milestones/7/labels","id":874650,"number":7,"title":"TypeScript 1.5","description":"","creator":{"login":"mhegazy","id":8000722,"avatar_url":"https://avatars.githubusercontent.com/u/8000722?v=3","gravatar_id":"","url":"https://api.github.com/users/mhegazy","html_url":"https://github.com/mhegazy","followers_url":"https://api.github.com/users/mhegazy/followers","following_url":"https://api.github.com/users/mhegazy/following{/other_user}","gists_url":"https://api.github.com/users/mhegazy/gists{/gist_id}","starred_url":"https://api.github.com/users/mhegazy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mhegazy/subscriptions","organizations_url":"https://api.github.com/users/mhegazy/orgs","repos_url":"https://api.github.com/users/mhegazy/repos","events_url":"https://api.github.com/users/mhegazy/events{/privacy}","received_events_url":"https://api.github.com/users/mhegazy/received_events","type":"User","site_admin":false},"open_issues":24,"closed_issues":143,"state":"open","created_at":"2014-11-20T18:06:13Z","updated_at":"2015-03-24T01:27:40Z","due_on":null,"closed_at":null},"comments":15,"created_at":"2015-03-21T22:51:31Z","updated_at":"2015-03-24T01:36:53Z","closed_at":null,"body":"I just updated to the latest master (1.5) language services code and I noticed that calling getSemanticDiagnostics() for a definition (.d.ts) file is returning an undefined \"diagnostic\". Seems like a possible regression unless I shouldn't be calling that function for definition files perhaps?"},"comment":{"url":"https://api.github.com/repos/Microsoft/TypeScript/issues/comments/85283341","html_url":"https://github.com/Microsoft/TypeScript/issues/2454#issuecomment-85283341","issue_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/2454","id":85283341,"user":{"login":"derekcicerone","id":1081904,"avatar_url":"https://avatars.githubusercontent.com/u/1081904?v=3","gravatar_id":"","url":"https://api.github.com/users/derekcicerone","html_url":"https://github.com/derekcicerone","followers_url":"https://api.github.com/users/derekcicerone/followers","following_url":"https://api.github.com/users/derekcicerone/following{/other_user}","gists_url":"https://api.github.com/users/derekcicerone/gists{/gist_id}","starred_url":"https://api.github.com/users/derekcicerone/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/derekcicerone/subscriptions","organizations_url":"https://api.github.com/users/derekcicerone/orgs","repos_url":"https://api.github.com/users/derekcicerone/repos","events_url":"https://api.github.com/users/derekcicerone/events{/privacy}","received_events_url":"https://api.github.com/users/derekcicerone/received_events","type":"User","site_admin":false},"created_at":"2015-03-24T01:36:53Z","updated_at":"2015-03-24T01:36:53Z","body":"Ok, I think I found the bug:\r\n```\r\nfunction getDeclarationDiagnosticsForFile(sourceFile: SourceFile): Diagnostic[] {\r\n            if (!isDeclarationFile(sourceFile)) {\r\n                let resolver = getDiagnosticsProducingTypeChecker().getEmitResolver(sourceFile);\r\n                // Don't actually write any files since we're just getting diagnostics.\r\n                var writeFile: WriteFileCallback = () => { };\r\n                return ts.getDeclarationDiagnostics(getEmitHost(writeFile), resolver, sourceFile);\r\n            }\r\n        }\r\n```\r\n\r\nThis returns undefined for declaration files."}}