deoplete-plugins/deoplete-go

deoplete-go doesn't show any options

Dbz opened this issue · 6 comments

Dbz commented

Hello thank you for making deoplete-go! I love deoplete. Unfortunately, it doesn't seem to be adding functionality to deoplete (but maybe I have something wrong with my deoplete settings. I will paste all of my related vimrc config:

" deoplete-go settings
let g:deoplete#sources#go#package_dot = 1
let g:deoplete#sources#go#gocode_binary = $GOPATH.'/bin/gocode'
let g:deoplete#sources#go#sort_class = ['package', 'func', 'type', 'var', 'const']

" deoplete auto-complete plugin
let g:deoplete#enable_at_startup = 1
" Add ctags
let g:deoplete#sources = {}
let g:deoplete#sources._ = ['buffer', 'tag']
let deoplete#tag#cache_limit_size = 5000000

" <TAB>: completion.
inoremap <expr><TAB>  pumvisible() ? "\<c-n>" : "\<TAB>"
" fix colors
highlight Pmenu ctermbg=8 guibg=#606060
highlight PmenuSel ctermbg=1 guifg=#dddd00 guibg=#1f82cd
highlight PmenuSbar ctermbg=0 guibg=#d6d6d6

" Allow trailing punctuation in methods
call deoplete#custom#option('keyword_patterns', {
      \ '_': '[a-zA-Z_]\k*',
      \ 'ruby': '[a-zA-Z_]\w*[!?]?',
      \})

" Omni Completion
call deoplete#custom#var('omni', 'input_patterns', {
      \ 'ruby': ['[^. *\t]\.\w*', '[a-zA-Z_]\w*::'],
      \})

call deoplete#custom#source('omni', 'functions', {
      \ 'ruby':  'rubycomplete#Complete',
      \})

" Enable language server
call deoplete#custom#source('LanguageClient',
      \ 'min_pattern_length',
      \ 2)

" Disable Deoplete when selecting multiple cursors starts
function! Multiple_cursors_before()
  if exists('*deoplete#disable')
    exe 'call deoplete#disable()'
  elseif exists(':NeoCompleteLock') == 2
    exe 'NeoCompleteLock'
  endif
endfunction

" Enable Deoplete when selecting multiple cursors ends
function! Multiple_cursors_after()
  if exists('*deoplete#enable')
    exe 'call deoplete#enable()'
  elseif exists(':NeoCompleteUnlock') == 2
    exe 'NeoCompleteUnlock'
  endif
endfunction

" Langauge Servers
"
      " \ 'ruby': ['tcp://localhost:7658']
      "   \ 'go': ['go-langserver'],
let g:LanguageClient_serverCommands = {
  \ 'ruby': ['solargraph','stdio'],
  \ }
 
" Don't send a stop signal to the server when exiting vim.
" This is optional, but I don't like having to restart Solargraph
" every time I restart vim.
let g:LanguageClient_autoStop = 0

let g:LanguageClient_autoStart = 1
let g:LanguageClient_loggingFile = "/Users/danielburt/language_client_log.txt"
let g:LanguageClient_loggingLevel = "INFO"

nnoremap <silent> K :call LanguageClient_textDocument_hover()<cr>
" nnoremap <silent> gd :call LanguageClient_textDocument_definition()<cr>
nnoremap <silent> <F2> :call LanguageClient_textDocument_rename()<cr>

gocode is already installed?

You should check if gocode works.

Dbz commented

Yeah, my plugins are in a separate file. Here are the related ones.

" ~~~ Language Server ~~~
" Plug 'dbakker/vim-projectroot'
Plug 'autozimu/LanguageClient-neovim', {
      \ 'branch': 'next',
      \ 'do': 'bash install.sh',
      \ }

" ~~~ Language support
Plug 'fatih/vim-go', { 'do': ':GoUpdateBinaries' }

" Following makes go work with deoplete
Plug 'zchee/deoplete-go', { 'do': 'make'} 
Plug 'mdempsky/gocode', { 'rtp': 'vim', 'do': '~/.vim/plugged/gocode/vim/symlink.sh' }

"  ~~~ auto completion ~~~
Plug 'Shougo/deoplete.nvim'
Plug 'roxma/nvim-yarp'
Plug 'roxma/vim-hug-neovim-rpc'

If I run gocode -help in my terminal it responds with the usage.

Dbz commented

Also here is my $GOPATH /Users/danielburt/go and $PATH:

/Users/danielburt/apache-cassandra-3.11.2/bin:./bin:/Users/danielburt/bin:/Users/danielburt/.rbenv/bin:/Users/danielburt/.rbenv/shims:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Applications/Postgres.app/Contents/Versions/9.4/bin:/usr/local/mysql/bin:/Users/danielburt/bin:/Users/danielburt/go/bin
Dbz commented

The issue is that my actual code wasn't in the correct path. I didn't understand that all Go code repos go in the same place. Thank you for your help @Shougo!

For people finding this How to Write Go Code was helpful in figuring out that all Go projects are in the same directory.

Oh, OK.