Fix invalid searching end of function statement

go-eldoc uses list function if possible. This make searching correctly
rather than original code.