Skip to content

Replace second index parameter of custom-completion closures with a String prefix parameter #769

@rgoldberg

Description

@rgoldberg

@natecook1000 @rauhul I think this is an urgent fix that should be merged before any new version is released.

I will make a PR now.

Replace the cursor index within completing word parameter of custom-completion closures with a String completionPrefix parameter.

Most of the time, a completion function will just want the prefix of the word being completed before the cursor.

Code shouldn't have to be complex to get it, but I didn't realize how cumbersome Int indices are for Swift Strings (I'm fairly new to Swift).

Code can easily get the index from the prefix. This should be a much nicer experience for users.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions