carlitux / deoplete-ternjs

deoplete.nvim source for javascript
MIT License
277 stars 24 forks source link

Deoplete not showing any ternjs-suggestions #57

Closed MrAvantiC closed 6 years ago

MrAvantiC commented 6 years ago

Hi,

First of all: Thanks for the work you put into this plugin! :)

I have a fresh setup of nvim and cannot get any suggestions from ternjs to show up with deoplete.

Environment

Minimal config to reproduce

init.vim

call plug#begin()
Plug 'Shougo/deoplete.nvim', { 'do': ':UpdateRemotePlugins' }
Plug 'carlitux/deoplete-ternjs', { 'do': 'npm install -g tern' }
call plug#end()

" Activate deoplete
let g:deoplete#enable_at_startup = 1

" Start autocompletion right away
let g:deoplete#auto_complete_start_length = 1

" init variables
let g:deoplete#sources = {}

let g:deoplete#sources.javascript = ['buffer', 'ternjs']

I also made a directory where I put a sample js-file "test.js" and the following .tern-project:

  {
    "ecmaVersion": 6,
    "libs": [
      "ecmascript",
      "browser"
    ],
    "loadEagerly": [
    ]
  }

...which - as far as I understood the docs - should give me access to browser-globals like window or document. Unfortunately all I get in my "test.js" are completions from words that are already in the buffer.

Is there anything I'm missing here, is this an issue with my deoplete-config or an issue with deoplete/ternjs itself?

If you need any more information, let me know and I'll gladly provide.

carlitux commented 6 years ago

please try this setup:

let g:deoplete#sources.javascript = ['buffer', 'tern']
MrAvantiC commented 6 years ago

Well, there is my "I feel so stupid"-moment of the day.

Thanks for your help!

carlitux commented 6 years ago

you're welcome!