{"action":"created","issue":{"url":"https://api.github.com/repos/ensime/ensime-atom/issues/64","labels_url":"https://api.github.com/repos/ensime/ensime-atom/issues/64/labels{/name}","comments_url":"https://api.github.com/repos/ensime/ensime-atom/issues/64/comments","events_url":"https://api.github.com/repos/ensime/ensime-atom/issues/64/events","html_url":"https://github.com/ensime/ensime-atom/issues/64","id":104576032,"number":64,"title":"Off-by-one errors on implicit highlighting","user":{"login":"hedefalk","id":116520,"avatar_url":"https://avatars.githubusercontent.com/u/116520?v=3","gravatar_id":"","url":"https://api.github.com/users/hedefalk","html_url":"https://github.com/hedefalk","followers_url":"https://api.github.com/users/hedefalk/followers","following_url":"https://api.github.com/users/hedefalk/following{/other_user}","gists_url":"https://api.github.com/users/hedefalk/gists{/gist_id}","starred_url":"https://api.github.com/users/hedefalk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hedefalk/subscriptions","organizations_url":"https://api.github.com/users/hedefalk/orgs","repos_url":"https://api.github.com/users/hedefalk/repos","events_url":"https://api.github.com/users/hedefalk/events{/privacy}","received_events_url":"https://api.github.com/users/hedefalk/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-09-02T21:33:34Z","updated_at":"2015-09-02T21:53:48Z","closed_at":null,"body":"Scenario:\r\n\r\nHave `val test = \"a\" #> \"foo\"`, types a `o` and get `val test = \"a\" #> \"fooo\"`. Autocomplete triggers a call to server with buffer content which is indexed. Backspace back to `val test = \"a\" #> \"foo\"` and hit save. This triggers call to get implicits. Even if I had a typecheck buffer before tied to save as well it didn't have the time to re-index (even if this call was made before implicit-call). I get a off-by-one error on the marking of the implicit, which looks pretty bad with newlines:\r\n\r\n<img width=\"792\" alt=\"screen shot 2015-09-02 at 23 32 52\" src=\"https://cloud.githubusercontent.com/assets/116520/9645301/f7684ebc-51ca-11e5-9e24-cf2791a50f5f.png\">\r\n\r\n\r\n```\r\nincoming: {\"callId\":404,\"payload\":{\"typehint\":\"CompletionInfoList\",\"prefix\":\"\",\"completions\":[]}}\r\nimplicits.coffee:27 showImplicits this: [object Object]\r\nutils.coffee:37 outgoing: 0000a2{\"req\": {\"typehint\":\"ImplicitInfoReq\",\"file\":\"/Users/viktor/dev/projects/ensime-test-project/src/main/scala/Bar.scala\",\"range\":{\"from\":0,\"to\":76}}, \"callId\": 405}\r\nclient.coffee:14 incoming: {\"callId\":405,\"payload\":{\"typehint\":\"ImplicitInfos\",\"infos\":[{\"params\":[{\"name\":\"stringTransform\",\"localName\":\"stringTransform\",\"declPos\":{\"typehint\":\"OffsetSourcePosition\",\"file\":\"/Users/viktor/dev/projects/ensime-test-project/.ensime_cache/dep-src/source-jars/net/liftweb/util/CssSel.scala\",\"offset\":22360},\"type\":{\"name\":\"CanBind\",\"fullName\":\"net.liftweb.util.CanBind\",\"pos\":{\"typehint\":\"OffsetSourcePosition\",\"file\":\"/Users/viktor/dev/projects/ensime-test-project/.ensime_cache/dep-src/source-jars/net/liftweb/util/CssSel.scala\",\"offset\":22262},\"typehint\":\"BasicTypeInfo\",\"typeId\":45,\"typeArgs\":[{\"name\":\"String\",\"fullName\":\"java.lang.String\",\"typehint\":\"BasicTypeInfo\",\"typeId\":46,\"typeArgs\":[],\"members\":[],\"declAs\":{\"typehint\":\"Class\"}}],\"members\":[],\"declAs\":{\"typehint\":\"Trait\"}},\"isCallable\":false,\"ownerTypeId\":47}],\"typehint\":\"ImplicitParamInfo\",\"fun\":{\"name\":\"#>\",\"localName\":\"#>\",\"declPos\":{\"typehint\":\"OffsetSourcePosition\",\"file\":\"/Users/viktor/dev/projects/ensime-test-project/.ensime_cache/dep-src/source-jars/net/liftweb/util/CssSel.scala\",\"offset\":29237},\"type\":{\"resultType\":{\"name\":\"CssSel\",\"fullName\":\"net.liftweb.util.CssSel\",\"typehint\":\"BasicTypeInfo\",\"typeId\":1,\"typeArgs\":[],\"members\":[],\"declAs\":{\"typehint\":\"Trait\"}},\"name\":\"[T](it: => T)(implicit computer: net.liftweb.util.CanBind[T])net.liftweb.util.CssSel\",\"paramSections\":[{\"params\":[[\"it\",{\"name\":\"<byname>\",\"fullName\":\"scala.<byname>\",\"typehint\":\"BasicTypeInfo\",\"typeId\":4133,\"typeArgs\":[{\"name\":\"T\",\"fullName\":\"net.liftweb.util.T\",\"typehint\":\"BasicTypeInfo\",\"typeId\":4134,\"typeArgs\":[],\"members\":[],\"declAs\":{\"typehint\":\"Nil\"}}],\"members\":[],\"declAs\":{\"typehint\":\"Class\"}}]],\"isImplicit\":false},{\"params\":[[\"computer\",{\"name\":\"CanBind\",\"fullName\":\"net.liftweb.util.CanBind\",\"typehint\":\"BasicTypeInfo\",\"typeId\":4135,\"typeArgs\":[{\"name\":\"T\",\"fullName\":\"net.liftweb.util.T\",\"typehint\":\"BasicTypeInfo\",\"typeId\":4134,\"typeArgs\":[],\"members\":[],\"declAs\":{\"typehint\":\"Nil\"}}],\"members\":[],\"declAs\":{\"typehint\":\"Trait\"}}]],\"isImplicit\":true}],\"typehint\":\"ArrowTypeInfo\",\"typeId\":4136},\"isCallable\":true,\"ownerTypeId\":44},\"funIsImplicit\":false,\"end\":73,\"start\":61},{\"typehint\":\"ImplicitConversionInfo\",\"start\":61,\"end\":64,\"fun\":{\"name\":\"strToCssBindPromoter\",\"localName\":\"strToCssBindPromoter\",\"declPos\":{\"typehint\":\"OffsetSourcePosition\",\"file\":\"/Users/viktor/dev/projects/ensime-test-project/.ensime_cache/dep-src/source-jars/net/liftweb/util/BindHelpers.scala\",\"offset\":47948},\"type\":{\"resultType\":{\"name\":\"ToCssBindPromoter\",\"fullName\":\"net.liftweb.util.ToCssBindPromoter\",\"typehint\":\"BasicTypeInfo\",\"typeId\":44,\"typeArgs\":[],\"members\":[],\"declAs\":{\"typehint\":\"Class\"}},\"name\":\"(str: String)net.liftweb.util.ToCssBindPromoter\",\"paramSections\":[{\"params\":[[\"str\",{\"name\":\"String\",\"fullName\":\"java.lang.String\",\"typehint\":\"BasicTypeInfo\",\"typeId\":46,\"typeArgs\":[],\"members\":[],\"declAs\":{\"typehint\":\"Class\"}}]],\"isImplicit\":false}],\"typehint\":\"ArrowTypeInfo\",\"typeId\":1886},\"isCallable\":true,\"ownerTypeId\":49}}]}}\r\nimplicits.coffee:42 Object {typehint: \"ImplicitInfos\", infos: Array[2]}infos: Array[2]0: Objectend: 73fun: ObjectfunIsImplicit: falseparams: Array[1]start: 61typehint: \"ImplicitParamInfo\"__proto__: Object1: Objectlength: 2__proto__: Array[0]typehint: \"ImplicitInfos\"__proto__: Object\r\nutils.coffee:37 outgoing: 000093{\"req\": {\"typehint\":\"SymbolAtPointReq\",\"file\":\"/Users/viktor/dev/projects/ensime-test-project/src/main/scala/Bar.scala\",\"point\":72}, \"callId\": 406}\r\nclient.coffee:14 incoming: {\"callId\":406,\"payload\":{\"typehint\":\"FalseResponse\"}}\r\nutils.coffee:37 ensime.getSuggestions\r\nutils.coffee:37 outgoing: 000130{\"req\": {\"typehint\":\"CompletionsReq\",\"fileInfo\":{\"file\":\"/Users/viktor/dev/projects/ensime-test-project/src/main/scala/Bar.scala\",\"contents\":\"import net.liftweb.util.Helpers._\\n\\nobject Bar {\\n  val test = \\\"a\\\" #> \\\"fooo\\\"\\n}\\n\"},\"point\":73,\"maxResults\":5,\"caseSens\":false,\"reload\":true}, \"callId\": 407}\r\nclient.coffee:14 incoming: {\"callId\":407,\"payload\":{\"typehint\":\"CompletionInfoList\",\"prefix\":\"\",\"completions\":[]}}\r\nimplicits.coffee:27 showImplicits this: [object Object]\r\nutils.coffee:37 outgoing: 0000a2{\"req\": {\"typehint\":\"ImplicitInfoReq\",\"file\":\"/Users/viktor/dev/projects/ensime-test-project/src/main/scala/Bar.scala\",\"range\":{\"from\":0,\"to\":76}}, \"callId\": 408}\r\nclient.coffee:14 incoming: {\"callId\":408,\"payload\":{\"typehint\":\"ImplicitInfos\",\"infos\":[{\"params\":[{\"name\":\"stringTransform\",\"localName\":\"stringTransform\",\"declPos\":{\"typehint\":\"OffsetSourcePosition\",\"file\":\"/Users/viktor/dev/projects/ensime-test-project/.ensime_cache/dep-src/source-jars/net/liftweb/util/CssSel.scala\",\"offset\":22360},\"type\":{\"name\":\"CanBind\",\"fullName\":\"net.liftweb.util.CanBind\",\"pos\":{\"typehint\":\"OffsetSourcePosition\",\"file\":\"/Users/viktor/dev/projects/ensime-test-project/.ensime_cache/dep-src/source-jars/net/liftweb/util/CssSel.scala\",\"offset\":22262},\"typehint\":\"BasicTypeInfo\",\"typeId\":45,\"typeArgs\":[{\"name\":\"String\",\"fullName\":\"java.lang.String\",\"typehint\":\"BasicTypeInfo\",\"typeId\":46,\"typeArgs\":[],\"members\":[],\"declAs\":{\"typehint\":\"Class\"}}],\"members\":[],\"declAs\":{\"typehint\":\"Trait\"}},\"isCallable\":false,\"ownerTypeId\":47}],\"typehint\":\"ImplicitParamInfo\",\"fun\":{\"name\":\"#>\",\"localName\":\"#>\",\"declPos\":{\"typehint\":\"OffsetSourcePosition\",\"file\":\"/Users/viktor/dev/projects/ensime-test-project/.ensime_cache/dep-src/source-jars/net/liftweb/util/CssSel.scala\",\"offset\":29237},\"type\":{\"resultType\":{\"name\":\"CssSel\",\"fullName\":\"net.liftweb.util.CssSel\",\"typehint\":\"BasicTypeInfo\",\"typeId\":1,\"typeArgs\":[],\"members\":[],\"declAs\":{\"typehint\":\"Trait\"}},\"name\":\"[T](it: => T)(implicit computer: net.liftweb.util.CanBind[T])net.liftweb.util.CssSel\",\"paramSections\":[{\"params\":[[\"it\",{\"name\":\"<byname>\",\"fullName\":\"scala.<byname>\",\"typehint\":\"BasicTypeInfo\",\"typeId\":4137,\"typeArgs\":[{\"name\":\"T\",\"fullName\":\"net.liftweb.util.T\",\"typehint\":\"BasicTypeInfo\",\"typeId\":4138,\"typeArgs\":[],\"members\":[],\"declAs\":{\"typehint\":\"Nil\"}}],\"members\":[],\"declAs\":{\"typehint\":\"Class\"}}]],\"isImplicit\":false},{\"params\":[[\"computer\",{\"name\":\"CanBind\",\"fullName\":\"net.liftweb.util.CanBind\",\"typehint\":\"BasicTypeInfo\",\"typeId\":4139,\"typeArgs\":[{\"name\":\"T\",\"fullName\":\"net.liftweb.util.T\",\"typehint\":\"BasicTypeInfo\",\"typeId\":4138,\"typeArgs\":[],\"members\":[],\"declAs\":{\"typehint\":\"Nil\"}}],\"members\":[],\"declAs\":{\"typehint\":\"Trait\"}}]],\"isImplicit\":true}],\"typehint\":\"ArrowTypeInfo\",\"typeId\":4140},\"isCallable\":true,\"ownerTypeId\":44},\"funIsImplicit\":false,\"end\":74,\"start\":61},{\"typehint\":\"ImplicitConversionInfo\",\"start\":61,\"end\":64,\"fun\":{\"name\":\"strToCssBindPromoter\",\"localName\":\"strToCssBindPromoter\",\"declPos\":{\"typehint\":\"OffsetSourcePosition\",\"file\":\"/Users/viktor/dev/projects/ensime-test-project/.ensime_cache/dep-src/source-jars/net/liftweb/util/BindHelpers.scala\",\"offset\":47948},\"type\":{\"resultType\":{\"name\":\"ToCssBindPromoter\",\"fullName\":\"net.liftweb.util.ToCssBindPromoter\",\"typehint\":\"BasicTypeInfo\",\"typeId\":44,\"typeArgs\":[],\"members\":[],\"declAs\":{\"typehint\":\"Class\"}},\"name\":\"(str: String)net.liftweb.util.ToCssBindPromoter\",\"paramSections\":[{\"params\":[[\"str\",{\"name\":\"String\",\"fullName\":\"java.lang.String\",\"typehint\":\"BasicTypeInfo\",\"typeId\":46,\"typeArgs\":[],\"members\":[],\"declAs\":{\"typehint\":\"Class\"}}]],\"isImplicit\":false}],\"typehint\":\"ArrowTypeInfo\",\"typeId\":1886},\"isCallable\":true,\"ownerTypeId\":49}}]}}\r\n```\r\n\r\n\r\n<bountysource-plugin>\r\n---\r\nWant to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/26401953-off-by-one-errors-on-implicit-highlighting?utm_campaign=plugin&utm_content=tracker%2F14719420&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F14719420&utm_medium=issues&utm_source=github).\r\n</bountysource-plugin>"},"comment":{"url":"https://api.github.com/repos/ensime/ensime-atom/issues/comments/137255961","html_url":"https://github.com/ensime/ensime-atom/issues/64#issuecomment-137255961","issue_url":"https://api.github.com/repos/ensime/ensime-atom/issues/64","id":137255961,"user":{"login":"fommil","id":1914041,"avatar_url":"https://avatars.githubusercontent.com/u/1914041?v=3","gravatar_id":"","url":"https://api.github.com/users/fommil","html_url":"https://github.com/fommil","followers_url":"https://api.github.com/users/fommil/followers","following_url":"https://api.github.com/users/fommil/following{/other_user}","gists_url":"https://api.github.com/users/fommil/gists{/gist_id}","starred_url":"https://api.github.com/users/fommil/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fommil/subscriptions","organizations_url":"https://api.github.com/users/fommil/orgs","repos_url":"https://api.github.com/users/fommil/repos","events_url":"https://api.github.com/users/fommil/events{/privacy}","received_events_url":"https://api.github.com/users/fommil/received_events","type":"User","site_admin":false},"created_at":"2015-09-02T21:53:48Z","updated_at":"2015-09-02T21:53:48Z","body":"hmm, maybe the `end` position is exclusive? We never rigorously defined that. Is it consistently off by one?"}}