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

IDE: Improve display of completion results #5508

Closed
Duhemm opened this issue Nov 23, 2018 · 0 comments
Closed

IDE: Improve display of completion results #5508

Duhemm opened this issue Nov 23, 2018 · 0 comments

Comments

@Duhemm
Copy link
Contributor

Duhemm commented Nov 23, 2018

I think what we should do eventually is make our own custom Completion data type and return a List[CompletionItem] instead of a `List[Symbol], it could be defined a bit like this:

case class Completion(label: String, description: String, documentation: String, symbols: List[String])

This way we can handle completions with no symbol (wildcards, structural types) and multiple symbols (both a class and an object exist, ...) in a uniform way. For example when there's both a class and an object, we could have the documentation field contain the documentation for both.

instead of just showing the full name we could show the kind of the symbol too, e.g. "class a.b.c.Foo", "val x", ... and in the case where there's more than one symbol with the same name, we could show both at the same time "class and object a.b.c.Foo", ... We can reuse the code used in the REPL when printing a declaration.

Originally posted by @smarter in #5476 (comment)

Duhemm added a commit to dotty-staging/dotty that referenced this issue Nov 27, 2018
One `Completion` represents one completion results that should be
included in the list of completion options. It can represent zero
symbols (for instance, a wildcard import), or more than one (a class and
its companion object). Each `Completion` also has a `description` which
should be displayed in the tool that shows the completion candidates.

Fixes scala#5508
Duhemm added a commit to dotty-staging/dotty that referenced this issue Nov 28, 2018
One `Completion` represents one completion results that should be
included in the list of completion options. It can represent zero
symbols (for instance, a wildcard import), or more than one (a class and
its companion object). Each `Completion` also has a `description` which
should be displayed in the tool that shows the completion candidates.

Fixes scala#5508
@Duhemm Duhemm closed this as completed in 9155812 Dec 2, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant