Sublime Forum

Count the no of times a user used the suggestions given by the autocomplete

#1

Is there any way to record the selection done by the user to create stats? for example, the autocomplete feature gave the list [‘hi’, ‘hello’] for ‘h’, I need to maintain a count for the no of times a user selected hi and no of times a user selected ‘hello’. Is there any API specifically for this?

0 Likes

#2

there is currently no API for this, but you may be able to calculate this yourself by detecting the contents of the buffer around the caret/selection before and after the commit_completion was fired - I experimented with something similar here:


But that won’t help if the user clicks on the completion to choose it instead of using a keyboard shortcut:

0 Likes

Get user stats for the no of times a user selected the word