Case-sensitivity in show-hint

Successfully using the show-hint add-on in version 5.41.0 of CodeMirror with one exception. It appears the hint list filtering is case insensitive by default. However, if the filtering text doesn’t exactly match (including case) the list item chosen, then both the filtering text AND the list item are added to the editor.

For example, if the hint list contains an item “Pack.Age” and the user types “pa” when the hint list is displayed, the “Pack.Age” item is highlighted in the list. However, if that list item is selected, what appears in the editor is “paPack.Age”. If instead the user types “Pa”, and the “Pack.Age” item is selected, the editor correctly displays “Pack.Age”. This doesn’t seem like the expected behavior.

As an aside, is there a way to enable case-sensitive show-hint filtering, which I hope would make this problem go away?

It’s not. Completion filtering is done by completing functions, and you didn’t tell which one you are using.

Sorry to be dense, but can you be a little more specific? My reading of the documentation for the show-hint.js is a little confusing https://codemirror.net/doc/manual.html#addon_show-hint. In my CM instance options object, there is a hint property which calls my function but I don’t think that’s the ‘completing function’ about which you wrote. How do I know which ‘completing function’ I’m using?

The function that finds the completion. Either something from addon/hint/*-hint.js, or a custom one that you wrote.

For future reference, the filtering function is the second, optional argument to the CodeMirror.showHint function.