TestOrdering has always contained a typo, now flagged by staticcheck in gopls, that causes its assertion to trivially pass. Fixing it reveals that the test was broken by yours truly in b9b97d9 (go.dev/cl/534139) when we removed Id-based sorting (because expensive). That means we are now using Pos-based sorting.
This seems like a bad outcome for gopls, among others:
- Reordering method decls may change the object paths for them and their elements (params etc).
- analysis fact caching may be broken.
- the objectpaths obtained when parsing source or loading from export data may differ.
The task of this issue is to figure out how bad this is and either reintroduce sorting (perhaps optimized somehow) or some other fix.
TestOrdering has always contained a typo, now flagged by staticcheck in gopls, that causes its assertion to trivially pass. Fixing it reveals that the test was broken by yours truly in b9b97d9 (go.dev/cl/534139) when we removed Id-based sorting (because expensive). That means we are now using Pos-based sorting.
This seems like a bad outcome for gopls, among others:
The task of this issue is to figure out how bad this is and either reintroduce sorting (perhaps optimized somehow) or some other fix.