Earlier today when working on my plugin I noticed that when you press enter on items that were added via ScriptEditorService:RegisterAutocompleteCallback they for some reason get inserted at the top of the file and not where your cursor is. This only happens when you press Enter, pressing Tab works as expected.
Pressing Enter (NOT WANTED!!!)
Pressing Tab (expected behavior)
This behavior can be observed by simply running the following code in the command line and pressing Enter on the autocomplete item.
game:GetService('ScriptEditorService'):RegisterAutocompleteCallback('Test', 1, function(document, request) table.insert(request.items, {label = 'foo'}) return request end)
This behavior has also been reported by users of my plugin, so I would really like to know if this could please be fixed or if I’m just doing something wrong!
Expected behavior
Pressing Enter should insert the text where the cursor is. Not at the top of the file.