{"action":"created","comment":{"url":"https://api.github.com/repos/Perryvw/TypescriptToLua/pulls/comments/211395719","pull_request_review_id":147808179,"id":211395719,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIxMTM5NTcxOQ==","diff_hunk":"@@ -11,42 +11,96 @@ import { LuaLibImportKind, LuaTarget, LuaTranspiler, TranspileError } from \"./Tr\n \n export function compile(argv: string[]): void {\n     const commandLine = parseCommandLine(argv);\n-    compileFilesWithOptions(commandLine.fileNames, commandLine.options);\n+    /* istanbul ignore if: tested in test/compiler/watchmode.spec with subproccess */\n+    if (commandLine.options.watch) {\n+        watchWithOptions(commandLine.fileNames, commandLine.options);\n+    } else {\n+        compileFilesWithOptions(commandLine.fileNames, commandLine.options);\n+    }\n }\n \n-export function compileFilesWithOptions(fileNames: string[], options: CompilerOptions): void {\n-    if (!options.luaTarget) {\n-        options.luaTarget = LuaTarget.LuaJIT;\n+/* istanbul ignore next: tested in test/compiler/watchmode.spec with subproccess */\n+export function watchWithOptions(fileNames: string[], options: CompilerOptions): void {\n+    let host: ts.WatchCompilerHost<ts.SemanticDiagnosticsBuilderProgram>;\n+    let config = false;\n+    if (options.project) {\n+        config = true;\n+        host = ts.createWatchCompilerHost(\n+            options.project,\n+            options,\n+            ts.sys,\n+            ts.createSemanticDiagnosticsBuilderProgram\n+        );\n+    } else {\n+        host = ts.createWatchCompilerHost(\n+            fileNames,\n+            options,\n+            ts.sys,\n+            ts.createSemanticDiagnosticsBuilderProgram\n+        );\n+    }\n+\n+    const errorDiagnostic: ts.Diagnostic = {","path":"src/Compiler.ts","position":37,"original_position":37,"commit_id":"fcfb68029ab20f6a49b03aad317fd0ce735c0109","original_commit_id":"fcfb68029ab20f6a49b03aad317fd0ce735c0109","user":{"login":"Perryvw","id":7956873,"node_id":"MDQ6VXNlcjc5NTY4NzM=","avatar_url":"https://avatars1.githubusercontent.com/u/7956873?v=4","gravatar_id":"","url":"https://api.github.com/users/Perryvw","html_url":"https://github.com/Perryvw","followers_url":"https://api.github.com/users/Perryvw/followers","following_url":"https://api.github.com/users/Perryvw/following{/other_user}","gists_url":"https://api.github.com/users/Perryvw/gists{/gist_id}","starred_url":"https://api.github.com/users/Perryvw/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Perryvw/subscriptions","organizations_url":"https://api.github.com/users/Perryvw/orgs","repos_url":"https://api.github.com/users/Perryvw/repos","events_url":"https://api.github.com/users/Perryvw/events{/privacy}","received_events_url":"https://api.github.com/users/Perryvw/received_events","type":"User","site_admin":false},"body":"I would prefer you create this and immediately fill in the correct values in `afterProgramCreate` since it's not used anywhere else.","created_at":"2018-08-20T20:24:47Z","updated_at":"2018-08-20T20:27:40Z","html_url":"https://github.com/Perryvw/TypescriptToLua/pull/175#discussion_r211395719","pull_request_url":"https://api.github.com/repos/Perryvw/TypescriptToLua/pulls/175","author_association":"OWNER","_links":{"self":{"href":"https://api.github.com/repos/Perryvw/TypescriptToLua/pulls/comments/211395719"},"html":{"href":"https://github.com/Perryvw/TypescriptToLua/pull/175#discussion_r211395719"},"pull_request":{"href":"https://api.github.com/repos/Perryvw/TypescriptToLua/pulls/175"}}},"pull_request":{"url":"https://api.github.com/repos/Perryvw/TypescriptToLua/pulls/175","id":209362042,"node_id":"MDExOlB1bGxSZXF1ZXN0MjA5MzYyMDQy","html_url":"https://github.com/Perryvw/TypescriptToLua/pull/175","diff_url":"https://github.com/Perryvw/TypescriptToLua/pull/175.diff","patch_url":"https://github.com/Perryvw/TypescriptToLua/pull/175.patch","issue_url":"https://api.github.com/repos/Perryvw/TypescriptToLua/issues/175","number":175,"state":"open","locked":false,"title":"Added experimental watch mode","user":{"login":"lolleko","id":4759511,"node_id":"MDQ6VXNlcjQ3NTk1MTE=","avatar_url":"https://avatars2.githubusercontent.com/u/4759511?v=4","gravatar_id":"","url":"https://api.github.com/users/lolleko","html_url":"https://github.com/lolleko","followers_url":"https://api.github.com/users/lolleko/followers","following_url":"https://api.github.com/users/lolleko/following{/other_user}","gists_url":"https://api.github.com/users/lolleko/gists{/gist_id}","starred_url":"https://api.github.com/users/lolleko/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lolleko/subscriptions","organizations_url":"https://api.github.com/users/lolleko/orgs","repos_url":"https://api.github.com/users/lolleko/repos","events_url":"https://api.github.com/users/lolleko/events{/privacy}","received_events_url":"https://api.github.com/users/lolleko/received_events","type":"User","site_admin":false},"body":"Added support for tsc flags `-w`/`--watch`\r\n\r\nThe watch mode is currently not really incremental and will emit the whole project if a file is changed.\r\nSee #174","created_at":"2018-08-19T14:11:12Z","updated_at":"2018-08-20T20:27:40Z","closed_at":null,"merged_at":null,"merge_commit_sha":"f5dd0b4238f79e998d99a0bad6dc2cb17295893f","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/Perryvw/TypescriptToLua/pulls/175/commits","review_comments_url":"https://api.github.com/repos/Perryvw/TypescriptToLua/pulls/175/comments","review_comment_url":"https://api.github.com/repos/Perryvw/TypescriptToLua/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Perryvw/TypescriptToLua/issues/175/comments","statuses_url":"https://api.github.com/repos/Perryvw/TypescriptToLua/statuses/fcfb68029ab20f6a49b03aad317fd0ce735c0109","head":{"label":"Perryvw:feature/watch-mode","ref":"feature/watch-mode","sha":"fcfb68029ab20f6a49b03aad317fd0ce735c0109","user":{"login":"Perryvw","id":7956873,"node_id":"MDQ6VXNlcjc5NTY4NzM=","avatar_url":"https://avatars1.githubusercontent.com/u/7956873?v=4","gravatar_id":"","url":"https://api.github.com/users/Perryvw","html_url":"https://github.com/Perryvw","followers_url":"https://api.github.com/users/Perryvw/followers","following_url":"https://api.github.com/users/Perryvw/following{/other_user}","gists_url":"https://api.github.com/users/Perryvw/gists{/gist_id}","starred_url":"https://api.github.com/users/Perryvw/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Perryvw/subscriptions","organizations_url":"https://api.github.com/users/Perryvw/orgs","repos_url":"https://api.github.com/users/Perryvw/repos","events_url":"https://api.github.com/users/Perryvw/events{/privacy}","received_events_url":"https://api.github.com/users/Perryvw/received_events","type":"User","site_admin":false},"repo":{"id":115876595,"node_id":"MDEwOlJlcG9zaXRvcnkxMTU4NzY1OTU=","name":"TypescriptToLua","full_name":"Perryvw/TypescriptToLua","owner":{"login":"Perryvw","id":7956873,"node_id":"MDQ6VXNlcjc5NTY4NzM=","avatar_url":"https://avatars1.githubusercontent.com/u/7956873?v=4","gravatar_id":"","url":"https://api.github.com/users/Perryvw","html_url":"https://github.com/Perryvw","followers_url":"https://api.github.com/users/Perryvw/followers","following_url":"https://api.github.com/users/Perryvw/following{/other_user}","gists_url":"https://api.github.com/users/Perryvw/gists{/gist_id}","starred_url":"https://api.github.com/users/Perryvw/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Perryvw/subscriptions","organizations_url":"https://api.github.com/users/Perryvw/orgs","repos_url":"https://api.github.com/users/Perryvw/repos","events_url":"https://api.github.com/users/Perryvw/events{/privacy}","received_events_url":"https://api.github.com/users/Perryvw/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Perryvw/TypescriptToLua","description":"Typescript to lua transpiler.","fork":false,"url":"https://api.github.com/repos/Perryvw/TypescriptToLua","forks_url":"https://api.github.com/repos/Perryvw/TypescriptToLua/forks","keys_url":"https://api.github.com/repos/Perryvw/TypescriptToLua/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Perryvw/TypescriptToLua/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Perryvw/TypescriptToLua/teams","hooks_url":"https://api.github.com/repos/Perryvw/TypescriptToLua/hooks","issue_events_url":"https://api.github.com/repos/Perryvw/TypescriptToLua/issues/events{/number}","events_url":"https://api.github.com/repos/Perryvw/TypescriptToLua/events","assignees_url":"https://api.github.com/repos/Perryvw/TypescriptToLua/assignees{/user}","branches_url":"https://api.github.com/repos/Perryvw/TypescriptToLua/branches{/branch}","tags_url":"https://api.github.com/repos/Perryvw/TypescriptToLua/tags","blobs_url":"https://api.github.com/repos/Perryvw/TypescriptToLua/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Perryvw/TypescriptToLua/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Perryvw/TypescriptToLua/git/refs{/sha}","trees_url":"https://api.github.com/repos/Perryvw/TypescriptToLua/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Perryvw/TypescriptToLua/statuses/{sha}","languages_url":"https://api.github.com/repos/Perryvw/TypescriptToLua/languages","stargazers_url":"https://api.github.com/repos/Perryvw/TypescriptToLua/stargazers","contributors_url":"https://api.github.com/repos/Perryvw/TypescriptToLua/contributors","subscribers_url":"https://api.github.com/repos/Perryvw/TypescriptToLua/subscribers","subscription_url":"https://api.github.com/repos/Perryvw/TypescriptToLua/subscription","commits_url":"https://api.github.com/repos/Perryvw/TypescriptToLua/commits{/sha}","git_commits_url":"https://api.github.com/repos/Perryvw/TypescriptToLua/git/commits{/sha}","comments_url":"https://api.github.com/repos/Perryvw/TypescriptToLua/comments{/number}","issue_comment_url":"https://api.github.com/repos/Perryvw/TypescriptToLua/issues/comments{/number}","contents_url":"https://api.github.com/repos/Perryvw/TypescriptToLua/contents/{+path}","compare_url":"https://api.github.com/repos/Perryvw/TypescriptToLua/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Perryvw/TypescriptToLua/merges","archive_url":"https://api.github.com/repos/Perryvw/TypescriptToLua/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Perryvw/TypescriptToLua/downloads","issues_url":"https://api.github.com/repos/Perryvw/TypescriptToLua/issues{/number}","pulls_url":"https://api.github.com/repos/Perryvw/TypescriptToLua/pulls{/number}","milestones_url":"https://api.github.com/repos/Perryvw/TypescriptToLua/milestones{/number}","notifications_url":"https://api.github.com/repos/Perryvw/TypescriptToLua/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Perryvw/TypescriptToLua/labels{/name}","releases_url":"https://api.github.com/repos/Perryvw/TypescriptToLua/releases{/id}","deployments_url":"https://api.github.com/repos/Perryvw/TypescriptToLua/deployments","created_at":"2017-12-31T17:26:03Z","updated_at":"2018-08-20T16:35:58Z","pushed_at":"2018-08-20T16:36:00Z","git_url":"git://github.com/Perryvw/TypescriptToLua.git","ssh_url":"git@github.com:Perryvw/TypescriptToLua.git","clone_url":"https://github.com/Perryvw/TypescriptToLua.git","svn_url":"https://github.com/Perryvw/TypescriptToLua","homepage":null,"size":957,"stargazers_count":46,"watchers_count":46,"language":"TypeScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":12,"mirror_url":null,"archived":false,"open_issues_count":15,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":12,"open_issues":15,"watchers":46,"default_branch":"master"}},"base":{"label":"Perryvw:master","ref":"master","sha":"60f43a4a5d6147290e6064f2ec190f07c11a0b45","user":{"login":"Perryvw","id":7956873,"node_id":"MDQ6VXNlcjc5NTY4NzM=","avatar_url":"https://avatars1.githubusercontent.com/u/7956873?v=4","gravatar_id":"","url":"https://api.github.com/users/Perryvw","html_url":"https://github.com/Perryvw","followers_url":"https://api.github.com/users/Perryvw/followers","following_url":"https://api.github.com/users/Perryvw/following{/other_user}","gists_url":"https://api.github.com/users/Perryvw/gists{/gist_id}","starred_url":"https://api.github.com/users/Perryvw/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Perryvw/subscriptions","organizations_url":"https://api.github.com/users/Perryvw/orgs","repos_url":"https://api.github.com/users/Perryvw/repos","events_url":"https://api.github.com/users/Perryvw/events{/privacy}","received_events_url":"https://api.github.com/users/Perryvw/received_events","type":"User","site_admin":false},"repo":{"id":115876595,"node_id":"MDEwOlJlcG9zaXRvcnkxMTU4NzY1OTU=","name":"TypescriptToLua","full_name":"Perryvw/TypescriptToLua","owner":{"login":"Perryvw","id":7956873,"node_id":"MDQ6VXNlcjc5NTY4NzM=","avatar_url":"https://avatars1.githubusercontent.com/u/7956873?v=4","gravatar_id":"","url":"https://api.github.com/users/Perryvw","html_url":"https://github.com/Perryvw","followers_url":"https://api.github.com/users/Perryvw/followers","following_url":"https://api.github.com/users/Perryvw/following{/other_user}","gists_url":"https://api.github.com/users/Perryvw/gists{/gist_id}","starred_url":"https://api.github.com/users/Perryvw/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Perryvw/subscriptions","organizations_url":"https://api.github.com/users/Perryvw/orgs","repos_url":"https://api.github.com/users/Perryvw/repos","events_url":"https://api.github.com/users/Perryvw/events{/privacy}","received_events_url":"https://api.github.com/users/Perryvw/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Perryvw/TypescriptToLua","description":"Typescript to lua transpiler.","fork":false,"url":"https://api.github.com/repos/Perryvw/TypescriptToLua","forks_url":"https://api.github.com/repos/Perryvw/TypescriptToLua/forks","keys_url":"https://api.github.com/repos/Perryvw/TypescriptToLua/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Perryvw/TypescriptToLua/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Perryvw/TypescriptToLua/teams","hooks_url":"https://api.github.com/repos/Perryvw/TypescriptToLua/hooks","issue_events_url":"https://api.github.com/repos/Perryvw/TypescriptToLua/issues/events{/number}","events_url":"https://api.github.com/repos/Perryvw/TypescriptToLua/events","assignees_url":"https://api.github.com/repos/Perryvw/TypescriptToLua/assignees{/user}","branches_url":"https://api.github.com/repos/Perryvw/TypescriptToLua/branches{/branch}","tags_url":"https://api.github.com/repos/Perryvw/TypescriptToLua/tags","blobs_url":"https://api.github.com/repos/Perryvw/TypescriptToLua/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Perryvw/TypescriptToLua/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Perryvw/TypescriptToLua/git/refs{/sha}","trees_url":"https://api.github.com/repos/Perryvw/TypescriptToLua/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Perryvw/TypescriptToLua/statuses/{sha}","languages_url":"https://api.github.com/repos/Perryvw/TypescriptToLua/languages","stargazers_url":"https://api.github.com/repos/Perryvw/TypescriptToLua/stargazers","contributors_url":"https://api.github.com/repos/Perryvw/TypescriptToLua/contributors","subscribers_url":"https://api.github.com/repos/Perryvw/TypescriptToLua/subscribers","subscription_url":"https://api.github.com/repos/Perryvw/TypescriptToLua/subscription","commits_url":"https://api.github.com/repos/Perryvw/TypescriptToLua/commits{/sha}","git_commits_url":"https://api.github.com/repos/Perryvw/TypescriptToLua/git/commits{/sha}","comments_url":"https://api.github.com/repos/Perryvw/TypescriptToLua/comments{/number}","issue_comment_url":"https://api.github.com/repos/Perryvw/TypescriptToLua/issues/comments{/number}","contents_url":"https://api.github.com/repos/Perryvw/TypescriptToLua/contents/{+path}","compare_url":"https://api.github.com/repos/Perryvw/TypescriptToLua/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Perryvw/TypescriptToLua/merges","archive_url":"https://api.github.com/repos/Perryvw/TypescriptToLua/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Perryvw/TypescriptToLua/downloads","issues_url":"https://api.github.com/repos/Perryvw/TypescriptToLua/issues{/number}","pulls_url":"https://api.github.com/repos/Perryvw/TypescriptToLua/pulls{/number}","milestones_url":"https://api.github.com/repos/Perryvw/TypescriptToLua/milestones{/number}","notifications_url":"https://api.github.com/repos/Perryvw/TypescriptToLua/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Perryvw/TypescriptToLua/labels{/name}","releases_url":"https://api.github.com/repos/Perryvw/TypescriptToLua/releases{/id}","deployments_url":"https://api.github.com/repos/Perryvw/TypescriptToLua/deployments","created_at":"2017-12-31T17:26:03Z","updated_at":"2018-08-20T16:35:58Z","pushed_at":"2018-08-20T16:36:00Z","git_url":"git://github.com/Perryvw/TypescriptToLua.git","ssh_url":"git@github.com:Perryvw/TypescriptToLua.git","clone_url":"https://github.com/Perryvw/TypescriptToLua.git","svn_url":"https://github.com/Perryvw/TypescriptToLua","homepage":null,"size":957,"stargazers_count":46,"watchers_count":46,"language":"TypeScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":12,"mirror_url":null,"archived":false,"open_issues_count":15,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":12,"open_issues":15,"watchers":46,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Perryvw/TypescriptToLua/pulls/175"},"html":{"href":"https://github.com/Perryvw/TypescriptToLua/pull/175"},"issue":{"href":"https://api.github.com/repos/Perryvw/TypescriptToLua/issues/175"},"comments":{"href":"https://api.github.com/repos/Perryvw/TypescriptToLua/issues/175/comments"},"review_comments":{"href":"https://api.github.com/repos/Perryvw/TypescriptToLua/pulls/175/comments"},"review_comment":{"href":"https://api.github.com/repos/Perryvw/TypescriptToLua/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Perryvw/TypescriptToLua/pulls/175/commits"},"statuses":{"href":"https://api.github.com/repos/Perryvw/TypescriptToLua/statuses/fcfb68029ab20f6a49b03aad317fd0ce735c0109"}},"author_association":"COLLABORATOR"}}
{"actor":{"display_login":"Perryvw"}}