scalameta / metals-feature-requests

Issue tracker for Metals feature requests
37 stars 4 forks source link

Hoogle / Type-based search i.e. Inkuire integration #224

Open KacperFKorban opened 3 years ago

KacperFKorban commented 3 years ago

It would be nice to have an integration with Scaladoc's Type-based searches.

Is your feature request related to a problem? Please describe. Searching for symbols requires knowing the name of the symbol.

Describe the solution you'd like Scaladoc for Scala 3 uses Inkuire to provide the ability to search for functions/values by signatures.

inkuire-1 0 0-M2_js_flatMap

It would be great to be able to search for functions this way in IDE.

Some possible UI entry points:

Additional context Some discussion points How should Inkuire be used, it can be used in three different ways:

What should be the action for the scenario with input box? (go to source | go to documentation)

Search terms: hoogle, search, inkuire

GavinRay97 commented 3 years ago

Brilliant! And as a follow-up thought: With that in place, how awesome would it be to be able to write something like this:

def readFile(file: File): String = ???

And then be able to trigger a suggestion showing a dropdown list of matching functions with the signature:

File => String

Where selecting one would automatically fill the argument value that takes type File:

def readFile(file: File): String =
     Files.readString(file)
// or
def readFile: String = Files.readString

And this one is farfetched, but what about even 👀

def something() =
  val file: File = File("file.txt")
  File => String // press hotkey to trigger suggestion with cursor here
  // gets rewritten to:
  val result = Files.readString(file)