www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - Finding the best auto completion sorting

reply WebFreak001 <d.forum webfreak.org> writes:
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
Apr 05 2021
next sibling parent reply Paulo Pinto <pjmlp progtools.org> writes:
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.

 [(1)]: https://github.com/Pure-D/serve-d/pull/127
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
Apr 05 2021
parent reply WebFreak001 <d.forum webfreak.org> writes:
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.

 [(1)]: https://github.com/Pure-D/serve-d/pull/127
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)
Apr 05 2021
parent Jacob Carlborg <doob me.com> writes:
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
Apr 09 2021
prev sibling next sibling parent WebFreak001 <d.forum webfreak.org> writes:
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
Apr 06 2021
prev sibling next sibling parent reply James Blachly <james.blachly gmail.com> writes:
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
Apr 07 2021
parent James Blachly <james.blachly gmail.com> writes:
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
Apr 07 2021
prev sibling parent =?UTF-8?B?0JLQuNGC0LDQu9C40Lkg0KTQsNC0?= =?UTF-8?B?0LXQtdCy?= writes:
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.

 [(1)]: https://github.com/Pure-D/serve-d/pull/127
Idea: 1. Scan existent projects: - scan dlang sources, phobos - scan popular packages from dlang site 2. Take line with "import ..." from each .d file 3. 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.
Apr 16 2021