{"action":"created","issue":{"url":"https://api.github.com/repos/Microsoft/TypeScript/issues/19725","repository_url":"https://api.github.com/repos/Microsoft/TypeScript","labels_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/19725/labels{/name}","comments_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/19725/comments","events_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/19725/events","html_url":"https://github.com/Microsoft/TypeScript/issues/19725","id":271125566,"number":19725,"title":"Enhancement request: Access to \"--diagnostics\" equivalent via the API","user":{"login":"mmorearty","id":207671,"avatar_url":"https://avatars1.githubusercontent.com/u/207671?v=4","gravatar_id":"","url":"https://api.github.com/users/mmorearty","html_url":"https://github.com/mmorearty","followers_url":"https://api.github.com/users/mmorearty/followers","following_url":"https://api.github.com/users/mmorearty/following{/other_user}","gists_url":"https://api.github.com/users/mmorearty/gists{/gist_id}","starred_url":"https://api.github.com/users/mmorearty/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mmorearty/subscriptions","organizations_url":"https://api.github.com/users/mmorearty/orgs","repos_url":"https://api.github.com/users/mmorearty/repos","events_url":"https://api.github.com/users/mmorearty/events{/privacy}","received_events_url":"https://api.github.com/users/mmorearty/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":7,"created_at":"2017-11-03T21:37:27Z","updated_at":"2017-11-03T23:04:28Z","closed_at":null,"author_association":"CONTRIBUTOR","body":"**TypeScript Version:**  2.7.0-dev.20171103\r\n\r\nEnhancement request: When running `tsc` from the command line, you can use `--diagnostics` to print some stats about the compilation — e.g. how many files were compiled; how many lines; how much time was taken by different phases of the compilation; and so on.\r\n\r\nIt would be nice if the same capabilities were exposed via the API. In other words, if I am writing a program that looks like this:\r\n\r\n```ts\r\nimport * as ts from \"typescript\";\r\n\r\nconst program = ts.createProgram(...);\r\nprogram.emit();\r\n```\r\n\r\nIt would be nice if I could then write something like this on the next line:\r\n\r\n```ts\r\nconst stats = ts.statistics();\r\n```\r\n\r\nThen I could do what I wanted with the stats — display them, analyze them, etc.\r\n\r\nCurrently, the `--diagnostics` functionality is entirely encapsulated inside `compiler/tsc.ts`, and as far as I can tell, that information is not available via the API."},"comment":{"url":"https://api.github.com/repos/Microsoft/TypeScript/issues/comments/341848273","html_url":"https://github.com/Microsoft/TypeScript/issues/19725#issuecomment-341848273","issue_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/19725","id":341848273,"user":{"login":"mhegazy","id":8000722,"avatar_url":"https://avatars3.githubusercontent.com/u/8000722?v=4","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},"created_at":"2017-11-03T23:04:28Z","updated_at":"2017-11-03T23:04:28Z","author_association":"CONTRIBUTOR","body":"> number of lines (but I realize there is ambiguity here — really I probably care about \"number of lines parsed, which is different)\r\n\r\nYou should know what files you are parsing on an update, we do have a lineMap property on the file, that should tell you how many lines are there. it is internal though, but we can expose it."}}
{"actor":{"display_login":"mhegazy"}}