Bug 58285 (vs-504206) - XAML Intellisense lists element properties sorted by length of name
Summary: XAML Intellisense lists element properties sorted by length of name
Alias: vs-504206
Product: Xamarin Studio
Classification: Desktop
Component: XML Editor (show other bugs)
Version: 7.0 (VSforMac)
Hardware: Macintosh Mac OS
: Normal enhancement
Target Milestone: Future Cycle (TBD)
Assignee: Bugzilla
Depends on:
Reported: 2017-07-20 23:24 UTC by David Ortinau [MSFT]
Modified: 2017-10-10 08:05 UTC (History)
5 users (show)

Tags: vs-sync
Is this bug a regression?: ---
Last known good build:

screenshot (192.79 KB, image/png)
2017-07-20 23:24 UTC, David Ortinau [MSFT]
C# example (136.00 KB, image/png)
2017-08-24 09:43 UTC, David Karlaš

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.

Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:

Description David Ortinau [MSFT] 2017-07-20 23:24:44 UTC
Created attachment 23702 [details]

When I get the popover of properties available for the element Grid in this screenshot, noticed the ordering is by length of the property name...this continues down the list.

I'm not sure what the next sorting rule is, I can't make sense of it.

I would expect the sorting to be alphabetical if not also more context aware (most common at the top).
Comment 1 David Karlaš 2017-08-24 09:43:33 UTC
Created attachment 24392 [details]
C# example

Unfortunately this is expected behaviour, but you found edge case that looks very weird... IDE Code Completion once something is typed(in your case g) it kicks from alphabet sorting to "fuzzy search" closest match... In your case a lot of matches are properties of Grid and non-alphabetical sort is very visible... Look at attached example in C#, where it's also not sorted alphabetically.
Comment 2 Mike Krüger 2017-08-24 10:05:20 UTC
Sooner or later we'll be getting the vs.net controllers for that layer then the behavior will be different.

The decision to implement it like that was because I sort it according to the match index so items upper in the list are more likely the right ones. Doesn't work in all cases but alphabetical sorting is probably wrong everytime :).

I took R# as exapmle for the sorting/filtering routines. I'm not sure if I matched it 100% but we're close.

In any case we'll be getting the vs.net controllers and the behavior will be defined by them in future releases. I do not plan to work or alter the current behavior.
Comment 3 Mikayla Hutchinson [MSFT] 2017-08-24 16:39:36 UTC
@Mike the Roslyn controller changes will only apply to Roslyn languages, of which XML is not currently one. Also, that's some ways off, and this is a pretty painful UX issue

That said... @David, I think that we should also change XAML completion to only list the part before the '.' and then implement completion for the '.' as well. This would match what VS does and would likely mitigate the impact of the sort issue.
Comment 4 David Karlaš 2017-10-10 08:05:07 UTC
This is now fixed. We don't show <Grid.Scale, <Grid.Style... anymore, instead
we do it same as VS2017, we show just <Grid, only after user types <Grid. we
should properties.