Sorry folks. I think this is a problem I have created along the way. I tested an older version of the extension and the problem doesn’t exist. I’ll have to spend some time this weekend trying to figure out what I did
Just an update to anyone who may read this thread…The problem seems to be that the item.range was being set.
TL;DR; For anyone really interested. If I understand correctly, in previous versions of Nova, typing a hyphen would cause Nova to consider anything before the hyphen as a separate word, which caused incorrect autocompletions once the user had typed past a hyphen character. For example, typing “overflow-au” and then autocompleting at any point after would insert the text "overflow-overflow-auto” because overflow would be considered a separate word. So the item.range had to be set to provide the correct text replacement.
So I had a similar issue and was very excited to try out your theory. In my case, it didn’t end up being a solution. I still needed to set an item.range for kebab-cased completions, or all but the last fragment wouldn’t be replaced. Also, I’m not conditionally setting this range only when more than the current “word” needs to be replaced, and completions still work fine when the range is set.
My current working theory for my case is that I was trying to helpfully format completions with JSON punctuation (e.g., ", :), and Nova was suppressing it when item.insertText began with one of those characters. I’d really love some clarification from Panic on why provided completions might not be displayed.