Thread overview
Finding the best auto completion sorting
Apr 05, 2021
WebFreak001
Apr 06, 2021
Paulo Pinto
Apr 06, 2021
WebFreak001
Apr 09, 2021
Jacob Carlborg
Apr 06, 2021
WebFreak001
Apr 08, 2021
James Blachly
Apr 08, 2021
James Blachly
April 05, 2021

Hi all, there have been sorting improvements made in serve-d which will affect how user's auto completion will look like when having broad matches. (1)

To get a better starting point how you prefer it I would like to do a survey where everyone sends in their preferred sorting rules.

For this please visit https://completion.webfreak.org/ and submit your preferred sorting for this broad auto complete case.

In reality not all types can even be shown at once, (e.g. both opBinary and init at the same time would be impossible) but for the general case this is helpful in finding what users expect.

April 06, 2021

On Monday, 5 April 2021 at 22:50:29 UTC, WebFreak001 wrote:

>

Hi all, there have been sorting improvements made in serve-d which will affect how user's auto completion will look like when having broad matches. (1)

To get a better starting point how you prefer it I would like to do a survey where everyone sends in their preferred sorting rules.

For this please visit https://completion.webfreak.org/ and submit your preferred sorting for this broad auto complete case.

In reality not all types can even be shown at once, (e.g. both opBinary and init at the same time would be impossible) but for the general case this is helpful in finding what users expect.

Thanks for the work, maybe another approach to the sorting order would be to integrate something like Intelicode, https://marketplace.visualstudio.com/items?itemName=VisualStudioExptTeam.vscodeintellicode

April 06, 2021

On Tuesday, 6 April 2021 at 05:48:19 UTC, Paulo Pinto wrote:

>

On Monday, 5 April 2021 at 22:50:29 UTC, WebFreak001 wrote:

>

Hi all, there have been sorting improvements made in serve-d which will affect how user's auto completion will look like when having broad matches. (1)

To get a better starting point how you prefer it I would like to do a survey where everyone sends in their preferred sorting rules.

For this please visit https://completion.webfreak.org/ and submit your preferred sorting for this broad auto complete case.

In reality not all types can even be shown at once, (e.g. both opBinary and init at the same time would be impossible) but for the general case this is helpful in finding what users expect.

Thanks for the work, maybe another approach to the sorting order would be to integrate something like Intelicode, https://marketplace.visualstudio.com/items?itemName=VisualStudioExptTeam.vscodeintellicode

that would certainly be nice but until they open it up to third party developers it's impossible to actually add that using their extension. You would need to roll your own and I think a simple list of commonly used things in a given context would work just as well. (also sourced from projects on GitHub)

April 06, 2021

On Monday, 5 April 2021 at 22:50:29 UTC, WebFreak001 wrote:

>

[...]

if you want to look at the results: https://completion.webfreak.org/view.html

April 07, 2021
On 4/5/21 6:50 PM, WebFreak001 wrote:
> Hi all, there have been sorting improvements made in serve-d which will affect how user's auto completion will look like when having broad matches. [(1)]
> 
> To get a better starting point how you prefer it I would like to do a survey where everyone sends in their preferred sorting rules.
> 
> For this please visit https://completion.webfreak.org/ and submit your preferred sorting for this broad auto complete case.
> 
> In reality not all types can even be shown at once, (e.g. both `opBinary` and `init` at the same time would be impossible) but for the general case this is helpful in finding what users expect.
> 
> [(1)]: https://github.com/Pure-D/serve-d/pull/127

These may be standard VSCode icons, but is there a key somewhere? The semantic meaning is not always clear, and that would influence my sort order (and apparently did influence sort order of other respondents based on the results link you shared)

Anyway this is an extremely attractive UI and way to present/query this data -- great work

April 07, 2021
On 4/7/21 9:35 PM, James Blachly wrote:
> On 4/5/21 6:50 PM, WebFreak001 wrote:
>> Hi all, there have been sorting improvements made in serve-d which will affect how user's auto completion will look like when having broad matches. [(1)]
>>
>> To get a better starting point how you prefer it I would like to do a survey where everyone sends in their preferred sorting rules.
>>
>> For this please visit https://completion.webfreak.org/ and submit your preferred sorting for this broad auto complete case.
>>
>> In reality not all types can even be shown at once, (e.g. both `opBinary` and `init` at the same time would be impossible) but for the general case this is helpful in finding what users expect.
>>
>> [(1)]: https://github.com/Pure-D/serve-d/pull/127
> 
> These may be standard VSCode icons, but is there a key somewhere? The semantic meaning is not always clear, and that would influence my sort order (and apparently did influence sort order of other respondents based on the results link you shared)
> 
> Anyway this is an extremely attractive UI and way to present/query this data -- great work
> 

Self reply:
Icon key here: https://code.visualstudio.com/docs/editor/intellisense

April 09, 2021
On 2021-04-06 08:36, WebFreak001 wrote:

> that would certainly be nice but until they open it up to third party developers it's impossible to actually add that using their extension. You would need to roll your own and I think a simple list of commonly used things in a given context would work just as well. (also sourced from projects on GitHub)

There's still a lot of room for improvements without having to use AI to sort the list. For example, make it aware of the context:

long foo = bar.

If auto completion is triggered at the dot, it should prefer those methods/fields that return `long`, then `int` and so on.

There could also be some common cases that are hardcoded based on the surrounding context. For example:

int[] arr;

if (arr.

If auto completion is triggered at the dot, it should probably prefer the `empty` function and then the `length` property.

But these features would probably require more semantic analysis than DCD is capable of.

-- 
/Jacob Carlborg
April 17, 2021

On Monday, 5 April 2021 at 22:50:29 UTC, WebFreak001 wrote:

>

Hi all, there have been sorting improvements made in serve-d which will affect how user's auto completion will look like when having broad matches. (1)

To get a better starting point how you prefer it I would like to do a survey where everyone sends in their preferred sorting rules.

For this please visit https://completion.webfreak.org/ and submit your preferred sorting for this broad auto complete case.

In reality not all types can even be shown at once, (e.g. both opBinary and init at the same time would be impossible) but for the general case this is helpful in finding what users expect.

Idea:

  1. Scan existent projects:
  • scan dlang sources, phobos
  • scan popular packages from dlang site
  1. Take line with "import ..." from each .d file
  2. Sort by usage count

["std.math"] = 1000
["std.string"] = 900
["std.stdio"] = 200

It will best suggestion.

Next Idea:
Scan user projects. Find imports. Sort by counter.

It will bestest for user suggestion.