Fsharp: Intellisense list is sorted very wrongly

Created on 15 Mar 2017  路  8Comments  路  Source: dotnet/fsharp

Not-after-dot completion sorted very wrongly:

image

It's fixed in https://github.com/Microsoft/visualfsharp/pull/2594 (not entirely, but almost). Does it make sense to make a separate PR?

Area-IDE Language Service

Most helpful comment

@AmadeusW please also consider looking beyond sorting for Intellisense API revisions:

  • making the list resizeable (when I use APIs with hundreds of members, I really need a bigger list)
  • having more info in the list: R# shows namespaces for members in the list that aren't in scope (it will open the namespace for you if you commit the completion), and it also put the type signature of the elements aligned to the right
  • having extensible way of displaying icons (not just a hardcoded enum, but possibility to add overlays to the icons)
  • having ways to use different text and background styling for items in the list
  • having a default implementation for the MRU behaviour switchable and configurable in the API
  • better way to show overloads (see pictures bellow)

R#:
image

VS:

image

All 8 comments

@vasily-kirichenko I just pulled #2594. So feel free to submit any fixes you think are needed.

Out of curiosity: What's the ideal order in your view?

C# uses alphabetical, but I've heard some people want "more intelligent" sorting.

@JoshVarty R# like.

@JoshVarty one thing R# does is having a MRU of committed completions, and in general you want locals/parameters before the rest.

I'm working on a new Intellisense API specification for VS. I'm interested in what are the desired sorting mechanisms. We are now open for suggestions, and so far we've heard of sorting by

* Camel case match (this will be performed by VS on each keystroke, before other sorts)

  • Scope distance (locals before class members before rest)
  • Recently used
  • Suggested name (when language service proposes a new variable name)
  • Lastly, alphabetical

Language services will be able to implement some, all or more than the above items, in any order. We would like to encourage language services to adopt a standard and predictable way of ordering for consistent UX across languages.

We implemented the following order in F# editor:

For completion after dot:

  • Recently used (but not extension methods)
  • Own (defined in the type before dot) properties
  • Inherited properties
  • Own fields
  • Inherited fields
  • Own methods
  • Inherited methods
  • Own events
  • Inherited events
  • Everything else
  • Extension methods

Then alphabetically Inside each group.

About completion which does not involve a concrete type or module (strictly not after dot sense F# does not allow accessing members inside class via implicit this reference), we are not sure yet. Currently it shows fields (including enum fields) first, then everything else.

@AmadeusW please also consider looking beyond sorting for Intellisense API revisions:

  • making the list resizeable (when I use APIs with hundreds of members, I really need a bigger list)
  • having more info in the list: R# shows namespaces for members in the list that aren't in scope (it will open the namespace for you if you commit the completion), and it also put the type signature of the elements aligned to the right
  • having extensible way of displaying icons (not just a hardcoded enum, but possibility to add overlays to the icons)
  • having ways to use different text and background styling for items in the list
  • having a default implementation for the MRU behaviour switchable and configurable in the API
  • better way to show overloads (see pictures bellow)

R#:
image

VS:

image

Was this page helpful?
0 / 5 - 0 ratings