Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

View of implicits in scope #362

Open
iusildra opened this issue Oct 11, 2023 · 1 comment
Open

View of implicits in scope #362

iusildra opened this issue Oct 11, 2023 · 1 comment

Comments

@iusildra
Copy link

Is your feature request related to a problem? Please describe.

While implicits are awesome, they can sometimes be tricky and it can be hard to find the right instance of implicit used in a given scope

// File A
object implicits:
  def foo(x: Int)(using y: Int): Int = x + y

object test:
  implicits.foo(1) // (given_Int) <- where is it defined ?

// File B
given Int = 42

Describe the solution you'd like

A view of the implicits in the current scope, to then display it somewhere in the IDE. For the example above, it could return

B.given_Int

(This could also help lower the difficulty for newcomers)

Describe alternatives you've considered

None

Additional context

No response

Search terms

implicit, given, context

@tgodzik
Copy link
Contributor

tgodzik commented Oct 12, 2023

Thanks for reporting! You should be able to go to definition via the link in hover over implicit parameter decoration (can be turned on in the settings)

image

We will be working on adding inlay hints instead, which should be much easier to use.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants