{"action":"created","comment":{"url":"https://api.github.com/repos/scalameta/language-server/pulls/comments/159121450","pull_request_review_id":86029302,"id":159121450,"diff_hunk":"@@ -449,6 +442,18 @@ object ScalametaLanguageServer extends LazyLogging {\n     subscriber -> semanticdbPublisher\n   }\n \n+  def configurationStream(connection: Connection)(\n+    implicit scheduler: Scheduler\n+  ): (Observer.Sync[JsValue], Observable[Configuration]) = {\n+    val (subscriber, publisher) = multicast[JsValue]\n+    val configurationPublisher = publisher\n+      .map(json => (json \\ \"scalameta\").as[Configuration])\n+      .doOnNext(conf => logger.info(s\"Configuration updated $conf\"))\n+      .doOnError(e => connection.showMessage(MessageType.Error, e.getMessage))","path":"metaserver/src/main/scala/scala/meta/languageserver/ScalametaLanguageServer.scala","position":190,"original_position":190,"commit_id":"5b1db4191d984f72a41a62664e9de09cdde1e5a1","original_commit_id":"5b1db4191d984f72a41a62664e9de09cdde1e5a1","user":{"login":"gabro","id":691940,"avatar_url":"https://avatars0.githubusercontent.com/u/691940?v=4","gravatar_id":"","url":"https://api.github.com/users/gabro","html_url":"https://github.com/gabro","followers_url":"https://api.github.com/users/gabro/followers","following_url":"https://api.github.com/users/gabro/following{/other_user}","gists_url":"https://api.github.com/users/gabro/gists{/gist_id}","starred_url":"https://api.github.com/users/gabro/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gabro/subscriptions","organizations_url":"https://api.github.com/users/gabro/orgs","repos_url":"https://api.github.com/users/gabro/repos","events_url":"https://api.github.com/users/gabro/events{/privacy}","received_events_url":"https://api.github.com/users/gabro/received_events","type":"User","site_admin":false},"body":"very nice catch, thank you!","created_at":"2017-12-30T11:55:34Z","updated_at":"2017-12-30T11:55:34Z","html_url":"https://github.com/scalameta/language-server/pull/158#discussion_r159121450","pull_request_url":"https://api.github.com/repos/scalameta/language-server/pulls/158","author_association":"COLLABORATOR","_links":{"self":{"href":"https://api.github.com/repos/scalameta/language-server/pulls/comments/159121450"},"html":{"href":"https://github.com/scalameta/language-server/pull/158#discussion_r159121450"},"pull_request":{"href":"https://api.github.com/repos/scalameta/language-server/pulls/158"}},"in_reply_to_id":159078004},"pull_request":{"url":"https://api.github.com/repos/scalameta/language-server/pulls/158","id":159972145,"html_url":"https://github.com/scalameta/language-server/pull/158","diff_url":"https://github.com/scalameta/language-server/pull/158.diff","patch_url":"https://github.com/scalameta/language-server/pull/158.patch","issue_url":"https://api.github.com/repos/scalameta/language-server/issues/158","number":158,"state":"open","locked":false,"title":"Refactor server around configuration Observable","user":{"login":"gabro","id":691940,"avatar_url":"https://avatars0.githubusercontent.com/u/691940?v=4","gravatar_id":"","url":"https://api.github.com/users/gabro","html_url":"https://github.com/gabro","followers_url":"https://api.github.com/users/gabro/followers","following_url":"https://api.github.com/users/gabro/following{/other_user}","gists_url":"https://api.github.com/users/gabro/gists{/gist_id}","starred_url":"https://api.github.com/users/gabro/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gabro/subscriptions","organizations_url":"https://api.github.com/users/gabro/orgs","repos_url":"https://api.github.com/users/gabro/repos","events_url":"https://api.github.com/users/gabro/events{/privacy}","received_events_url":"https://api.github.com/users/gabro/received_events","type":"User","site_admin":false},"body":"This turned out to be a bit larger than I imagined, so I'm opening the PR although it's not completely done.\r\n\r\nSome highlights:\r\n- we now produce an `Observable[Configuration]` that gets passed around to providers\r\n- as a result, providers are now in charge of instantiating whatever resource they need, using the configuration (e.g.  `DocumentFormattingProvider` creates a `Formatter`, instead of receiving it as input). I think this makes more sense in term of ownership and the `ScalametaLanguageServer` is now only managing providers, instead of all their dependencies)\r\n- since now most providers' actions require accessing the configuration via `lastL`, they now return a `Task` directly, which again I think it makes sense. _\"Task all the things!\"_ (cit)\r\n- I've decided to use `lastL` and not `lastOptionL`, which is a bit inconvenient to work with. In order to guarantee that the configuration observable is never empty I've decided to feed it a default configuration upon creation.\r\n\r\nFuture work (for another PR):\r\n- finish adding features to the configuration\r\n- use the features to dynamically register/unregister server capabilities (instead of determining them statically at boot)\r\n\r\n### TODO\r\n- [x] investigate test failures\r\n- [ ] add new configuration options to vscode client\r\n\r\n","created_at":"2017-12-23T15:53:52Z","updated_at":"2017-12-30T11:55:34Z","closed_at":null,"merged_at":null,"merge_commit_sha":"43072db1aa3a91c0cc7cb517e5bf5e64f6555fdc","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/scalameta/language-server/pulls/158/commits","review_comments_url":"https://api.github.com/repos/scalameta/language-server/pulls/158/comments","review_comment_url":"https://api.github.com/repos/scalameta/language-server/pulls/comments{/number}","comments_url":"https://api.github.com/repos/scalameta/language-server/issues/158/comments","statuses_url":"https://api.github.com/repos/scalameta/language-server/statuses/5b1db4191d984f72a41a62664e9de09cdde1e5a1","head":{"label":"gabro:use-configuration","ref":"use-configuration","sha":"5b1db4191d984f72a41a62664e9de09cdde1e5a1","user":{"login":"gabro","id":691940,"avatar_url":"https://avatars0.githubusercontent.com/u/691940?v=4","gravatar_id":"","url":"https://api.github.com/users/gabro","html_url":"https://github.com/gabro","followers_url":"https://api.github.com/users/gabro/followers","following_url":"https://api.github.com/users/gabro/following{/other_user}","gists_url":"https://api.github.com/users/gabro/gists{/gist_id}","starred_url":"https://api.github.com/users/gabro/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gabro/subscriptions","organizations_url":"https://api.github.com/users/gabro/orgs","repos_url":"https://api.github.com/users/gabro/repos","events_url":"https://api.github.com/users/gabro/events{/privacy}","received_events_url":"https://api.github.com/users/gabro/received_events","type":"User","site_admin":false},"repo":{"id":112172402,"name":"language-server","full_name":"gabro/language-server","owner":{"login":"gabro","id":691940,"avatar_url":"https://avatars0.githubusercontent.com/u/691940?v=4","gravatar_id":"","url":"https://api.github.com/users/gabro","html_url":"https://github.com/gabro","followers_url":"https://api.github.com/users/gabro/followers","following_url":"https://api.github.com/users/gabro/following{/other_user}","gists_url":"https://api.github.com/users/gabro/gists{/gist_id}","starred_url":"https://api.github.com/users/gabro/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gabro/subscriptions","organizations_url":"https://api.github.com/users/gabro/orgs","repos_url":"https://api.github.com/users/gabro/repos","events_url":"https://api.github.com/users/gabro/events{/privacy}","received_events_url":"https://api.github.com/users/gabro/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/gabro/language-server","description":"WIP - Language Server Protocol integrating Scalameta-based tools","fork":true,"url":"https://api.github.com/repos/gabro/language-server","forks_url":"https://api.github.com/repos/gabro/language-server/forks","keys_url":"https://api.github.com/repos/gabro/language-server/keys{/key_id}","collaborators_url":"https://api.github.com/repos/gabro/language-server/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/gabro/language-server/teams","hooks_url":"https://api.github.com/repos/gabro/language-server/hooks","issue_events_url":"https://api.github.com/repos/gabro/language-server/issues/events{/number}","events_url":"https://api.github.com/repos/gabro/language-server/events","assignees_url":"https://api.github.com/repos/gabro/language-server/assignees{/user}","branches_url":"https://api.github.com/repos/gabro/language-server/branches{/branch}","tags_url":"https://api.github.com/repos/gabro/language-server/tags","blobs_url":"https://api.github.com/repos/gabro/language-server/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/gabro/language-server/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/gabro/language-server/git/refs{/sha}","trees_url":"https://api.github.com/repos/gabro/language-server/git/trees{/sha}","statuses_url":"https://api.github.com/repos/gabro/language-server/statuses/{sha}","languages_url":"https://api.github.com/repos/gabro/language-server/languages","stargazers_url":"https://api.github.com/repos/gabro/language-server/stargazers","contributors_url":"https://api.github.com/repos/gabro/language-server/contributors","subscribers_url":"https://api.github.com/repos/gabro/language-server/subscribers","subscription_url":"https://api.github.com/repos/gabro/language-server/subscription","commits_url":"https://api.github.com/repos/gabro/language-server/commits{/sha}","git_commits_url":"https://api.github.com/repos/gabro/language-server/git/commits{/sha}","comments_url":"https://api.github.com/repos/gabro/language-server/comments{/number}","issue_comment_url":"https://api.github.com/repos/gabro/language-server/issues/comments{/number}","contents_url":"https://api.github.com/repos/gabro/language-server/contents/{+path}","compare_url":"https://api.github.com/repos/gabro/language-server/compare/{base}...{head}","merges_url":"https://api.github.com/repos/gabro/language-server/merges","archive_url":"https://api.github.com/repos/gabro/language-server/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/gabro/language-server/downloads","issues_url":"https://api.github.com/repos/gabro/language-server/issues{/number}","pulls_url":"https://api.github.com/repos/gabro/language-server/pulls{/number}","milestones_url":"https://api.github.com/repos/gabro/language-server/milestones{/number}","notifications_url":"https://api.github.com/repos/gabro/language-server/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/gabro/language-server/labels{/name}","releases_url":"https://api.github.com/repos/gabro/language-server/releases{/id}","deployments_url":"https://api.github.com/repos/gabro/language-server/deployments","created_at":"2017-11-27T09:00:54Z","updated_at":"2017-11-27T09:00:56Z","pushed_at":"2017-12-29T15:31:57Z","git_url":"git://github.com/gabro/language-server.git","ssh_url":"git@github.com:gabro/language-server.git","clone_url":"https://github.com/gabro/language-server.git","svn_url":"https://github.com/gabro/language-server","homepage":"","size":864,"stargazers_count":0,"watchers_count":0,"language":"Scala","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":null,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"scalameta:master","ref":"master","sha":"cdbf2f2a8789888be8c4fe496bf8e8d7cf73421b","user":{"login":"scalameta","id":7526438,"avatar_url":"https://avatars1.githubusercontent.com/u/7526438?v=4","gravatar_id":"","url":"https://api.github.com/users/scalameta","html_url":"https://github.com/scalameta","followers_url":"https://api.github.com/users/scalameta/followers","following_url":"https://api.github.com/users/scalameta/following{/other_user}","gists_url":"https://api.github.com/users/scalameta/gists{/gist_id}","starred_url":"https://api.github.com/users/scalameta/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/scalameta/subscriptions","organizations_url":"https://api.github.com/users/scalameta/orgs","repos_url":"https://api.github.com/users/scalameta/repos","events_url":"https://api.github.com/users/scalameta/events{/privacy}","received_events_url":"https://api.github.com/users/scalameta/received_events","type":"Organization","site_admin":false},"repo":{"id":109404123,"name":"language-server","full_name":"scalameta/language-server","owner":{"login":"scalameta","id":7526438,"avatar_url":"https://avatars1.githubusercontent.com/u/7526438?v=4","gravatar_id":"","url":"https://api.github.com/users/scalameta","html_url":"https://github.com/scalameta","followers_url":"https://api.github.com/users/scalameta/followers","following_url":"https://api.github.com/users/scalameta/following{/other_user}","gists_url":"https://api.github.com/users/scalameta/gists{/gist_id}","starred_url":"https://api.github.com/users/scalameta/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/scalameta/subscriptions","organizations_url":"https://api.github.com/users/scalameta/orgs","repos_url":"https://api.github.com/users/scalameta/repos","events_url":"https://api.github.com/users/scalameta/events{/privacy}","received_events_url":"https://api.github.com/users/scalameta/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/scalameta/language-server","description":"WIP - Language Server Protocol integrating Scalameta-based tools","fork":false,"url":"https://api.github.com/repos/scalameta/language-server","forks_url":"https://api.github.com/repos/scalameta/language-server/forks","keys_url":"https://api.github.com/repos/scalameta/language-server/keys{/key_id}","collaborators_url":"https://api.github.com/repos/scalameta/language-server/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/scalameta/language-server/teams","hooks_url":"https://api.github.com/repos/scalameta/language-server/hooks","issue_events_url":"https://api.github.com/repos/scalameta/language-server/issues/events{/number}","events_url":"https://api.github.com/repos/scalameta/language-server/events","assignees_url":"https://api.github.com/repos/scalameta/language-server/assignees{/user}","branches_url":"https://api.github.com/repos/scalameta/language-server/branches{/branch}","tags_url":"https://api.github.com/repos/scalameta/language-server/tags","blobs_url":"https://api.github.com/repos/scalameta/language-server/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/scalameta/language-server/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/scalameta/language-server/git/refs{/sha}","trees_url":"https://api.github.com/repos/scalameta/language-server/git/trees{/sha}","statuses_url":"https://api.github.com/repos/scalameta/language-server/statuses/{sha}","languages_url":"https://api.github.com/repos/scalameta/language-server/languages","stargazers_url":"https://api.github.com/repos/scalameta/language-server/stargazers","contributors_url":"https://api.github.com/repos/scalameta/language-server/contributors","subscribers_url":"https://api.github.com/repos/scalameta/language-server/subscribers","subscription_url":"https://api.github.com/repos/scalameta/language-server/subscription","commits_url":"https://api.github.com/repos/scalameta/language-server/commits{/sha}","git_commits_url":"https://api.github.com/repos/scalameta/language-server/git/commits{/sha}","comments_url":"https://api.github.com/repos/scalameta/language-server/comments{/number}","issue_comment_url":"https://api.github.com/repos/scalameta/language-server/issues/comments{/number}","contents_url":"https://api.github.com/repos/scalameta/language-server/contents/{+path}","compare_url":"https://api.github.com/repos/scalameta/language-server/compare/{base}...{head}","merges_url":"https://api.github.com/repos/scalameta/language-server/merges","archive_url":"https://api.github.com/repos/scalameta/language-server/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/scalameta/language-server/downloads","issues_url":"https://api.github.com/repos/scalameta/language-server/issues{/number}","pulls_url":"https://api.github.com/repos/scalameta/language-server/pulls{/number}","milestones_url":"https://api.github.com/repos/scalameta/language-server/milestones{/number}","notifications_url":"https://api.github.com/repos/scalameta/language-server/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/scalameta/language-server/labels{/name}","releases_url":"https://api.github.com/repos/scalameta/language-server/releases{/id}","deployments_url":"https://api.github.com/repos/scalameta/language-server/deployments","created_at":"2017-11-03T14:18:53Z","updated_at":"2017-12-28T17:32:00Z","pushed_at":"2017-12-30T06:28:14Z","git_url":"git://github.com/scalameta/language-server.git","ssh_url":"git@github.com:scalameta/language-server.git","clone_url":"https://github.com/scalameta/language-server.git","svn_url":"https://github.com/scalameta/language-server","homepage":"","size":835,"stargazers_count":60,"watchers_count":60,"language":"Scala","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":8,"mirror_url":null,"archived":false,"open_issues_count":35,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0"},"forks":8,"open_issues":35,"watchers":60,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/scalameta/language-server/pulls/158"},"html":{"href":"https://github.com/scalameta/language-server/pull/158"},"issue":{"href":"https://api.github.com/repos/scalameta/language-server/issues/158"},"comments":{"href":"https://api.github.com/repos/scalameta/language-server/issues/158/comments"},"review_comments":{"href":"https://api.github.com/repos/scalameta/language-server/pulls/158/comments"},"review_comment":{"href":"https://api.github.com/repos/scalameta/language-server/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/scalameta/language-server/pulls/158/commits"},"statuses":{"href":"https://api.github.com/repos/scalameta/language-server/statuses/5b1db4191d984f72a41a62664e9de09cdde1e5a1"}},"author_association":"COLLABORATOR"}}
{"actor":{"display_login":"gabro"}}