Skip to content

util: Add types & docs for str utils, cleanup old functions#1419

Open
bew wants to merge 10 commits intoL3MON4D3:masterfrom
bew:types-for-util-str
Open

util: Add types & docs for str utils, cleanup old functions#1419
bew wants to merge 10 commits intoL3MON4D3:masterfrom
bew:types-for-util-str

Conversation

@bew
Copy link
Copy Markdown
Contributor

@bew bew commented Jan 10, 2026

Extracted from #1396
Depends on #1420

@bew bew force-pushed the types-for-util-str branch from dff7c22 to c51c1d8 Compare January 10, 2026 17:43
@bew bew marked this pull request as ready for review January 10, 2026 18:56
function M.multiline_to_byte_offset(str, pos)
if pos[1] < 0 or pos[1] + 1 > #str or pos[2] < 0 then
---@param lines string[] a multiline string
---@param pos LuaSnip.ApiPosition an api-position relative to the start of str.
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This LuaSnip.ApiPosition type is not defined 🤔 What do you want here?

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be RawPos00, I think I'm referring to api-indexing

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done in bb1c84d

still warning until #1420 is merged

@L3MON4D3
Copy link
Copy Markdown
Owner

This is looking really good as well, great work ❤️

@bew bew changed the title util: Add types & docs for str utils util: Add types & docs for str utils, cleanup old functions Jan 18, 2026
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

Successfully merging this pull request may close these issues.

2 participants