{"action":"created","comment":{"url":"https://api.github.com/repos/neo4j-contrib/cypher-editor/pulls/comments/175050992","pull_request_review_id":104519194,"id":175050992,"diff_hunk":"@@ -42,16 +43,55 @@ export class CypherEditorSupport {\n   referencesProviders = {};\n   completion = new AutoCompletion();\n   queriesAndCommands = [];\n+  listeners = [];\n+  version = null;\n \n   constructor(input = '') {\n     this.update(input);\n   }\n \n-  update(input = '') {\n+  getVersion() {\n+    return this.version;\n+  }\n+\n+  ensureVersion = (v, delay = 30, times = 5) =>\n+    retryOperation(\n+      () =>\n+        new Promise((resolve, reject) => {\n+          if (v === this.getVersion()) {\n+            return resolve();\n+          }\n+          return reject();\n+        }),\n+      delay,\n+      times,\n+    );\n+\n+  on(evt, cb) {","path":"cypher-editor-support/src/CypherEditorSupport.js","position":37,"original_position":37,"commit_id":"5ba4cab82b6ec1aaba44f12496df0135a0357b1b","original_commit_id":"5ba4cab82b6ec1aaba44f12496df0135a0357b1b","user":{"login":"FylmTM","id":626772,"avatar_url":"https://avatars3.githubusercontent.com/u/626772?v=4","gravatar_id":"","url":"https://api.github.com/users/FylmTM","html_url":"https://github.com/FylmTM","followers_url":"https://api.github.com/users/FylmTM/followers","following_url":"https://api.github.com/users/FylmTM/following{/other_user}","gists_url":"https://api.github.com/users/FylmTM/gists{/gist_id}","starred_url":"https://api.github.com/users/FylmTM/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/FylmTM/subscriptions","organizations_url":"https://api.github.com/users/FylmTM/orgs","repos_url":"https://api.github.com/users/FylmTM/repos","events_url":"https://api.github.com/users/FylmTM/events{/privacy}","received_events_url":"https://api.github.com/users/FylmTM/received_events","type":"User","site_admin":false},"body":"I usually prefer to have full variable names `event`","created_at":"2018-03-16T10:38:20Z","updated_at":"2018-03-16T10:42:34Z","html_url":"https://github.com/neo4j-contrib/cypher-editor/pull/10#discussion_r175050992","pull_request_url":"https://api.github.com/repos/neo4j-contrib/cypher-editor/pulls/10","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/neo4j-contrib/cypher-editor/pulls/comments/175050992"},"html":{"href":"https://github.com/neo4j-contrib/cypher-editor/pull/10#discussion_r175050992"},"pull_request":{"href":"https://api.github.com/repos/neo4j-contrib/cypher-editor/pulls/10"}}},"pull_request":{"url":"https://api.github.com/repos/neo4j-contrib/cypher-editor/pulls/10","id":175493213,"html_url":"https://github.com/neo4j-contrib/cypher-editor/pull/10","diff_url":"https://github.com/neo4j-contrib/cypher-editor/pull/10.diff","patch_url":"https://github.com/neo4j-contrib/cypher-editor/pull/10.patch","issue_url":"https://api.github.com/repos/neo4j-contrib/cypher-editor/issues/10","number":10,"state":"open","locked":false,"title":"Add content versioning to editor + event listener support for EditorSupport","user":{"login":"oskarhane","id":570998,"avatar_url":"https://avatars0.githubusercontent.com/u/570998?v=4","gravatar_id":"","url":"https://api.github.com/users/oskarhane","html_url":"https://github.com/oskarhane","followers_url":"https://api.github.com/users/oskarhane/followers","following_url":"https://api.github.com/users/oskarhane/following{/other_user}","gists_url":"https://api.github.com/users/oskarhane/gists{/gist_id}","starred_url":"https://api.github.com/users/oskarhane/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/oskarhane/subscriptions","organizations_url":"https://api.github.com/users/oskarhane/orgs","repos_url":"https://api.github.com/users/oskarhane/repos","events_url":"https://api.github.com/users/oskarhane/events{/privacy}","received_events_url":"https://api.github.com/users/oskarhane/received_events","type":"User","site_admin":false},"body":"This enables other components to do two things:\r\n\r\n- When parsing is done, read the parsed contents (used for continously sending pre-flight queries in Neo4j Browser to check for Cypher warnings in the queries)\r\n\r\n- Being able to check if we have the latest parsed version when we want to execute the query. If not, we can call `editorSupport.ensureVersion().then()` to wait for it.\r\n\r\nCheck the included React app for usage and the console for the output.","created_at":"2018-03-16T10:27:54Z","updated_at":"2018-03-16T10:42:34Z","closed_at":null,"merged_at":null,"merge_commit_sha":"8880306a45bc623c9216f414ec076a8dfd6ce309","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/neo4j-contrib/cypher-editor/pulls/10/commits","review_comments_url":"https://api.github.com/repos/neo4j-contrib/cypher-editor/pulls/10/comments","review_comment_url":"https://api.github.com/repos/neo4j-contrib/cypher-editor/pulls/comments{/number}","comments_url":"https://api.github.com/repos/neo4j-contrib/cypher-editor/issues/10/comments","statuses_url":"https://api.github.com/repos/neo4j-contrib/cypher-editor/statuses/5ba4cab82b6ec1aaba44f12496df0135a0357b1b","head":{"label":"oskarhane:ensure-latest-version","ref":"ensure-latest-version","sha":"5ba4cab82b6ec1aaba44f12496df0135a0357b1b","user":{"login":"oskarhane","id":570998,"avatar_url":"https://avatars0.githubusercontent.com/u/570998?v=4","gravatar_id":"","url":"https://api.github.com/users/oskarhane","html_url":"https://github.com/oskarhane","followers_url":"https://api.github.com/users/oskarhane/followers","following_url":"https://api.github.com/users/oskarhane/following{/other_user}","gists_url":"https://api.github.com/users/oskarhane/gists{/gist_id}","starred_url":"https://api.github.com/users/oskarhane/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/oskarhane/subscriptions","organizations_url":"https://api.github.com/users/oskarhane/orgs","repos_url":"https://api.github.com/users/oskarhane/repos","events_url":"https://api.github.com/users/oskarhane/events{/privacy}","received_events_url":"https://api.github.com/users/oskarhane/received_events","type":"User","site_admin":false},"repo":{"id":125500947,"name":"cypher-editor","full_name":"oskarhane/cypher-editor","owner":{"login":"oskarhane","id":570998,"avatar_url":"https://avatars0.githubusercontent.com/u/570998?v=4","gravatar_id":"","url":"https://api.github.com/users/oskarhane","html_url":"https://github.com/oskarhane","followers_url":"https://api.github.com/users/oskarhane/followers","following_url":"https://api.github.com/users/oskarhane/following{/other_user}","gists_url":"https://api.github.com/users/oskarhane/gists{/gist_id}","starred_url":"https://api.github.com/users/oskarhane/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/oskarhane/subscriptions","organizations_url":"https://api.github.com/users/oskarhane/orgs","repos_url":"https://api.github.com/users/oskarhane/repos","events_url":"https://api.github.com/users/oskarhane/events{/privacy}","received_events_url":"https://api.github.com/users/oskarhane/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/oskarhane/cypher-editor","description":"Codemirror editor for Cypher, with syntax awareness and auto-completion","fork":true,"url":"https://api.github.com/repos/oskarhane/cypher-editor","forks_url":"https://api.github.com/repos/oskarhane/cypher-editor/forks","keys_url":"https://api.github.com/repos/oskarhane/cypher-editor/keys{/key_id}","collaborators_url":"https://api.github.com/repos/oskarhane/cypher-editor/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/oskarhane/cypher-editor/teams","hooks_url":"https://api.github.com/repos/oskarhane/cypher-editor/hooks","issue_events_url":"https://api.github.com/repos/oskarhane/cypher-editor/issues/events{/number}","events_url":"https://api.github.com/repos/oskarhane/cypher-editor/events","assignees_url":"https://api.github.com/repos/oskarhane/cypher-editor/assignees{/user}","branches_url":"https://api.github.com/repos/oskarhane/cypher-editor/branches{/branch}","tags_url":"https://api.github.com/repos/oskarhane/cypher-editor/tags","blobs_url":"https://api.github.com/repos/oskarhane/cypher-editor/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/oskarhane/cypher-editor/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/oskarhane/cypher-editor/git/refs{/sha}","trees_url":"https://api.github.com/repos/oskarhane/cypher-editor/git/trees{/sha}","statuses_url":"https://api.github.com/repos/oskarhane/cypher-editor/statuses/{sha}","languages_url":"https://api.github.com/repos/oskarhane/cypher-editor/languages","stargazers_url":"https://api.github.com/repos/oskarhane/cypher-editor/stargazers","contributors_url":"https://api.github.com/repos/oskarhane/cypher-editor/contributors","subscribers_url":"https://api.github.com/repos/oskarhane/cypher-editor/subscribers","subscription_url":"https://api.github.com/repos/oskarhane/cypher-editor/subscription","commits_url":"https://api.github.com/repos/oskarhane/cypher-editor/commits{/sha}","git_commits_url":"https://api.github.com/repos/oskarhane/cypher-editor/git/commits{/sha}","comments_url":"https://api.github.com/repos/oskarhane/cypher-editor/comments{/number}","issue_comment_url":"https://api.github.com/repos/oskarhane/cypher-editor/issues/comments{/number}","contents_url":"https://api.github.com/repos/oskarhane/cypher-editor/contents/{+path}","compare_url":"https://api.github.com/repos/oskarhane/cypher-editor/compare/{base}...{head}","merges_url":"https://api.github.com/repos/oskarhane/cypher-editor/merges","archive_url":"https://api.github.com/repos/oskarhane/cypher-editor/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/oskarhane/cypher-editor/downloads","issues_url":"https://api.github.com/repos/oskarhane/cypher-editor/issues{/number}","pulls_url":"https://api.github.com/repos/oskarhane/cypher-editor/pulls{/number}","milestones_url":"https://api.github.com/repos/oskarhane/cypher-editor/milestones{/number}","notifications_url":"https://api.github.com/repos/oskarhane/cypher-editor/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/oskarhane/cypher-editor/labels{/name}","releases_url":"https://api.github.com/repos/oskarhane/cypher-editor/releases{/id}","deployments_url":"https://api.github.com/repos/oskarhane/cypher-editor/deployments","created_at":"2018-03-16T10:25:35Z","updated_at":"2018-03-16T10:25:37Z","pushed_at":"2018-03-16T10:26:56Z","git_url":"git://github.com/oskarhane/cypher-editor.git","ssh_url":"git@github.com:oskarhane/cypher-editor.git","clone_url":"https://github.com/oskarhane/cypher-editor.git","svn_url":"https://github.com/oskarhane/cypher-editor","homepage":"","size":5011,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"gpl-3.0","name":"GNU General Public License v3.0","spdx_id":"GPL-3.0","url":"https://api.github.com/licenses/gpl-3.0"},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"neo4j-contrib:master","ref":"master","sha":"9d449cdb8d230f970db87c0dbe2deb2474bbd44a","user":{"login":"neo4j-contrib","id":916372,"avatar_url":"https://avatars0.githubusercontent.com/u/916372?v=4","gravatar_id":"","url":"https://api.github.com/users/neo4j-contrib","html_url":"https://github.com/neo4j-contrib","followers_url":"https://api.github.com/users/neo4j-contrib/followers","following_url":"https://api.github.com/users/neo4j-contrib/following{/other_user}","gists_url":"https://api.github.com/users/neo4j-contrib/gists{/gist_id}","starred_url":"https://api.github.com/users/neo4j-contrib/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/neo4j-contrib/subscriptions","organizations_url":"https://api.github.com/users/neo4j-contrib/orgs","repos_url":"https://api.github.com/users/neo4j-contrib/repos","events_url":"https://api.github.com/users/neo4j-contrib/events{/privacy}","received_events_url":"https://api.github.com/users/neo4j-contrib/received_events","type":"Organization","site_admin":false},"repo":{"id":89260843,"name":"cypher-editor","full_name":"neo4j-contrib/cypher-editor","owner":{"login":"neo4j-contrib","id":916372,"avatar_url":"https://avatars0.githubusercontent.com/u/916372?v=4","gravatar_id":"","url":"https://api.github.com/users/neo4j-contrib","html_url":"https://github.com/neo4j-contrib","followers_url":"https://api.github.com/users/neo4j-contrib/followers","following_url":"https://api.github.com/users/neo4j-contrib/following{/other_user}","gists_url":"https://api.github.com/users/neo4j-contrib/gists{/gist_id}","starred_url":"https://api.github.com/users/neo4j-contrib/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/neo4j-contrib/subscriptions","organizations_url":"https://api.github.com/users/neo4j-contrib/orgs","repos_url":"https://api.github.com/users/neo4j-contrib/repos","events_url":"https://api.github.com/users/neo4j-contrib/events{/privacy}","received_events_url":"https://api.github.com/users/neo4j-contrib/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/neo4j-contrib/cypher-editor","description":"Codemirror editor for Cypher, with syntax awareness and auto-completion","fork":false,"url":"https://api.github.com/repos/neo4j-contrib/cypher-editor","forks_url":"https://api.github.com/repos/neo4j-contrib/cypher-editor/forks","keys_url":"https://api.github.com/repos/neo4j-contrib/cypher-editor/keys{/key_id}","collaborators_url":"https://api.github.com/repos/neo4j-contrib/cypher-editor/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/neo4j-contrib/cypher-editor/teams","hooks_url":"https://api.github.com/repos/neo4j-contrib/cypher-editor/hooks","issue_events_url":"https://api.github.com/repos/neo4j-contrib/cypher-editor/issues/events{/number}","events_url":"https://api.github.com/repos/neo4j-contrib/cypher-editor/events","assignees_url":"https://api.github.com/repos/neo4j-contrib/cypher-editor/assignees{/user}","branches_url":"https://api.github.com/repos/neo4j-contrib/cypher-editor/branches{/branch}","tags_url":"https://api.github.com/repos/neo4j-contrib/cypher-editor/tags","blobs_url":"https://api.github.com/repos/neo4j-contrib/cypher-editor/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/neo4j-contrib/cypher-editor/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/neo4j-contrib/cypher-editor/git/refs{/sha}","trees_url":"https://api.github.com/repos/neo4j-contrib/cypher-editor/git/trees{/sha}","statuses_url":"https://api.github.com/repos/neo4j-contrib/cypher-editor/statuses/{sha}","languages_url":"https://api.github.com/repos/neo4j-contrib/cypher-editor/languages","stargazers_url":"https://api.github.com/repos/neo4j-contrib/cypher-editor/stargazers","contributors_url":"https://api.github.com/repos/neo4j-contrib/cypher-editor/contributors","subscribers_url":"https://api.github.com/repos/neo4j-contrib/cypher-editor/subscribers","subscription_url":"https://api.github.com/repos/neo4j-contrib/cypher-editor/subscription","commits_url":"https://api.github.com/repos/neo4j-contrib/cypher-editor/commits{/sha}","git_commits_url":"https://api.github.com/repos/neo4j-contrib/cypher-editor/git/commits{/sha}","comments_url":"https://api.github.com/repos/neo4j-contrib/cypher-editor/comments{/number}","issue_comment_url":"https://api.github.com/repos/neo4j-contrib/cypher-editor/issues/comments{/number}","contents_url":"https://api.github.com/repos/neo4j-contrib/cypher-editor/contents/{+path}","compare_url":"https://api.github.com/repos/neo4j-contrib/cypher-editor/compare/{base}...{head}","merges_url":"https://api.github.com/repos/neo4j-contrib/cypher-editor/merges","archive_url":"https://api.github.com/repos/neo4j-contrib/cypher-editor/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/neo4j-contrib/cypher-editor/downloads","issues_url":"https://api.github.com/repos/neo4j-contrib/cypher-editor/issues{/number}","pulls_url":"https://api.github.com/repos/neo4j-contrib/cypher-editor/pulls{/number}","milestones_url":"https://api.github.com/repos/neo4j-contrib/cypher-editor/milestones{/number}","notifications_url":"https://api.github.com/repos/neo4j-contrib/cypher-editor/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/neo4j-contrib/cypher-editor/labels{/name}","releases_url":"https://api.github.com/repos/neo4j-contrib/cypher-editor/releases{/id}","deployments_url":"https://api.github.com/repos/neo4j-contrib/cypher-editor/deployments","created_at":"2017-04-24T16:05:45Z","updated_at":"2018-03-15T08:10:26Z","pushed_at":"2018-03-16T10:27:55Z","git_url":"git://github.com/neo4j-contrib/cypher-editor.git","ssh_url":"git@github.com:neo4j-contrib/cypher-editor.git","clone_url":"https://github.com/neo4j-contrib/cypher-editor.git","svn_url":"https://github.com/neo4j-contrib/cypher-editor","homepage":"","size":5011,"stargazers_count":9,"watchers_count":9,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":3,"mirror_url":null,"archived":false,"open_issues_count":1,"license":{"key":"gpl-3.0","name":"GNU General Public License v3.0","spdx_id":"GPL-3.0","url":"https://api.github.com/licenses/gpl-3.0"},"forks":3,"open_issues":1,"watchers":9,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/neo4j-contrib/cypher-editor/pulls/10"},"html":{"href":"https://github.com/neo4j-contrib/cypher-editor/pull/10"},"issue":{"href":"https://api.github.com/repos/neo4j-contrib/cypher-editor/issues/10"},"comments":{"href":"https://api.github.com/repos/neo4j-contrib/cypher-editor/issues/10/comments"},"review_comments":{"href":"https://api.github.com/repos/neo4j-contrib/cypher-editor/pulls/10/comments"},"review_comment":{"href":"https://api.github.com/repos/neo4j-contrib/cypher-editor/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/neo4j-contrib/cypher-editor/pulls/10/commits"},"statuses":{"href":"https://api.github.com/repos/neo4j-contrib/cypher-editor/statuses/5ba4cab82b6ec1aaba44f12496df0135a0357b1b"}},"author_association":"OWNER"}}
{"actor":{"display_login":"FylmTM"}}