Open jondkinney opened 6 years ago
Does :UpdateRemotePlugins
solve anything?
I'll try to make these issues independent from each other, so please post anything related to this problem here.
@jondkinney Have you installed solargraph_utils
by running pip install solargraph-utils.py --user
?
Thanks for the hints @iovis9 and @halftan. I did already run the solargraph-utils install through pip. Should something from that install be accessible on my path for me to test that things are working? I do have the solargraph gem properly installed and can get help from it at the command line.
:UpdateRemotePlugins
doesn't fix it, per se. Though it did appear to update successfully. By the way, I was initially trying with Vim 8.1 with python3 and +timers (which works with deoplete itself, but maybe not this plugin?). I've since installed nvim and am having the same / similar issue there:
Thanks for the help!
If you have both python2 and python3 installed, make sure to install solargraph-utils.py using pip3 otherwise the neovim python client won't find it.
The python package install location is dependent to your environment. If you've installed your python3 from pyenv or something similar, give ~/.pyenv/versions
a peek.
@halftan a ha! I had to do pip3 install solargraph-utils.py --user
. Thanks for that. The error is gone in both Vim 8.1 and neovim now. 👍
So now if I have a Rails app with a users_controller.rb and I have:
@user = User.find(params[:id])
@user.
When typing @user.
above, it opens deoplete suggestions for methods on user in the current file (though they don't say [solar] next to them, they say [F]), should solargraph be able to introspect the user model and give me instance methods in the deoplete dropdown?
I realize this might be a bit of a different question/issue, but I'm still trying to figure out if it's installed properly and what to expect when it's working, so seemed like an ok thing to ask here in this issue for others following along.
Thanks again!
@jondkinney If you see [F]
or [M]
next to the candidates, that's neovim doing the completion. (The omnifunc,) You need to tell deoplete.nvim to use solar
as a source in ruby files. Please refer to deoplete on how to configure sources for specific filetypes.
Or, maybe you have deoplete configured to use omni
source in ruby files. Either way, your deoplete configuration needs to be looked into.
@halftan do you have a working ruby setup I can reference? Here's what I have so far related to deoplete and js and ruby. It's hard to find docs to patch this all together across different languages.
" Use deoplete (autocomplete) on startup
let g:deoplete#enable_at_startup = 1
let g:deoplete#enable_smart_case = 1
" deoplete.nvim
" inoremap <silent> <expr> <Tab> pumvisible() ? '\<C-n>' : deoplete#mappings#manual_complete()
" deoplete-ternjs
let g:deoplete#sources = {}
let g:deoplete#sources.javascript = ['ternjs']
let g:deoplete#sources.gitcommit = ['github']
" let g:deoplete#sources.ruby = ['solar'] " do I want this?
let g:deoplete#omni#functions = {}
let g:deoplete#omni_patterns = {}
" tern_for_vim
let g:tern#command = ['tern']
let g:tern#arguments = ['--persistent']
let g:deoplete#omni#functions.javascript = ['tern#Complete']
let g:deoplete#omni_patterns.javascript = '\h\w*\|\h\w*\.\%(\h\w*\)\|[^. \t]\.\%(\h\w*\)'
" ruby
let g:deoplete#omni#functions.ruby = ['solar']
let g:deoplete#omni_patterns.ruby = '[^. *\t]\.\w*\|\h\w*::'
"Add extra filetypes
let g:deoplete#sources#ternjs#filetypes = [
\ 'jsx',
\ 'javascript.jsx',
\ 'vue',
\ ]
@jondkinney you don't want these two lines
let g:deoplete#omni#functions.ruby = ['solar']
let g:deoplete#omni_patterns.ruby = '[^. *\t]\.\w*\|\h\w*::'
they're for omnifunctions.
And the source's name is solargraph
, not solar
. See here
If you're still in doubt, please be free to check out my vimrc with caveat:
let g:deoplete#sources.ruby = ['tag', 'omni', 'buffer', 'file', 'ultisnips']
let g:deoplete#sources.eruby = ['tag', 'omni', 'buffer', 'file', 'ultisnips']
change to:
let g:deoplete#sources.ruby = ['tag', 'solargraph', 'buffer', 'file', 'ultisnips']
let g:deoplete#sources.eruby = ['tag', 'solargraph', 'buffer', 'file', 'ultisnips']
Thanks for this! I'm a little confused how to get the default implementation working. Any help would be greatly appreciated!
https://github.com/uplus/deoplete-solargraph/issues/5 mentioned to use version 0.18.0 and until I did that opening vim didn't do anything. Now when I open Vim I get the following error.
I have the solargraph-utils.py installed per the README. I'm not exactly sure what to do next to keep troubleshooting.
/Users/jon/.vim/plugged/deoplete-solargraph/rplugin/python3/deoplete/source/solargraph.py
is present.Here's my Vim info: