Skip to content

IDE: Improve display of completion results #5508

Closed
@Duhemm

Description

@Duhemm

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)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions