ternjs / tern_for_vim

Tern plugin for Vim
MIT License
1.83k stars 100 forks source link

Cant seem to integrate tern with autocomplete #131

Open colbycheeze opened 8 years ago

colbycheeze commented 8 years ago

I've tried multiple installs, tutorials, multiple versions of Vim...(currently running NeoVim atm)

I've set up YouCompleteMe and it won't work, and now tried Deoplete and it doesn't work either.

The tern settings are correct, as I have it working perfectly with Atom. It's just Vim that won't complete properly or do any pop up menus etc.

Here is a gif of what it's showing...which is really weird to me. I can call :TernDoc but the PUM never comes up otherwise. example

I've spent countless hours googling and troubleshooting to the point despair lol. Totally baffled... any ideas?

Here are my settings that seem to be related:

" supertab makes tab work with autocomplete and ultisnips
Plug 'ervandew/supertab'
" Provides Async autocomplete with Tern
Plug 'https://github.com/Shougo/deoplete.nvim'
" IDE like code intelligence for Javascript
Plug 'ternjs/tern_for_vim', {'do': 'npm install'}

...

" [10] make YCM compatible with UltiSnips (using supertab)
let g:SuperTabDefaultCompletionType = '<C-n>'

let g:deoplete#enable_at_startup = 1
if !exists('g:deoplete#omni#input_patterns')
  let g:deoplete#omni#input_patterns = {}
endif
autocmd InsertLeave,CompleteDone * if pumvisible() == 0 | pclose | endif

" omnifuncs
augroup omnifuncs
  autocmd!
  autocmd FileType css setlocal omnifunc=csscomplete#CompleteCSS
  autocmd FileType html,markdown setlocal omnifunc=htmlcomplete#CompleteTags
  autocmd FileType javascript setlocal omnifunc=javascriptcomplete#CompleteJS
  autocmd FileType xml setlocal omnifunc=xmlcomplete#CompleteTags
augroup end

" tern
if exists('g:plugs["tern_for_vim"]')
  let g:tern_show_argument_hints = 'on_hold'
  let g:tern_show_signature_in_pum = 1

  autocmd FileType javascript setlocal omnifunc=tern#Complete
endif
nemild commented 8 years ago

For YouCompleteMe, have you installed using: ./install.py --tern-completer

You can see more instructions here.

If so, have you isolated the problem to YCM or Deoplete vs tern_for_vim? Does YCM or Deoplete work?

christopher-francisco commented 7 years ago

Did you manage to solve this?

I have installed both YouCompleteMe and tern_for_vim, but not sure if I'm missing something. I'm getting a Value Error: Not connected to server

christopher-francisco commented 7 years ago

Nevermind, I had a syntax error in my .tern-project