Code completion for groovy using YouCompleteMe

288 views
Skip to first unread message

John Reiter

unread,
Jan 25, 2016, 2:35:21 PM1/25/16
to eclim...@googlegroups.com
I was just experimenting with using eclim for groovy development, and I found that I'm unable to get code completion to work for groovy files - but only when using YCM.  The weird thing is that completion using YCM works fine for java, but the completion list doesn't get populated from eclipse for groovy.  The java and groovy files I'm testing with are in the same Eclipse project, FWIW.

Completion for groovy files does work fine in the same project when I uninstall YouCompleteMe and switch to either SuperTab or no vim plugin.

Any idea what the problem might be?

Environment:

Vim:
Vi IMproved 7.4 (2013 Aug 10, compiled Aug 17 2015 10:52:41)
MacOS X (unix) version
Included patches: 1-769


Eclipse versions tested:

Eclipse (STS bundle) - 
Version: 3.7.2.RELEASE
Build Id: 201511261048
Platform: Eclipse Mars.1 (4.5.1)

Eclipse (no STS) -
Version: 4.5.1

John Reiter

unread,
Jan 25, 2016, 2:54:52 PM1/25/16
to eclim...@googlegroups.com
Actually, I figured this out.  It turned out to be a YouCompleteMe issue, not an eclim issue.  YCM just doesn't have a trigger set for groovy out of the box.  I just needed to add the below to my vimrc (addition highlighted).  Maybe something to add to the docs?

let g:ycm_semantic_triggers =  {

  \   'c' : ['->', '.'],

  \   'objc' : ['->', '.', 're!\[[_a-zA-Z]+\w*\s', 're!^\s*[^\W\d]\w*\s',

  \             're!\[.*\]\s'],

  \   'ocaml' : ['.', '#'],

  \   'cpp,objcpp' : ['->', '.', '::'],

  \   'perl' : ['->'],

  \   'php' : ['->', '::'],

  \   'cs,java,javascript,typescript,d,python,perl6,scala,vb,elixir,go,groovy' : ['.'],

  \   'ruby' : ['.', '::'],

  \   'lua' : ['.', ':'],

  \   'erlang' : [':'],

  \ }


Reply all
Reply to author
Forward
0 new messages