Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

construct results ordering #1600

Closed
3Rafal opened this issue May 10, 2023 · 3 comments
Closed

construct results ordering #1600

3Rafal opened this issue May 10, 2023 · 3 comments

Comments

@3Rafal
Copy link
Collaborator

3Rafal commented May 10, 2023

For a given code:

type my_type = A | B | C | D

let x = (_ : my_type)

running construct on a hole:

ocamlmerlin single construct -position 3:9

returns results in reversed order:

[...]
"value":[{"start":{"line":3,"col":9},"end":{"line":3,"col":10}},["D","C","B","A"]]
[...]

I think it would be a better UX, to have type constructors ordered the same as in declaration.

@voodoos
Copy link
Collaborator

voodoos commented May 10, 2023

Your right, it looks like it's in reverse order, so the fix should be fairly easy(famous last words)

Do you want to have a go at it ? We should also add a test for it that is not in alphabetical order.

@3Rafal
Copy link
Collaborator Author

3Rafal commented May 15, 2023

@voodoos , sure! I have modified order in already existing tests and added a new explicit one. :)

@bcc32
Copy link
Contributor

bcc32 commented May 30, 2023

Should this issue be closed, now that #1603 has been merged?

@3Rafal 3Rafal closed this as completed May 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants