roxma / nvim-completion-manager

:warning: PLEASE USE https://github.com/ncm2/ncm2 INSTEAD
MIT License
917 stars 49 forks source link

Any plan to integrate with eclim? #85

Closed luofish closed 7 years ago

luofish commented 7 years ago

I know there was a way to achieve this.

au User CmSetup call cm#register_source({'name' : 'cm-java',
        \ 'priority': 9, 
        \ 'scoping': 1,
        \ 'scopes': ['java'],
        \ 'abbreviation': 'java',
        \ 'cm_refresh_patterns': [''],
        \ 'cm_refresh': {'omnifunc': 'eclim#java#complete#CodeComplete'},
        \ })

however, it has a bad performance. Could you help to create a plugin?

roxma commented 7 years ago

I have no plan on that.

You could refer to https://github.com/roxma/nvim-cm-racer as an example, to create your own source.

Feel free to ask, in case you get confused by the code.

roxma commented 7 years ago

I just encountered a java project recently, wanna try eclim. But the installation process is really wierd compared to other vim plugins. I'm still sticking with eclipse.

sassanh commented 7 years ago

@roxma the installation process is weird but it's straight forward if you follow http://eclim.org/install.html. I just downloaded latest eclipse for java (oxygen) and ran the installer with java -jar you have to set the eclipse directory to /Applications/Eclipse.app/Content/Eclipse/. eclip is now set up for me (:PingEclim works in nvim) I'm gonna try to write a source for it and will ask for your help if something weird happened.

sassanh commented 7 years ago

Update: currently it's auto completing Java source code on my machine, I had to create a proxy function that calls eclim#java#complete#CodeComplete always with empty string as second argument. But to run it async I'm trying to bypass eclim vim plugin and do it in an async way (eclim is not async). It may take a while as I work on it in my free times. But meanwhile you can use that proxy function and define your source like this:

    autocmd User CmSetup call cm#register_source({'name' : 'cm-java',
                \ 'priority': 9, 
                \ 'scoping': 1,
                \ 'scopes': ['java'],
                \ 'abbreviation': 'java',
                \ 'word_pattern': '\w+',
                \ 'cm_refresh_patterns':[''],
                \ 'cm_refresh': {'omnifunc': 'eclim#java#complete#CodeComplete'},
                \ })
sassanh commented 7 years ago

It's ready: https://github.com/sassanh/nvim-cm-eclim Unfortunately it saves file whenever it wants to provide completions list (just like eclim does itself.)