ols icon indicating copy to clipboard operation
ols copied to clipboard

Display struct fields before fake methods

Open thetarnav opened this issue 1 year ago • 2 comments

Is is possible to display struct fields before fake methods, or does ols have no influence over that?

image

thetarnav avatar Aug 13 '24 20:08 thetarnav

Normally it's the editor.

It might be possible. There is a field in completion lsp:

         /**
	 * A string that should be used when comparing this item
	 * with other items. When omitted the label is used
	 * as the sort text for this item.
	 */
	sortText?: string;

DanielGavin avatar Aug 13 '24 21:08 DanielGavin

I don't generally like the editors don't follow my return order. It adds confusion with different editors.

It might be possible to always just fill in the sortText so that it enforces return order.

It is then possible to give a small higher score for local variables, since I have noticed that local variables sometimes don't show up in the top of identifier completion.

DanielGavin avatar Aug 13 '24 21:08 DanielGavin

This actually seems to work like that now that https://github.com/DanielGavin/ols/pull/975 has been merged. At the end of the day it is still editor dependent, but the "default" sort should now place fields above the methods. Let me know if you still find it not working as expected.

BradLewis avatar Sep 07 '25 20:09 BradLewis