{"action":"created","comment":{"url":"https://api.github.com/repos/OmniSharp/omnisharp-atom/pulls/comments/30711780","id":30711780,"diff_hunk":"@@ -0,0 +1,106 @@\n+import Omni = require('../../omni-sharp-server/omni');\n+import OmniSharpAtom = require('../omnisharp-atom');\n+import OmniSharpClient = require('omnisharp-client');\n+import _ = require('lodash');\n+import EventKit = require('event-kit');\n+import ClientManager = require('../../omni-sharp-server/client-manager');\n+\n+class BufferUpdater {\n+    private disposables: EventKit.CompositeDisposable;\n+    private editor: Atom.TextEditor;\n+    private emitter: EventKit.Emitter;\n+\n+    constructor(editor: Atom.TextEditor) {\n+        this.disposables = new EventKit.CompositeDisposable();\n+        this.emitter = new EventKit.Emitter();\n+        this.editor = editor;\n+\n+        var buffer = editor.getBuffer();\n+\n+        this.disposables.add(buffer.onDidSave(() => this.updateBuffer(editor)));\n+        this.disposables.add(buffer.onDidReload(() => this.updateBuffer(editor)));\n+        this.disposables.add(buffer.onDidDestroy(() => this.dispose()));\n+\n+        this.disposables.add(buffer.onDidChange(event =>  this.changeBuffer(editor, event)));\n+\n+        this.disposables.add(atom.workspace.observeActivePaneItem((pane: Atom.Pane) => {\n+            var activeEditor = atom.workspace.getActiveTextEditor();\n+            if (activeEditor != null && this.editor.id == activeEditor.id)","path":"lib/omnisharp-atom/features/buffer-updater.ts","position":28,"original_position":28,"commit_id":"89b2ffe0e0f594f34d3be23044f159cbeb9565c6","original_commit_id":"89b2ffe0e0f594f34d3be23044f159cbeb9565c6","user":{"login":"david-driscoll","id":1269157,"avatar_url":"https://avatars.githubusercontent.com/u/1269157?v=3","gravatar_id":"","url":"https://api.github.com/users/david-driscoll","html_url":"https://github.com/david-driscoll","followers_url":"https://api.github.com/users/david-driscoll/followers","following_url":"https://api.github.com/users/david-driscoll/following{/other_user}","gists_url":"https://api.github.com/users/david-driscoll/gists{/gist_id}","starred_url":"https://api.github.com/users/david-driscoll/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/david-driscoll/subscriptions","organizations_url":"https://api.github.com/users/david-driscoll/orgs","repos_url":"https://api.github.com/users/david-driscoll/repos","events_url":"https://api.github.com/users/david-driscoll/events{/privacy}","received_events_url":"https://api.github.com/users/david-driscoll/received_events","type":"User","site_admin":false},"body":"we can add that to the typings, or cast around it.","created_at":"2015-05-20T15:05:02Z","updated_at":"2015-05-20T15:05:02Z","html_url":"https://github.com/OmniSharp/omnisharp-atom/pull/294#discussion_r30711780","pull_request_url":"https://api.github.com/repos/OmniSharp/omnisharp-atom/pulls/294","_links":{"self":{"href":"https://api.github.com/repos/OmniSharp/omnisharp-atom/pulls/comments/30711780"},"html":{"href":"https://github.com/OmniSharp/omnisharp-atom/pull/294#discussion_r30711780"},"pull_request":{"href":"https://api.github.com/repos/OmniSharp/omnisharp-atom/pulls/294"}}},"pull_request":{"url":"https://api.github.com/repos/OmniSharp/omnisharp-atom/pulls/294","id":35568326,"html_url":"https://github.com/OmniSharp/omnisharp-atom/pull/294","diff_url":"https://github.com/OmniSharp/omnisharp-atom/pull/294.diff","patch_url":"https://github.com/OmniSharp/omnisharp-atom/pull/294.patch","issue_url":"https://api.github.com/repos/OmniSharp/omnisharp-atom/issues/294","number":294,"state":"open","locked":false,"title":"Optimizing buffer updates","user":{"login":"adriaanp","id":136807,"avatar_url":"https://avatars.githubusercontent.com/u/136807?v=3","gravatar_id":"","url":"https://api.github.com/users/adriaanp","html_url":"https://github.com/adriaanp","followers_url":"https://api.github.com/users/adriaanp/followers","following_url":"https://api.github.com/users/adriaanp/following{/other_user}","gists_url":"https://api.github.com/users/adriaanp/gists{/gist_id}","starred_url":"https://api.github.com/users/adriaanp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/adriaanp/subscriptions","organizations_url":"https://api.github.com/users/adriaanp/orgs","repos_url":"https://api.github.com/users/adriaanp/repos","events_url":"https://api.github.com/users/adriaanp/events{/privacy}","received_events_url":"https://api.github.com/users/adriaanp/received_events","type":"User","site_admin":false},"body":"This still needs work, but I wanted to put it out here for some feedback.\r\n\r\nThis becomes very chatty as it fires after every keypress, although it is fast I have not noticed any typing lags.\r\n\r\nThere is a few issues that I've noticed. If you type really fast the /changebuffer request is sent out of order if I look at the console output, and then the buffers gets out of sync. I'm not sure how we can force so that the /changebuffer requests will always be in order maybe @david-driscoll can help with that.\r\n\r\nAnother issue is on formatAfterkeyStroke the buffers also gets out of sync but can't reproduce it consistently. Although it seems if the server does not return any suggestions it gets out of whack, this could be maybe a server bug not sure how to debug server on Mac.\r\n\r\nOther than that it looks like it's working. \r\n\r\nThe ultimate goal here really should be to send a changebuffer before another call with one change set, but that is the challenging part at the moment to get what changed into one request.","created_at":"2015-05-16T09:12:27Z","updated_at":"2015-05-20T15:05:02Z","closed_at":null,"merged_at":null,"merge_commit_sha":"5535a948e6b83bafed691c864c24476ad7e0f90f","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/OmniSharp/omnisharp-atom/pulls/294/commits","review_comments_url":"https://api.github.com/repos/OmniSharp/omnisharp-atom/pulls/294/comments","review_comment_url":"https://api.github.com/repos/OmniSharp/omnisharp-atom/pulls/comments{/number}","comments_url":"https://api.github.com/repos/OmniSharp/omnisharp-atom/issues/294/comments","statuses_url":"https://api.github.com/repos/OmniSharp/omnisharp-atom/statuses/89b2ffe0e0f594f34d3be23044f159cbeb9565c6","head":{"label":"adriaanp:buffer-updates","ref":"buffer-updates","sha":"89b2ffe0e0f594f34d3be23044f159cbeb9565c6","user":{"login":"adriaanp","id":136807,"avatar_url":"https://avatars.githubusercontent.com/u/136807?v=3","gravatar_id":"","url":"https://api.github.com/users/adriaanp","html_url":"https://github.com/adriaanp","followers_url":"https://api.github.com/users/adriaanp/followers","following_url":"https://api.github.com/users/adriaanp/following{/other_user}","gists_url":"https://api.github.com/users/adriaanp/gists{/gist_id}","starred_url":"https://api.github.com/users/adriaanp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/adriaanp/subscriptions","organizations_url":"https://api.github.com/users/adriaanp/orgs","repos_url":"https://api.github.com/users/adriaanp/repos","events_url":"https://api.github.com/users/adriaanp/events{/privacy}","received_events_url":"https://api.github.com/users/adriaanp/received_events","type":"User","site_admin":false},"repo":{"id":34478501,"name":"omnisharp-atom","full_name":"adriaanp/omnisharp-atom","owner":{"login":"adriaanp","id":136807,"avatar_url":"https://avatars.githubusercontent.com/u/136807?v=3","gravatar_id":"","url":"https://api.github.com/users/adriaanp","html_url":"https://github.com/adriaanp","followers_url":"https://api.github.com/users/adriaanp/followers","following_url":"https://api.github.com/users/adriaanp/following{/other_user}","gists_url":"https://api.github.com/users/adriaanp/gists{/gist_id}","starred_url":"https://api.github.com/users/adriaanp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/adriaanp/subscriptions","organizations_url":"https://api.github.com/users/adriaanp/orgs","repos_url":"https://api.github.com/users/adriaanp/repos","events_url":"https://api.github.com/users/adriaanp/events{/privacy}","received_events_url":"https://api.github.com/users/adriaanp/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/adriaanp/omnisharp-atom","description":"Omnisharp support for the atom editor","fork":true,"url":"https://api.github.com/repos/adriaanp/omnisharp-atom","forks_url":"https://api.github.com/repos/adriaanp/omnisharp-atom/forks","keys_url":"https://api.github.com/repos/adriaanp/omnisharp-atom/keys{/key_id}","collaborators_url":"https://api.github.com/repos/adriaanp/omnisharp-atom/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/adriaanp/omnisharp-atom/teams","hooks_url":"https://api.github.com/repos/adriaanp/omnisharp-atom/hooks","issue_events_url":"https://api.github.com/repos/adriaanp/omnisharp-atom/issues/events{/number}","events_url":"https://api.github.com/repos/adriaanp/omnisharp-atom/events","assignees_url":"https://api.github.com/repos/adriaanp/omnisharp-atom/assignees{/user}","branches_url":"https://api.github.com/repos/adriaanp/omnisharp-atom/branches{/branch}","tags_url":"https://api.github.com/repos/adriaanp/omnisharp-atom/tags","blobs_url":"https://api.github.com/repos/adriaanp/omnisharp-atom/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/adriaanp/omnisharp-atom/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/adriaanp/omnisharp-atom/git/refs{/sha}","trees_url":"https://api.github.com/repos/adriaanp/omnisharp-atom/git/trees{/sha}","statuses_url":"https://api.github.com/repos/adriaanp/omnisharp-atom/statuses/{sha}","languages_url":"https://api.github.com/repos/adriaanp/omnisharp-atom/languages","stargazers_url":"https://api.github.com/repos/adriaanp/omnisharp-atom/stargazers","contributors_url":"https://api.github.com/repos/adriaanp/omnisharp-atom/contributors","subscribers_url":"https://api.github.com/repos/adriaanp/omnisharp-atom/subscribers","subscription_url":"https://api.github.com/repos/adriaanp/omnisharp-atom/subscription","commits_url":"https://api.github.com/repos/adriaanp/omnisharp-atom/commits{/sha}","git_commits_url":"https://api.github.com/repos/adriaanp/omnisharp-atom/git/commits{/sha}","comments_url":"https://api.github.com/repos/adriaanp/omnisharp-atom/comments{/number}","issue_comment_url":"https://api.github.com/repos/adriaanp/omnisharp-atom/issues/comments{/number}","contents_url":"https://api.github.com/repos/adriaanp/omnisharp-atom/contents/{+path}","compare_url":"https://api.github.com/repos/adriaanp/omnisharp-atom/compare/{base}...{head}","merges_url":"https://api.github.com/repos/adriaanp/omnisharp-atom/merges","archive_url":"https://api.github.com/repos/adriaanp/omnisharp-atom/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/adriaanp/omnisharp-atom/downloads","issues_url":"https://api.github.com/repos/adriaanp/omnisharp-atom/issues{/number}","pulls_url":"https://api.github.com/repos/adriaanp/omnisharp-atom/pulls{/number}","milestones_url":"https://api.github.com/repos/adriaanp/omnisharp-atom/milestones{/number}","notifications_url":"https://api.github.com/repos/adriaanp/omnisharp-atom/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/adriaanp/omnisharp-atom/labels{/name}","releases_url":"https://api.github.com/repos/adriaanp/omnisharp-atom/releases{/id}","created_at":"2015-04-23T20:00:35Z","updated_at":"2015-04-30T21:25:55Z","pushed_at":"2015-05-20T14:39:39Z","git_url":"git://github.com/adriaanp/omnisharp-atom.git","ssh_url":"git@github.com:adriaanp/omnisharp-atom.git","clone_url":"https://github.com/adriaanp/omnisharp-atom.git","svn_url":"https://github.com/adriaanp/omnisharp-atom","homepage":null,"size":4589,"stargazers_count":0,"watchers_count":0,"language":"TypeScript","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"OmniSharp:master","ref":"master","sha":"a8c277cd63c263e4963cd4bc8d5062a895cff273","user":{"login":"OmniSharp","id":9420663,"avatar_url":"https://avatars.githubusercontent.com/u/9420663?v=3","gravatar_id":"","url":"https://api.github.com/users/OmniSharp","html_url":"https://github.com/OmniSharp","followers_url":"https://api.github.com/users/OmniSharp/followers","following_url":"https://api.github.com/users/OmniSharp/following{/other_user}","gists_url":"https://api.github.com/users/OmniSharp/gists{/gist_id}","starred_url":"https://api.github.com/users/OmniSharp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/OmniSharp/subscriptions","organizations_url":"https://api.github.com/users/OmniSharp/orgs","repos_url":"https://api.github.com/users/OmniSharp/repos","events_url":"https://api.github.com/users/OmniSharp/events{/privacy}","received_events_url":"https://api.github.com/users/OmniSharp/received_events","type":"Organization","site_admin":false},"repo":{"id":23760859,"name":"omnisharp-atom","full_name":"OmniSharp/omnisharp-atom","owner":{"login":"OmniSharp","id":9420663,"avatar_url":"https://avatars.githubusercontent.com/u/9420663?v=3","gravatar_id":"","url":"https://api.github.com/users/OmniSharp","html_url":"https://github.com/OmniSharp","followers_url":"https://api.github.com/users/OmniSharp/followers","following_url":"https://api.github.com/users/OmniSharp/following{/other_user}","gists_url":"https://api.github.com/users/OmniSharp/gists{/gist_id}","starred_url":"https://api.github.com/users/OmniSharp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/OmniSharp/subscriptions","organizations_url":"https://api.github.com/users/OmniSharp/orgs","repos_url":"https://api.github.com/users/OmniSharp/repos","events_url":"https://api.github.com/users/OmniSharp/events{/privacy}","received_events_url":"https://api.github.com/users/OmniSharp/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/OmniSharp/omnisharp-atom","description":"Omnisharp support for the atom editor","fork":false,"url":"https://api.github.com/repos/OmniSharp/omnisharp-atom","forks_url":"https://api.github.com/repos/OmniSharp/omnisharp-atom/forks","keys_url":"https://api.github.com/repos/OmniSharp/omnisharp-atom/keys{/key_id}","collaborators_url":"https://api.github.com/repos/OmniSharp/omnisharp-atom/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/OmniSharp/omnisharp-atom/teams","hooks_url":"https://api.github.com/repos/OmniSharp/omnisharp-atom/hooks","issue_events_url":"https://api.github.com/repos/OmniSharp/omnisharp-atom/issues/events{/number}","events_url":"https://api.github.com/repos/OmniSharp/omnisharp-atom/events","assignees_url":"https://api.github.com/repos/OmniSharp/omnisharp-atom/assignees{/user}","branches_url":"https://api.github.com/repos/OmniSharp/omnisharp-atom/branches{/branch}","tags_url":"https://api.github.com/repos/OmniSharp/omnisharp-atom/tags","blobs_url":"https://api.github.com/repos/OmniSharp/omnisharp-atom/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/OmniSharp/omnisharp-atom/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/OmniSharp/omnisharp-atom/git/refs{/sha}","trees_url":"https://api.github.com/repos/OmniSharp/omnisharp-atom/git/trees{/sha}","statuses_url":"https://api.github.com/repos/OmniSharp/omnisharp-atom/statuses/{sha}","languages_url":"https://api.github.com/repos/OmniSharp/omnisharp-atom/languages","stargazers_url":"https://api.github.com/repos/OmniSharp/omnisharp-atom/stargazers","contributors_url":"https://api.github.com/repos/OmniSharp/omnisharp-atom/contributors","subscribers_url":"https://api.github.com/repos/OmniSharp/omnisharp-atom/subscribers","subscription_url":"https://api.github.com/repos/OmniSharp/omnisharp-atom/subscription","commits_url":"https://api.github.com/repos/OmniSharp/omnisharp-atom/commits{/sha}","git_commits_url":"https://api.github.com/repos/OmniSharp/omnisharp-atom/git/commits{/sha}","comments_url":"https://api.github.com/repos/OmniSharp/omnisharp-atom/comments{/number}","issue_comment_url":"https://api.github.com/repos/OmniSharp/omnisharp-atom/issues/comments{/number}","contents_url":"https://api.github.com/repos/OmniSharp/omnisharp-atom/contents/{+path}","compare_url":"https://api.github.com/repos/OmniSharp/omnisharp-atom/compare/{base}...{head}","merges_url":"https://api.github.com/repos/OmniSharp/omnisharp-atom/merges","archive_url":"https://api.github.com/repos/OmniSharp/omnisharp-atom/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/OmniSharp/omnisharp-atom/downloads","issues_url":"https://api.github.com/repos/OmniSharp/omnisharp-atom/issues{/number}","pulls_url":"https://api.github.com/repos/OmniSharp/omnisharp-atom/pulls{/number}","milestones_url":"https://api.github.com/repos/OmniSharp/omnisharp-atom/milestones{/number}","notifications_url":"https://api.github.com/repos/OmniSharp/omnisharp-atom/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/OmniSharp/omnisharp-atom/labels{/name}","releases_url":"https://api.github.com/repos/OmniSharp/omnisharp-atom/releases{/id}","created_at":"2014-09-07T13:48:04Z","updated_at":"2015-05-20T13:38:48Z","pushed_at":"2015-05-20T14:39:40Z","git_url":"git://github.com/OmniSharp/omnisharp-atom.git","ssh_url":"git@github.com:OmniSharp/omnisharp-atom.git","clone_url":"https://github.com/OmniSharp/omnisharp-atom.git","svn_url":"https://github.com/OmniSharp/omnisharp-atom","homepage":null,"size":7663,"stargazers_count":150,"watchers_count":150,"language":"TypeScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":29,"mirror_url":null,"open_issues_count":42,"forks":29,"open_issues":42,"watchers":150,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/OmniSharp/omnisharp-atom/pulls/294"},"html":{"href":"https://github.com/OmniSharp/omnisharp-atom/pull/294"},"issue":{"href":"https://api.github.com/repos/OmniSharp/omnisharp-atom/issues/294"},"comments":{"href":"https://api.github.com/repos/OmniSharp/omnisharp-atom/issues/294/comments"},"review_comments":{"href":"https://api.github.com/repos/OmniSharp/omnisharp-atom/pulls/294/comments"},"review_comment":{"href":"https://api.github.com/repos/OmniSharp/omnisharp-atom/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/OmniSharp/omnisharp-atom/pulls/294/commits"},"statuses":{"href":"https://api.github.com/repos/OmniSharp/omnisharp-atom/statuses/89b2ffe0e0f594f34d3be23044f159cbeb9565c6"}}}}