add test for toplevel completion when cursor is on the identifier (closes #3298)