x/tools/gopls: order struct fields completions by definition #42626
Labels
Milestone
Comments
Change https://golang.org/cl/270777 mentions this issue: |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
When I am writing a struct literal, I expect the completion suggestions to be ordered the same way as when it is defined. For example, if a struct has 4 fields, in order,
key, content, start, end
, I expect the the completion suggestions to be be ordered just like that, instead of alphabetically, likecontent, end, key, start
.Developers usually order fields purposefully, both in definition and struct literal. For example is it unnatural to write
end
beforestart
, and it is conventional to putkey
as the first field. Therefore changing the suggestion order will make completion more ergonomic.Example:
The text was updated successfully, but these errors were encountered: