1. Takeshi NISHIDA
  2. vim-autocomplpop
Issue #51 new

"[a-z]+\.[a-z]+" Auto completes to `=acp#onPopupPost()` while eclim is running.

created an issue

To reproduce you will need eclim installed. After running eclim, anywhere in a vim file if one tries to write <word>.<word> it automatically completes to =acp#onPopupPost().


import org.jun=acp#onPopupPost()
public class StackTest {                        

Comments (4)

  1. James Maddison

    I get this issue too.

    I can make it happen by opening a Java file in my project and typing a token that doesn't exist in a logical place followed by a dot then two letters. For Example:


    This would result in:


    Note the empty line is not a mistake, it is inserted by the issue.

    Here's my acp_behaviour for Java:

    let g:acp_behaviourJavaEclimLength = 2
    function! MeetsForJavaEclim(context)
        return g:acp_behaviourJavaEclimLength >= 0 && 
                    \ a:context =~ '\k\.\k\{' . g:acp_behaviourJavaEclimLength . ',}$'
    let g:acp_behavior = {
        \ 'java': [{
            \ 'command'      : "\<c-x>\<c-u>",
            \ 'completefunc' : 'eclim#java#complete#CodeComplete',
            \ 'meets'        : 'MeetsForJavaEclim',
        \ }]
    \ }

    I believe the offending code is the below line (370) in autoload/acp.vim.

    Perhaps the <C-r> isn't working and so it gets typed into the buffer instead.

    call feedkeys(s:behavsCurrent[s:iBehavs].command . "\<C-r>=acp#onPopupPost()\<CR>", 'n')
  2. Clinton Ryan

    I found this problem to be the cause of the call to eclim#java#complete#CodeComplete returning an exception. This can be caused by many things, but the most common case would be the current file not being in a eclim project. In order to fix this, I checked for the existence of the project in my function and don't have this issue anymore. I also changed the function to autocomplete on 3 character words, so it felt more like intelliJ and the sorts.

    Hope this fixes the issue for you :)

    let g:acp_behaviorJavaEclimLength = 3
    function MeetsForJavaEclim(context)
      return g:acp_behaviorJavaEclimLength >= 0 && exists(":Java") &&
            \ a:context =~ '\k\{' . g:acp_behaviorJavaEclimLength . ',}$'
    let g:acp_behavior = {
        \ 'java': [{
          \ 'command': "\<c-x>\<c-u>",
          \ 'completefunc' : 'eclim#java#complete#CodeComplete',
          \ 'meets'        : 'MeetsForJavaEclim',
        \ }]
      \ }
  3. Log in to comment