@@ -262,34 +262,34 @@ class EnsimeLanguageServer(in: InputStream, out: OutputStream) extends LanguageS
262
262
import scala .concurrent .ExecutionContext .Implicits ._
263
263
logger.info(s " Got hover request at ( ${position.line}, ${position.character}). " )
264
264
265
- // val res = for (doc <- documentManager.documentForUri(textDocument.uri)) yield {
266
- // val pos = doc.positionToOffset(position)
267
- // val future = ensimeActor ? TypeAtPointReq(
268
- // Right(toSourceFileInfo(textDocument.uri, Some(new String(doc.contents)))),
269
- // OffsetRange(pos, pos))
270
-
271
- // future.onComplete { f => logger.debug(s"Goto Definition future completed: succes? ${f.isSuccess}") }
272
-
273
- // future.map {
274
- // case typeInfo: TypeInfo =>
275
- // logger.info(s"Retrieved typeInfo $typeInfo")
276
- // Hover(Seq(RawMarkedString("scala", typeInfo.toString)), Some(Range(position, position)))
277
- // }
278
- // }
279
265
val res = for (doc <- documentManager.documentForUri(textDocument.uri)) yield {
280
- val future = ensimeActor ? DocUriAtPointReq (
266
+ val pos = doc.positionToOffset(position)
267
+ val future = ensimeActor ? TypeAtPointReq (
281
268
Right (toSourceFileInfo(textDocument.uri, Some (new String (doc.contents)))),
282
- OffsetRange (doc.positionToOffset(position) ))
269
+ OffsetRange (pos, pos ))
283
270
284
- future.onComplete { f => logger.debug(s " DocUriAtPointReq future completed: succes? ${f.isSuccess}" ) }
271
+ future.onComplete { f => logger.debug(s " Goto Definition future completed: succes? ${f.isSuccess}" ) }
285
272
286
273
future.map {
287
- case Some (sigPair @ DocSigPair (DocSig (_, scalaSig), DocSig (_, javaSig))) =>
288
- val sig = scalaSig.orElse(javaSig).getOrElse(" " )
289
- logger.info(s " Retrieved signature $sig from @sigPair " )
290
- Hover (Seq (RawMarkedString (" scala" , sig)), Some (Range (position, position)))
274
+ case typeInfo : TypeInfo =>
275
+ logger.info(s " Retrieved typeInfo $typeInfo" )
276
+ Hover (Seq (RawMarkedString (" scala" , typeInfo.name + " \n " + typeInfo.fullName)), Some (Range (position, position)))
291
277
}
292
278
}
279
+ // val res = for (doc <- documentManager.documentForUri(textDocument.uri)) yield {
280
+ // val future = ensimeActor ? DocUriAtPointReq(
281
+ // Right(toSourceFileInfo(textDocument.uri, Some(new String(doc.contents)))),
282
+ // OffsetRange(doc.positionToOffset(position)))
283
+
284
+ // future.onComplete { f => logger.debug(s"DocUriAtPointReq future completed: succes? ${f.isSuccess}") }
285
+
286
+ // future.map {
287
+ // case Some(sigPair @ DocSigPair(DocSig(_, scalaSig), DocSig(_, javaSig))) =>
288
+ // val sig = scalaSig.orElse(javaSig).getOrElse("")
289
+ // logger.info(s"Retrieved signature $sig from @sigPair")
290
+ // Hover(Seq(RawMarkedString("scala", sig)), Some(Range(position, position)))
291
+ // }
292
+ // }
293
293
res.map { f => Await .result(f, 5 seconds) } getOrElse Hover (Nil , None )
294
294
}
295
295
0 commit comments