Closed
Description
I have a string property named "name". When I choose it to sort I get an error. "Sorting cannot produce a determinable result. Please pick another property"
VSC Version: 1.90.1 (user setup)
Commit: 611f9bfce64f25108829dd295f54a6894e87339d
Date: 2024-06-11T21:01:24.262Z
Electron: 29.4.0
ElectronBuildId: 9593362
Chromium: 122.0.6261.156
Node.js: 20.9.0
V8: 12.2.281.27-electron.0
OS: Windows_NT x64 10.0.19045
Any ideas.?
Metadata
Metadata
Assignees
Labels
No labels
Activity
fvclaus commentedon Jun 17, 2024
This message occurs when the property has one or more non unique values. It should ask you to pick another property, like so:
AceTheWiz commentedon Jun 21, 2024
Thanks for the reply.
I did see the dropdown to choose another property, but I specifically want to sort on the
name
property.And yes, the
name
property does have duplicates but I was hoping it would sort regardless.Is there a possibility to override or configure the requirement for unique values ?
fvclaus commentedon Jun 21, 2024
Is there any reason you don't want to pick another property to sort the objects with the same value of your first sort property?
fvclaus commentedon Jun 21, 2024
Of course such a feature could be added (it is currently not supported) and I remember thinking about it. I just never saw a reason to do so.
fvclaus commentedon Jun 21, 2024
For example, this array:
has 3 occurrences of
Bob
. You could either sort byemail
as the second sort property or byage
andemail
(because36
appears twice). TheBob
s would be sorted among each other byemail
and among the rest of the objects byname
.AceTheWiz commentedon Jun 21, 2024
The first prompt I get is this

where I chose
name
.The second prompt I get is this

I thought that if I chose another property (e.g
description
), then it would only sort ondescription
and not sort on thename
property anymore.Now, from your explanation and example, I understand that that the "pick another property to sort the objects" actually adds additional fields to the sort. So, the sort then uses multiple fields to sort.
I tried again and kept adding properties to the sort (2nd image above) until it actually sorted successfully as I wanted. 👍
As an improvement, I suggest the text should say "pick an additional property to produce a successful sort"
Thanks again for your time and for creating this useful extension.
fvclaus commentedon Feb 3, 2025
I tried to improve the message by using a title and including the selected object properties. I hope this is clearer now:
This is now released as 4.1.0. Feedback is appreciated.