scalameta / metals

Scala language server with rich IDE features 🚀

Home Page:https://scalameta.org/metals/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

hover types fails with type alias

andyczerwonka opened this issue · comments

Describe the bug

If I have a type alias, e.g.

type SessionEitherT[T] = EitherT[Future, SessionError, T]

and I have a method that returns that type alias

  private def loadCachedReadyPredictor(
      predictorId: PredictorId,
      version: EntityVersionInput,
      predictorClient: PredictorClient,
      acl: AccessControlSession,
      ctx: OrionContext
  ): SessionEitherT[LoadedPredictor] = { ...

if I use that method is a for comp, e.g.

val result = for {
      loadedPredictor <- loadCachedReadyPredictor(predictorId, version, predictorClient, acl, ctx)
...

Hovering over loadedPredictor does not show the type. If I change the return value to not use the type alias, it works.

Expected behavior

I expect the hover to work in all cases

Operating system

Linux

Editor/Extension

VS Code

Version of Metals

1.3.0

Extra context or search terms

No response

Thanks for the report. Which Scala version are you using?

Side note: if you are using VS Code, you can click on Open a GitHub issue in the help and feedback tab, and this will collect some of the information about your workspace for you.

@kasiaMarek 2.13.12

The Open a Github Issue fails for me.
image

I was able to generate the reports.
reports.zip

Are you able to reproduce it on a self-contained example? I tried doing more or less what you have in the example and it seems to work for me.
Screenshot 2024-04-22 at 07 50 06