vscode-hex-pm-intellisense
vscode-hex-pm-intellisense copied to clipboard
in some cases the version sorting is not working properly
Currently, the sorting is done textually it seems:

We can improve this by parsing the version according to https://hexdocs.pm/elixir/1.14/Version.html and sort on the individual integers.
Can you point me to the package you are trying to complete here? I'm a bit surprise because this should handle the sorting:
https://github.com/benvp/vscode-hex-pm-intellisense/blob/master/src/provide.ts#L93
Oh, that's weird, it was ex_check
It looks like the only way for this to fail is if the semver package has a bug? But that seems highly unlikely 😅 semver.compare("0.9.0", "0.15.0") should give -1
Are you using the latest version of the extension? Tried it with that library and I get the following result
Any other steps to reproduce it?
Yes, I just installed the extension. But I think I found the way to reproduce it:
when you autocomplete inside an empty string, like in your screenshot, it sorts properly, but when you autocomplete inside "~> 0.15.0" it does not sort it properly, when I add a space after "~> 0.15.0" and then autocomplete, it sorts it correctly again.