Shougo / neocomplcache.vim

Ultimate auto-completion system for Vim.
http://www.vim.org/scripts/script.php?script_id=2620
1.72k stars 135 forks source link

Autocomplete list lacking in Ruby #417

Closed pikajude closed 10 years ago

pikajude commented 11 years ago

My .vimrc: https://gist.github.com/joelteon/e926f5a6d8d9692a4438

If I type in, say, [1,2,3].f, the autocomplete list doesn't come up (it should contain find, find_index, etc.). If however I type <c-x><c-o>, the autocomplete list is filled with Array methods and adjusts properly as I type. . Why is <c-x><c-o> necessary? I thought that's what neocomplcache is meant to do automatically.

Edit: if I change

let g:neocomplcache_force_omni_patterns.ruby = '[^. *\t]\.\w*\|\h\w*::'

to

let g:neocomplcache_omni_patterns.ruby = '[^. *\t]\.\w*\|\h\w*::'

then when I type [1,2,3]., the autocomplete list has Array methods in it, but when I start to type they disappear to be replaced with tokens in the current file. Using <c-x><c-o> also fixes it here.

Also, pressing <c-x><c-o> to fill the autocomplete list only works until I stop autocompletion. I have to do it again if I retype the line, for example.

ujihisa commented 11 years ago

try

let g:neocomplcache_skip_auto_completion_time = ""
pikajude commented 11 years ago

No good - looks like that was the default anyway.

(By "no good" I mean I get the same behavior.)

Shougo commented 11 years ago

If I type in, say, [1,2,3].f, the autocomplete list doesn't come up (it should contain find, find_index, etc.). If however I type , the autocomplete list is filled with Array methods and adjusts properly as I type. . Why is necessary? I thought that's what neocomplcache is meant to do automatically.

screenshot

In my environment, it works.

then when I type [1,2,3]., the autocomplete list has Array methods in it, but when I start to type they disappear to be replaced with tokens in the current file. Using also fixes it here.

It is rubycomplete's problem. I think rubycomplete looks very strange. But I fixed for it in latest version of neocomplcache.

Praful commented 10 years ago

What is it that determines whether you get Ruby methods or other autocomplete options in neocomplete (not neocomplcache)?

When I type ".fi", I get the following:

image

There are no method options. If I press <c-x><c-o>, I get the following:

image

I'd like all options to appear in the first list with the method options appearing first. How do I do this?

The help file suggestion of using

if !exists('g:neocomplete#force_omni_input_patterns')
  let g:neocomplete#force_omni_input_patterns = {}
endif
let g:neocomplete#force_omni_input_patterns.ruby = '[^. *\t]\.\w*\|\h\w*::'

results in only the methods appearing as options after the dot (as in the second picture but no [O] at the end of the method as you have). This is slightly better but the complete list would be nice!

I'm using gvim 7.4.3 on Win 7.

Thanks

Shougo commented 10 years ago

It is feature. Sorry. Current ruby omni function conflicts with neocomplete/neocomplcache.

Praful commented 10 years ago

OK - thanks for replying.

jrhorn424 commented 10 years ago

@Praful did you ever find a workaround or solution you liked? I'm currently experiencing the same issue.

Praful commented 10 years ago

Alas no. In fact, now I get only the Ruby methods and none of the other autocomplete options! I may have done something to bring this about but I'm just living with it because most of the time I'm happy being presented with Ruby methods. When I want something else, I use the explicit <c-x> followed by the appropriate chord eg <c-x><c-f> to autocomplete files.