dragos / dragos-vscode-scala

Other
253 stars 39 forks source link

NPE when opening file without a .ensime #16

Closed dragos closed 7 years ago

dragos commented 7 years ago

If there's no .ensime there's no Ensime actor:

[2016-12-09 14:27:08,237] ERROR langserver.core.Connection - failed notification handler
java.lang.NullPointerException: null
    at org.github.dragos.vscode.EnsimeLanguageServer.onOpenTextDocument(EnsimeLanguageServer.scala:105)
    at langserver.core.LanguageServer$$anonfun$2.apply(LanguageServer.scala:39)
    at langserver.core.LanguageServer$$anonfun$2.apply(LanguageServer.scala:38)
    at langserver.core.Connection$$anonfun$notifySubscribers$1$$anonfun$apply$1.apply$mcV$sp(Connection.scala:42)
    at langserver.core.Connection$$anonfun$notifySubscribers$1$$anonfun$apply$1.apply(Connection.scala:42)
    at langserver.core.Connection$$anonfun$notifySubscribers$1$$anonfun$apply$1.apply(Connection.scala:42)
    at scala.util.Try$.apply(Try.scala:192)
    at langserver.core.Connection$$anonfun$notifySubscribers$1.apply(Connection.scala:42)
    at langserver.core.Connection$$anonfun$notifySubscribers$1.apply(Connection.scala:41)
    at scala.collection.immutable.List.foreach(List.scala:381)
    at scala.collection.generic.TraversableForwarder$class.foreach(TraversableForwarder.scala:35)
    at scala.collection.mutable.ListBuffer.foreach(ListBuffer.scala:45)
    at langserver.core.Connection.notifySubscribers(Connection.scala:41)
    at langserver.core.Connection$$anonfun$start$2$$anonfun$apply$4.apply(Connection.scala:98)
    at langserver.core.Connection$$anonfun$start$2$$anonfun$apply$4.apply(Connection.scala:98)
    at play.api.libs.json.JsResult$class.fold(JsResult.scala:76)
    at play.api.libs.json.JsSuccess.fold(JsResult.scala:9)
    at langserver.core.Connection$$anonfun$start$2.apply(Connection.scala:97)
    at langserver.core.Connection$$anonfun$start$2.apply(Connection.scala:97)
    at scala.Option.fold(Option.scala:158)
    at langserver.core.Connection.start(Connection.scala:97)
    at langserver.core.LanguageServer.start(LanguageServer.scala:48)
    at org.github.dragos.vscode.EnsimeLanguageServer.start(EnsimeLanguageServer.scala:47)
    at org.github.dragos.vscode.Main$.main(Main.scala:23)
    at org.github.dragos.vscode.Main.main(Main.scala)
dragos commented 7 years ago

This was fixed a while ago...