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

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

Open
KacperFKorban opened this issue Aug 10, 2021 · 1 comment
Open

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

KacperFKorban opened this issue Aug 10, 2021 · 1 comment

Comments

@KacperFKorban
Copy link

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:

  • Search input box (like in scaladoc). Example demo:
    inkuire-vscode-map
  • Completion search. When asking for completions, ability to provide required arguments and return type.

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

  • HTTP server
  • JS worker
  • Scala library

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

Search terms:
hoogle, search, inkuire

@GavinRay97
Copy link

GavinRay97 commented Aug 20, 2021

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)

@KacperFKorban KacperFKorban changed the title Type-based search (Inkuire) Hoogle / Type-based search i.e. Inkuire integration Nov 17, 2021
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