atom / autocomplete-snippets

Adds snippets to autocomplete+ suggestions
MIT License
46 stars 50 forks source link

Use a string compatible prefix comparator #66

Closed jeancroy closed 8 years ago

jeancroy commented 8 years ago

fix https://github.com/atom/autocomplete-snippets/issues/61. May also help related issues

jeancroy commented 8 years ago

/cc @50Wliu because I think this would help the ruby do/dop snippet situation.

I'm not sure if spec are needed or how I'd write one.

lee-dohm commented 8 years ago

@jeancroy Specs are strongly preferred. Basically I would just write a bunch of tests describing sorting cases and the expected output. Extra credit for covering failure cases like people handing undefined, null or non-string input.

jeancroy commented 8 years ago

@lee-dohm would it be OK to test the sortComparator in isolation ? I can give an array of unsorted data, and try to sort using this.

it's just the inner working of autocomplete-snippet i'm not sure. It looks like a glue package between the snippet package and autocomplete-plus.

lee-dohm commented 8 years ago

Yes, that's what I was thinking.

jeancroy commented 8 years ago

Thanks @lee-dohm, for pushing for test, I blindly assumed at least the a.prefix part was right. It looks like result don't have a prefix property but a text one.

lee-dohm commented 8 years ago

You're welcome :+1: