payload: {"action":"created","comment":{"url":"https://api.github.com/repos/theia-ide/theia/pulls/comments/262391000","pull_request_review_id":210544689,"id":262391000,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDI2MjM5MTAwMA==","diff_hunk":"@@ -81,34 +81,70 @@ export class DocumentsExtImpl implements DocumentsExt {\n             this._onDidSaveTextDocument.fire(data.document);\n         }\n     }\n-    $acceptModelWillSave(strUrl: UriComponents, reason: theia.TextDocumentSaveReason): Promise<SingleEditOperation[]> {\n-        return new Promise<SingleEditOperation[]>((resolve, reject) => {\n-            const uri = URI.revive(strUrl);\n-            const uriString = uri.toString();\n-            const data = this.editorsAndDocuments.getDocument(uriString);\n-            if (data) {\n-                const onWillSaveEvent: theia.TextDocumentWillSaveEvent = {\n-                    document: data.document,\n-                    reason: reason,\n-                    /* tslint:disable:no-any */\n-                    waitUntil: async (editsPromise: PromiseLike<theia.TextEdit[] | any>) => {\n-                        const editsObjs = await editsPromise;\n-                        if (this.isTextEditArray(editsObjs)) {\n-                            const editOperations: SingleEditOperation[] = (editsObjs as theia.TextEdit[]).map(textEdit => Converter.fromTextEdit(textEdit));\n-                            resolve(editOperations);\n-                        } else {\n-                            resolve([]);\n-                        }\n+\n+    async $acceptModelWillSave(strUrl: UriComponents, reason: theia.TextDocumentSaveReason): Promise<SingleEditOperation[]> {\n+        const uri = URI.revive(strUrl).toString();\n+        const operations: SingleEditOperation[] = [];\n+        let didTimeout = false;\n+        const didTimeoutHandle = setTimeout(() => didTimeout = true, 1500);\n+        try {\n+            await this._onWillSaveTextDocument.sequence(async fireEvent => {\n+                if (didTimeout) {\n+                    return false;\n+                }\n+                try {\n+                    const documentData = this.editorsAndDocuments.getDocument(uri);\n+                    if (documentData) {\n+                        const { document } = documentData;\n+                        await this.fireTextDocumentWillSaveEvent({\n+                            document, reason, fireEvent,\n+                            accept: operation => operations.push(operation)\n+                        });\n                     }\n-                };\n-                this._onWillSaveTextDocument.fire(onWillSaveEvent);\n-            }\n-        });\n+                } catch (e) {\n+                    console.error(e);\n+                }\n+                return !didTimeout;\n+            });\n+        } finally {\n+            clearTimeout(didTimeoutHandle);\n+        }\n+        return operations;\n     }\n \n-    isTextEditArray(obj: any): obj is theia.TextEdit[] {\n-        return Array.isArray(obj) && obj.every((elem: any) => TextEdit.isTextEdit(elem));\n+    // tslint:disable:no-any\n+    protected async fireTextDocumentWillSaveEvent({\n+        document, reason, fireEvent, accept\n+    }: {\n+            document: theia.TextDocument,\n+            reason: theia.TextDocumentSaveReason,\n+            fireEvent: (e: theia.TextDocumentWillSaveEvent) => any,\n+            accept: (operation: SingleEditOperation) => void\n+        }): Promise<void> {\n+\n+        const promises: PromiseLike<TextEdit[] | any>[] = [];\n+        fireEvent(Object.freeze({\n+            document, reason,\n+            waitUntil(p: PromiseLike<TextEdit[] | any>) {\n+                if (Object.isFrozen(promises)) {\n+                    throw new Error('waitUntil can not be called async');","path":"packages/plugin-ext/src/plugin/documents.ts","position":74,"original_position":74,"commit_id":"ad9e62bd78bf4da3ce829b25de64f9aa3fc8aaeb","original_commit_id":"ad9e62bd78bf4da3ce829b25de64f9aa3fc8aaeb","user":{"login":"benoitf","id":436777,"node_id":"MDQ6VXNlcjQzNjc3Nw==","avatar_url":"https://avatars1.githubusercontent.com/u/436777?v=4","gravatar_id":"","url":"https://api.github.com/users/benoitf","html_url":"https://github.com/benoitf","followers_url":"https://api.github.com/users/benoitf/followers","following_url":"https://api.github.com/users/benoitf/following{/other_user}","gists_url":"https://api.github.com/users/benoitf/gists{/gist_id}","starred_url":"https://api.github.com/users/benoitf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/benoitf/subscriptions","organizations_url":"https://api.github.com/users/benoitf/orgs","repos_url":"https://api.github.com/users/benoitf/repos","events_url":"https://api.github.com/users/benoitf/events{/privacy}","received_events_url":"https://api.github.com/users/benoitf/received_events","type":"User","site_admin":false},"body":"Hello, I'm not sure the message will be meaningful for end users\r\n\r\nAlso it looks like a copy from vscode.","created_at":"2019-03-05T08:31:28Z","updated_at":"2019-03-05T08:31:33Z","html_url":"https://github.com/theia-ide/theia/pull/4476#discussion_r262391000","pull_request_url":"https://api.github.com/repos/theia-ide/theia/pulls/4476","author_association":"COLLABORATOR","_links":{"self":{"href":"https://api.github.com/repos/theia-ide/theia/pulls/comments/262391000"},"html":{"href":"https://github.com/theia-ide/theia/pull/4476#discussion_r262391000"},"pull_request":{"href":"https://api.github.com/repos/theia-ide/theia/pulls/4476"}}},"pull_request":{"url":"https://api.github.com/repos/theia-ide/theia/pulls/4476","id":258009816,"node_id":"MDExOlB1bGxSZXF1ZXN0MjU4MDA5ODE2","html_url":"https://github.com/theia-ide/theia/pull/4476","diff_url":"https://github.com/theia-ide/theia/pull/4476.diff","patch_url":"https://github.com/theia-ide/theia/pull/4476.patch","issue_url":"https://api.github.com/repos/theia-ide/theia/issues/4476","number":4476,"state":"open","locked":false,"title":"Save cycle fixes","user":{"login":"akosyakov","id":3082655,"node_id":"MDQ6VXNlcjMwODI2NTU=","avatar_url":"https://avatars2.githubusercontent.com/u/3082655?v=4","gravatar_id":"","url":"https://api.github.com/users/akosyakov","html_url":"https://github.com/akosyakov","followers_url":"https://api.github.com/users/akosyakov/followers","following_url":"https://api.github.com/users/akosyakov/following{/other_user}","gists_url":"https://api.github.com/users/akosyakov/gists{/gist_id}","starred_url":"https://api.github.com/users/akosyakov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/akosyakov/subscriptions","organizations_url":"https://api.github.com/users/akosyakov/orgs","repos_url":"https://api.github.com/users/akosyakov/repos","events_url":"https://api.github.com/users/akosyakov/events{/privacy}","received_events_url":"https://api.github.com/users/akosyakov/received_events","type":"User","site_admin":false},"body":"- align timeouts with VS Code: there is no general timeout anymore, each participant should take care, i.e. format on save, plugin host\r\n- properly fire onWillSaveTextDocument event in the plugin host process, before it will resolve only for first listener or never resolve if there are no participants\r\n\r\nfix #4463 ","created_at":"2019-03-04T16:36:11Z","updated_at":"2019-03-05T08:31:33Z","closed_at":null,"merged_at":null,"merge_commit_sha":"6c971b9af696a65390bf9520f9e29024826e7a28","assignee":null,"assignees":[],"requested_reviewers":[{"login":"svenefftinge","id":372735,"node_id":"MDQ6VXNlcjM3MjczNQ==","avatar_url":"https://avatars0.githubusercontent.com/u/372735?v=4","gravatar_id":"","url":"https://api.github.com/users/svenefftinge","html_url":"https://github.com/svenefftinge","followers_url":"https://api.github.com/users/svenefftinge/followers","following_url":"https://api.github.com/users/svenefftinge/following{/other_user}","gists_url":"https://api.github.com/users/svenefftinge/gists{/gist_id}","starred_url":"https://api.github.com/users/svenefftinge/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/svenefftinge/subscriptions","organizations_url":"https://api.github.com/users/svenefftinge/orgs","repos_url":"https://api.github.com/users/svenefftinge/repos","events_url":"https://api.github.com/users/svenefftinge/events{/privacy}","received_events_url":"https://api.github.com/users/svenefftinge/received_events","type":"User","site_admin":false},{"login":"evidolob","id":929743,"node_id":"MDQ6VXNlcjkyOTc0Mw==","avatar_url":"https://avatars0.githubusercontent.com/u/929743?v=4","gravatar_id":"","url":"https://api.github.com/users/evidolob","html_url":"https://github.com/evidolob","followers_url":"https://api.github.com/users/evidolob/followers","following_url":"https://api.github.com/users/evidolob/following{/other_user}","gists_url":"https://api.github.com/users/evidolob/gists{/gist_id}","starred_url":"https://api.github.com/users/evidolob/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/evidolob/subscriptions","organizations_url":"https://api.github.com/users/evidolob/orgs","repos_url":"https://api.github.com/users/evidolob/repos","events_url":"https://api.github.com/users/evidolob/events{/privacy}","received_events_url":"https://api.github.com/users/evidolob/received_events","type":"User","site_admin":false},{"login":"marechal-p","id":14182238,"node_id":"MDQ6VXNlcjE0MTgyMjM4","avatar_url":"https://avatars0.githubusercontent.com/u/14182238?v=4","gravatar_id":"","url":"https://api.github.com/users/marechal-p","html_url":"https://github.com/marechal-p","followers_url":"https://api.github.com/users/marechal-p/followers","following_url":"https://api.github.com/users/marechal-p/following{/other_user}","gists_url":"https://api.github.com/users/marechal-p/gists{/gist_id}","starred_url":"https://api.github.com/users/marechal-p/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/marechal-p/subscriptions","organizations_url":"https://api.github.com/users/marechal-p/orgs","repos_url":"https://api.github.com/users/marechal-p/repos","events_url":"https://api.github.com/users/marechal-p/events{/privacy}","received_events_url":"https://api.github.com/users/marechal-p/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/theia-ide/theia/pulls/4476/commits","review_comments_url":"https://api.github.com/repos/theia-ide/theia/pulls/4476/comments","review_comment_url":"https://api.github.com/repos/theia-ide/theia/pulls/comments{/number}","comments_url":"https://api.github.com/repos/theia-ide/theia/issues/4476/comments","statuses_url":"https://api.github.com/repos/theia-ide/theia/statuses/ad9e62bd78bf4da3ce829b25de64f9aa3fc8aaeb","head":{"label":"theia-ide:ak/align_save_timeout","ref":"ak/align_save_timeout","sha":"ad9e62bd78bf4da3ce829b25de64f9aa3fc8aaeb","user":{"login":"theia-ide","id":28530323,"node_id":"MDEyOk9yZ2FuaXphdGlvbjI4NTMwMzIz","avatar_url":"https://avatars1.githubusercontent.com/u/28530323?v=4","gravatar_id":"","url":"https://api.github.com/users/theia-ide","html_url":"https://github.com/theia-ide","followers_url":"https://api.github.com/users/theia-ide/followers","following_url":"https://api.github.com/users/theia-ide/following{/other_user}","gists_url":"https://api.github.com/users/theia-ide/gists{/gist_id}","starred_url":"https://api.github.com/users/theia-ide/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/theia-ide/subscriptions","organizations_url":"https://api.github.com/users/theia-ide/orgs","repos_url":"https://api.github.com/users/theia-ide/repos","events_url":"https://api.github.com/users/theia-ide/events{/privacy}","received_events_url":"https://api.github.com/users/theia-ide/received_events","type":"Organization","site_admin":false},"repo":{"id":83050680,"node_id":"MDEwOlJlcG9zaXRvcnk4MzA1MDY4MA==","name":"theia","full_name":"theia-ide/theia","private":false,"owner":{"login":"theia-ide","id":28530323,"node_id":"MDEyOk9yZ2FuaXphdGlvbjI4NTMwMzIz","avatar_url":"https://avatars1.githubusercontent.com/u/28530323?v=4","gravatar_id":"","url":"https://api.github.com/users/theia-ide","html_url":"https://github.com/theia-ide","followers_url":"https://api.github.com/users/theia-ide/followers","following_url":"https://api.github.com/users/theia-ide/following{/other_user}","gists_url":"https://api.github.com/users/theia-ide/gists{/gist_id}","starred_url":"https://api.github.com/users/theia-ide/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/theia-ide/subscriptions","organizations_url":"https://api.github.com/users/theia-ide/orgs","repos_url":"https://api.github.com/users/theia-ide/repos","events_url":"https://api.github.com/users/theia-ide/events{/privacy}","received_events_url":"https://api.github.com/users/theia-ide/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/theia-ide/theia","description":"Theia is a cloud & desktop IDE framework implemented in TypeScript.","fork":false,"url":"https://api.github.com/repos/theia-ide/theia","forks_url":"https://api.github.com/repos/theia-ide/theia/forks","keys_url":"https://api.github.com/repos/theia-ide/theia/keys{/key_id}","collaborators_url":"https://api.github.com/repos/theia-ide/theia/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/theia-ide/theia/teams","hooks_url":"https://api.github.com/repos/theia-ide/theia/hooks","issue_events_url":"https://api.github.com/repos/theia-ide/theia/issues/events{/number}","events_url":"https://api.github.com/repos/theia-ide/theia/events","assignees_url":"https://api.github.com/repos/theia-ide/theia/assignees{/user}","branches_url":"https://api.github.com/repos/theia-ide/theia/branches{/branch}","tags_url":"https://api.github.com/repos/theia-ide/theia/tags","blobs_url":"https://api.github.com/repos/theia-ide/theia/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/theia-ide/theia/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/theia-ide/theia/git/refs{/sha}","trees_url":"https://api.github.com/repos/theia-ide/theia/git/trees{/sha}","statuses_url":"https://api.github.com/repos/theia-ide/theia/statuses/{sha}","languages_url":"https://api.github.com/repos/theia-ide/theia/languages","stargazers_url":"https://api.github.com/repos/theia-ide/theia/stargazers","contributors_url":"https://api.github.com/repos/theia-ide/theia/contributors","subscribers_url":"https://api.github.com/repos/theia-ide/theia/subscribers","subscription_url":"https://api.github.com/repos/theia-ide/theia/subscription","commits_url":"https://api.github.com/repos/theia-ide/theia/commits{/sha}","git_commits_url":"https://api.github.com/repos/theia-ide/theia/git/commits{/sha}","comments_url":"https://api.github.com/repos/theia-ide/theia/comments{/number}","issue_comment_url":"https://api.github.com/repos/theia-ide/theia/issues/comments{/number}","contents_url":"https://api.github.com/repos/theia-ide/theia/contents/{+path}","compare_url":"https://api.github.com/repos/theia-ide/theia/compare/{base}...{head}","merges_url":"https://api.github.com/repos/theia-ide/theia/merges","archive_url":"https://api.github.com/repos/theia-ide/theia/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/theia-ide/theia/downloads","issues_url":"https://api.github.com/repos/theia-ide/theia/issues{/number}","pulls_url":"https://api.github.com/repos/theia-ide/theia/pulls{/number}","milestones_url":"https://api.github.com/repos/theia-ide/theia/milestones{/number}","notifications_url":"https://api.github.com/repos/theia-ide/theia/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/theia-ide/theia/labels{/name}","releases_url":"https://api.github.com/repos/theia-ide/theia/releases{/id}","deployments_url":"https://api.github.com/repos/theia-ide/theia/deployments","created_at":"2017-02-24T14:42:05Z","updated_at":"2019-03-05T08:15:35Z","pushed_at":"2019-03-05T08:29:47Z","git_url":"git://github.com/theia-ide/theia.git","ssh_url":"git@github.com:theia-ide/theia.git","clone_url":"https://github.com/theia-ide/theia.git","svn_url":"https://github.com/theia-ide/theia","homepage":"http://theia-ide.org","size":116031,"stargazers_count":3147,"watchers_count":3147,"language":"TypeScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":399,"mirror_url":null,"archived":false,"open_issues_count":866,"license":{"key":"other","name":"Other","spdx_id":"NOASSERTION","url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":399,"open_issues":866,"watchers":3147,"default_branch":"master"}},"base":{"label":"theia-ide:master","ref":"master","sha":"184ce8d75b07f06e9b4b5c63a4a48af1f194b78d","user":{"login":"theia-ide","id":28530323,"node_id":"MDEyOk9yZ2FuaXphdGlvbjI4NTMwMzIz","avatar_url":"https://avatars1.githubusercontent.com/u/28530323?v=4","gravatar_id":"","url":"https://api.github.com/users/theia-ide","html_url":"https://github.com/theia-ide","followers_url":"https://api.github.com/users/theia-ide/followers","following_url":"https://api.github.com/users/theia-ide/following{/other_user}","gists_url":"https://api.github.com/users/theia-ide/gists{/gist_id}","starred_url":"https://api.github.com/users/theia-ide/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/theia-ide/subscriptions","organizations_url":"https://api.github.com/users/theia-ide/orgs","repos_url":"https://api.github.com/users/theia-ide/repos","events_url":"https://api.github.com/users/theia-ide/events{/privacy}","received_events_url":"https://api.github.com/users/theia-ide/received_events","type":"Organization","site_admin":false},"repo":{"id":83050680,"node_id":"MDEwOlJlcG9zaXRvcnk4MzA1MDY4MA==","name":"theia","full_name":"theia-ide/theia","private":false,"owner":{"login":"theia-ide","id":28530323,"node_id":"MDEyOk9yZ2FuaXphdGlvbjI4NTMwMzIz","avatar_url":"https://avatars1.githubusercontent.com/u/28530323?v=4","gravatar_id":"","url":"https://api.github.com/users/theia-ide","html_url":"https://github.com/theia-ide","followers_url":"https://api.github.com/users/theia-ide/followers","following_url":"https://api.github.com/users/theia-ide/following{/other_user}","gists_url":"https://api.github.com/users/theia-ide/gists{/gist_id}","starred_url":"https://api.github.com/users/theia-ide/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/theia-ide/subscriptions","organizations_url":"https://api.github.com/users/theia-ide/orgs","repos_url":"https://api.github.com/users/theia-ide/repos","events_url":"https://api.github.com/users/theia-ide/events{/privacy}","received_events_url":"https://api.github.com/users/theia-ide/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/theia-ide/theia","description":"Theia is a cloud & desktop IDE framework implemented in TypeScript.","fork":false,"url":"https://api.github.com/repos/theia-ide/theia","forks_url":"https://api.github.com/repos/theia-ide/theia/forks","keys_url":"https://api.github.com/repos/theia-ide/theia/keys{/key_id}","collaborators_url":"https://api.github.com/repos/theia-ide/theia/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/theia-ide/theia/teams","hooks_url":"https://api.github.com/repos/theia-ide/theia/hooks","issue_events_url":"https://api.github.com/repos/theia-ide/theia/issues/events{/number}","events_url":"https://api.github.com/repos/theia-ide/theia/events","assignees_url":"https://api.github.com/repos/theia-ide/theia/assignees{/user}","branches_url":"https://api.github.com/repos/theia-ide/theia/branches{/branch}","tags_url":"https://api.github.com/repos/theia-ide/theia/tags","blobs_url":"https://api.github.com/repos/theia-ide/theia/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/theia-ide/theia/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/theia-ide/theia/git/refs{/sha}","trees_url":"https://api.github.com/repos/theia-ide/theia/git/trees{/sha}","statuses_url":"https://api.github.com/repos/theia-ide/theia/statuses/{sha}","languages_url":"https://api.github.com/repos/theia-ide/theia/languages","stargazers_url":"https://api.github.com/repos/theia-ide/theia/stargazers","contributors_url":"https://api.github.com/repos/theia-ide/theia/contributors","subscribers_url":"https://api.github.com/repos/theia-ide/theia/subscribers","subscription_url":"https://api.github.com/repos/theia-ide/theia/subscription","commits_url":"https://api.github.com/repos/theia-ide/theia/commits{/sha}","git_commits_url":"https://api.github.com/repos/theia-ide/theia/git/commits{/sha}","comments_url":"https://api.github.com/repos/theia-ide/theia/comments{/number}","issue_comment_url":"https://api.github.com/repos/theia-ide/theia/issues/comments{/number}","contents_url":"https://api.github.com/repos/theia-ide/theia/contents/{+path}","compare_url":"https://api.github.com/repos/theia-ide/theia/compare/{base}...{head}","merges_url":"https://api.github.com/repos/theia-ide/theia/merges","archive_url":"https://api.github.com/repos/theia-ide/theia/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/theia-ide/theia/downloads","issues_url":"https://api.github.com/repos/theia-ide/theia/issues{/number}","pulls_url":"https://api.github.com/repos/theia-ide/theia/pulls{/number}","milestones_url":"https://api.github.com/repos/theia-ide/theia/milestones{/number}","notifications_url":"https://api.github.com/repos/theia-ide/theia/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/theia-ide/theia/labels{/name}","releases_url":"https://api.github.com/repos/theia-ide/theia/releases{/id}","deployments_url":"https://api.github.com/repos/theia-ide/theia/deployments","created_at":"2017-02-24T14:42:05Z","updated_at":"2019-03-05T08:15:35Z","pushed_at":"2019-03-05T08:29:47Z","git_url":"git://github.com/theia-ide/theia.git","ssh_url":"git@github.com:theia-ide/theia.git","clone_url":"https://github.com/theia-ide/theia.git","svn_url":"https://github.com/theia-ide/theia","homepage":"http://theia-ide.org","size":116031,"stargazers_count":3147,"watchers_count":3147,"language":"TypeScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":399,"mirror_url":null,"archived":false,"open_issues_count":866,"license":{"key":"other","name":"Other","spdx_id":"NOASSERTION","url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":399,"open_issues":866,"watchers":3147,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/theia-ide/theia/pulls/4476"},"html":{"href":"https://github.com/theia-ide/theia/pull/4476"},"issue":{"href":"https://api.github.com/repos/theia-ide/theia/issues/4476"},"comments":{"href":"https://api.github.com/repos/theia-ide/theia/issues/4476/comments"},"review_comments":{"href":"https://api.github.com/repos/theia-ide/theia/pulls/4476/comments"},"review_comment":{"href":"https://api.github.com/repos/theia-ide/theia/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/theia-ide/theia/pulls/4476/commits"},"statuses":{"href":"https://api.github.com/repos/theia-ide/theia/statuses/ad9e62bd78bf4da3ce829b25de64f9aa3fc8aaeb"}},"author_association":"MEMBER"}}
other: {"actor":{"display_login":"benoitf"}}