These are chat archives for ensime/ensime-atom

27th
Aug 2015
Viktor Hedefalk
@hedefalk
Aug 27 2015 08:20
Screen Shot 2015-08-27 at 10.20.13.png
Ok, pure atom question here: Does autoindent while typing work for you guys? I'm using language-scala and have the setting autoindent switched on, but I always get this
Richard Dallaway
@d6y
Aug 27 2015 11:00
Seems to work OK for me - I didn’t know I had that turned on. Indenting generally is a bit weird (I ask for spaces not tabs), but that seems to be OK.

Here’s something else I’ve noticed this morning. I have a type alias something like this:

type Result[E, A] = EitherT[Future, E, A]

..and a method that uses it:

def foo: Result[String, Int] = ???

Ensime+Atom is reporting the type of foo as being: EitherT[String,Int] which seems a bit odd to me.

I’d expect EitherT[Future,String,Int] or Result[String,Int].
Viktor Hedefalk
@hedefalk
Aug 27 2015 11:43

@d6y Weird, I wonder what setting I have messed up to break it :(

About the EitherT, can you see what the server communication is? If you hit cmd,shift-I do bring up chrome developer tools you can see the console log in which I print all the outgoing and incoming server communication.

I'm in the spaces instead of tabs camp - did you have issues with that in atom + scala?
Yey! I found the indent setting I've messed up.
Richard Dallaway
@d6y
Aug 27 2015 11:47
\o/
Small victories :-)
Ok - I have a small example project, and logging the requests...
incoming: {"callId":1,"payload":{"typehint":"ConnectionInfo","implementation":{"name":"ENSIME"},"version":"0.8.17"}}
/Users/richard/.atom/packages/Ensime/lib/client.coffee:24 incoming: {"payload":{"typehint":"IndexerReadyEvent"}}
/Users/richard/.atom/packages/Ensime/lib/client.coffee:24 incoming: {"payload":{"typehint":"SendBackgroundMessageEvent","detail":"Initializing Analyzer. Please wait...","code":105}}
/Users/richard/.atom/packages/Ensime/lib/client.coffee:24 incoming: {"payload":{"typehint":"AnalyzerReadyEvent"}}
/Users/richard/.atom/packages/Ensime/lib/client.coffee:24 incoming: {"payload":{"typehint":"FullTypeCheckCompleteEvent"}}
/Users/richard/.atom/packages/Ensime/lib/utils.coffee:44 outgoing: 00008f{"req": {"typehint":"SymbolAtPointReq","file":"/Users/richard/Developer/tmp/atom-alias/src/main/scala/example.scala","point":269}, "callId": 2}
/Users/richard/.atom/packages/Ensime/lib/client.coffee:24 incoming: {"callId":2,"payload":{"name":"scalaz.concurrent.Future$","localName":"Future","typehint":"SymbolInfo","declPos":{"typehint":"OffsetSourcePosition","file":"/Users/richard/Developer/tmp/atom-alias/.ensime_cache/dep-src/source-jars/scalaz/concurrent/Future.scala","offset":9023},"type":{"name":"Future$","fullName":"scalaz.concurrent.Future$","pos":{"typehint":"OffsetSourcePosition","file":"/Users/richard/Developer/tmp/atom-alias/.ensime_cache/dep-src/source-jars/scalaz/concurrent/Future.scala","offset":9023},"typehint":"BasicTypeInfo","typeId":1,"typeArgs":[],"members":[],"declAs":{"typehint":"Object"}},"isCallable":false,"ownerTypeId":2}}
/Users/richard/.atom/packages/Ensime/lib/utils.coffee:44 outgoing: 00008f{"req": {"typehint":"SymbolAtPointReq","file":"/Users/richard/Developer/tmp/atom-alias/src/main/scala/example.scala","point":220}, "callId": 3}
/Users/richard/.atom/packages/Ensime/lib/client.coffee:24 incoming: {"payload":{"typehint":"ClearAllScalaNotesEvent"}}
/Users/richard/.atom/packages/Ensime/lib/client.coffee:24 incoming: {"callId":3,"payload":{"name":"withAlias","localName":"withAlias","typehint":"SymbolInfo","declPos":{"typehint":"OffsetSourcePosition","file":"/Users/richard/Developer/tmp/atom-alias/src/main/scala/example.scala","offset":216},"type":{"name":"EitherT","fullName":"scalaz.EitherT","typehint":"BasicTypeInfo","typeId":3,"typeArgs":[{"name":"String","fullName":"java.lang.String","typehint":"BasicTypeInfo","typeId":4,"typeArgs":[],"members":[],"declAs":{"typehint":"Class"}},{"name":"Int","fullName":"scala.Int","typehint":"BasicTypeInfo","typeId":5,"typeArgs":[],"members":[],"declAs":{"typehint":"Class"}}],"members":[],"declAs":{"typehint":"Class"}},"isCallable":false,"ownerTypeId":6}}
/Users/richard/.atom/packages/Ensime/lib/utils.coffee:44 outgoing: 00008f{"req": {"typehint":"SymbolAtPointReq","file":"/Users/richard/Developer/tmp/atom-alias/src/main/scala/example.scala","point":105}, "callId": 4}
/Users/richard/.atom/packages/Ensime/lib/client.coffee:24 incoming: {"callId":4,"payload":{"name":"scalaz.EitherT","localName":"EitherT","typehint":"SymbolInfo","declPos":{"typehint":"OffsetSourcePosition","file":"/Users/richard/Developer/tmp/atom-alias/.ensime_cache/dep-src/source-jars/scalaz/EitherT.scala","offset":264},"type":{"name":"EitherT","fullName":"scalaz.EitherT","pos":{"typehint":"OffsetSourcePosition","file":"/Users/richard/Developer/tmp/atom-alias/.ensime_cache/dep-src/source-jars/scalaz/EitherT.scala","offset":264},"typehint":"BasicTypeInfo","typeId":7,"typeArgs":[{"name":"F","fullName":"scalaz.F","typehint":"BasicTypeInfo","typeId":8,"typeArgs":[],"members":[],"declAs":{"typehint":"Nil"}},{"name":"A","fullName":"scalaz.A","typehint":"BasicTypeInfo","typeId":9,"typeArgs":[],"members":[],"declAs":{"typehint":"Nil"}},{"name":"B","fullName":"scalaz.B","typehint":"BasicTypeInfo","typeId":10,"typeArgs":[],"members":[],"declAs":{"typehint":"Nil"}}],"members":[],"declAs":{"typehint":"Class"}},"isCallable":false,"ownerTypeId":11}}
withAlias is the method I’m asing for a type hint on. (equivellent to my foo, above)
Viktor Hedefalk
@hedefalk
Aug 27 2015 11:51
Sorry, I went ahead and logged myself:
"payload": {
    "name": "foo",
    "localName": "foo",
    "typehint": "SymbolInfo",
    "declPos": {
      "typehint": "OffsetSourcePosition",
      "file": "/Users/viktor/dev/projects/kostbevakningen/src/test/scala/se/kostbevakningen/parsers/KostbevakningenParserTest.scala",
      "offset": 1157
    },
    "type": {
      "name": "EitherT",
      "fullName": "scalaz.EitherT",
      "typehint": "BasicTypeInfo",
      "typeId": 2959,
      "typeArgs": [
        {
          "name": "String",
          "fullName": "java.lang.String",
          "typehint": "BasicTypeInfo",
          "typeId": 138,
          "typeArgs": [],
          "members": [],
          "declAs": {
            "typehint": "Class"
          }
        },
        {
          "name": "Int",
          "fullName": "scala.Int",
          "typehint": "BasicTypeInfo",
          "typeId": 675,
          "typeArgs": [],
          "members": [],
          "declAs": {
            "typehint": "Class"
          }
        }
      ],
      "members": [],
      "declAs": {
        "typehint": "Class"
      }
    },
    "isCallable": false,
    "ownerTypeId": 949
  }
Richard Dallaway
@d6y
Aug 27 2015 11:51
So looks like EitherT, String and Int are all coming back from the server.
Viktor Hedefalk
@hedefalk
Aug 27 2015 11:52
So it's not just formatting in Atom, but a server issue.
Richard Dallaway
@d6y
Aug 27 2015 11:52
OK - I’ll take it up over there. Thanks.
Viktor Hedefalk
@hedefalk
Aug 27 2015 11:55
Yeah, please open an issue! I would like to know as well… I guess it's something about F being a type constructor but I think that normally works well…
Viktor Hedefalk
@hedefalk
Aug 27 2015 13:01
@d6y I went ahead and reported: ensime/ensime-server#1075
Richard Dallaway
@d6y
Aug 27 2015 13:02
Thanks! What service!
A++++ would shop again
Viktor Hedefalk
@hedefalk
Aug 27 2015 13:04
Needed a break from "real work" :)
Dick Wall
@dickwall
Aug 27 2015 13:45
that screenshot shows it nicely (same in sexp) -although this one probably doesn't have any type params for the method, when there are type params, they don't see to get an entry in the payload
so if you have def mapB: B
yougah
gah
def doSomething[J <: JsonFormat](item: J): JsValue
you can reconstruct the item: J and JsValue
but only the description string has the J <: JsonFormat bit that I can see
so for that one, I chop it off of the front of the description and use it from there, however it would be great to be able to link up that JsonFormat bound as well
just marking the omission here, and also checking that I am correct and it isn't there, versus it being there and me having missed it