idanarye / vim-dutyl

Coordinate D tools to work together for you
http://www.vim.org/scripts/script.php?script_id=5003
79 stars 13 forks source link

Return nothing with no completions are found (rather use echoerr) #41

Closed cjrh closed 6 years ago

cjrh commented 6 years ago

I'm very experienced, but new to D.

I am using https://github.com/maralla/completor.vim as my completion engine. With current behaviour, if there are no completions reported from dcd-server, the letters b a d . get shown in my completions list. (So this issue is only for when my completion engine shows things like snips, etc., but there are no D completions at the current cursor location. When dcd-server does return valid completions, there is no problem.)

This PR fixes that by rather using echoerr to write bad... instead of returning it.

Here is a screenshot of the problem:

bad

Here is a screenshot with my PR applied:

good

cjrh commented 6 years ago

I should add: this is happening because the dcd server does not always include identifiers in the result. If there are no completions, nothing is returned. I think the code assumes that "identifiers" will always be present.