sorter: take advantage of ordinal structure #3

Open
opened 2026-02-09 16:15:07 +01:00 by thibault · 0 comments
Owner

I currently make the ordinal like so in the telescope-lsp-symbols.pickers.document-symbol submodule:

-- For the "M.cmd" symbol in a lua file:
m_cd_ordinal = "[NUMID]##M##cmd[#0]"

I should add a sorter (which also handles filtering as far as I can tell?) which takes advantage of the structure. So if we look for "cmd" it actually finds it. I've already got somewhere a string split function which can return the parts between separators without removing empty elements. It works like so:

splitstring("001##M##cmd", "##") == { "001", "M", "cmd" }
splitstring("##M##cmd", "##") == { "", "M", "cmd" }

I could use this to only filter and sort based on fuzzy matches in each name "part".

I currently make the ordinal like so in the `telescope-lsp-symbols.pickers.document-symbol` submodule: ```lua -- For the "M.cmd" symbol in a lua file: m_cd_ordinal = "[NUMID]##M##cmd[#0]" ``` I should add a sorter (which also handles filtering as far as I can tell?) which takes advantage of the structure. So if we look for "cmd" it actually finds it. I've already got *somewhere* a string split function which can return the parts between separators without removing empty elements. It works like so: ```lua splitstring("001##M##cmd", "##") == { "001", "M", "cmd" } splitstring("##M##cmd", "##") == { "", "M", "cmd" } ``` I could use this to only filter and sort based on fuzzy matches in each name "part".
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
thibault/telescope-lsp-symbols.nvim#3
No description provided.