carlitux / deoplete-ternjs

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

React propTypes #55

Closed Falconerd closed 6 years ago

Falconerd commented 6 years ago

Hi, I'm trying to produce functionality in Neovim which is present in VSCode. Any properties defined on a React component's propTypes property is listed first in autocomplete, with an accompanying description if it's documented.

Here's a screenshot of what that looks like in vscode image

Now, I've read and re-read the instructions for deoplete, ternjs, and deoplete-ternjs, but I can't seem to get anything similar to that.

I seem to just get suggestions from the current buffer and general javascript variables and functions. image

.tern-project

{
"libs": [
"browser",
"react"
],
"plugins": {
"node": {}
}
}

.nvimrc


set colorcolumn=50,72,100
highlight ColorColumn ctermbg=0
set expandtab
set tabstop=2
set shiftwidth=2

filetype plugin on

call plug#begin('~/.local/share/nvim/plugged')

Plug 'scrooloose/nerdcommenter' Plug 'scrooloose/nerdtree' Plug 'prettier/vim-prettier', { \ 'do': 'yarn install', \ 'for': ['javascript', 'typescript', 'css', 'less', 'scss', 'json', 'graphql'] } Plug 'jparise/vim-graphql' Plug 'sheerun/vim-polyglot' " Plug 'https://github.com/bigfish/vim-js-context-coloring' Plug 'Shougo/deoplete.nvim', { 'do': ':UpdateRemotePlugins' } Plug 'carlitux/deoplete-ternjs' Plug 'w0rp/ale' Plug 'mhartington/nvim-typescript' Plug 'trevordmiller/nova-vim' Plug 'vim-airline/vim-airline' Plug 'easymotion/vim-easymotion' Plug 'ervandew/supertab'

call plug#end()

" Prettier

let g:prettier#config#autoformat = 1

" NERDTree

autocmd vimenter * NERDTree

" Use deoplete.

let g:deoplete#enable_at_startup = 1 let g:deoplete#enable_debug = 1 let g:deoplete#enable_profile = 1 call deoplete#enable_logging('DEBUG', '/usr/local/etc/deoplete.log')

" Ctrl-Space for completions inoremap deoplete#mappings#manual_complete()

" deoplete-tern

let g:deoplete#sources#ternjs#tern_bin = '/usr/local/lib/node_modules/tern/bin/tern' let g:deoplete#sources#ternjs#timeout = 1 let g:deoplete#sources#ternjs#types = 1 let g:deoplete#sources#ternjs#depths = 1 let g:deoplete#sources#ternjs#filter = 0 let g:deoplete#sources#ternjs#case_insensitive = 1 let g:deoplete#sources#ternjs#guess = 1 let g:deoplete#sources#ternjs#sort = 1 let g:deoplete#sources#ternjs#omit_object_prototype = 0 let g:deoplete#sources#ternjs#filtetypes = [ 'jsx', 'js', 'vue' ]

" Ale

let g:ale_fixers = { 'javascript': ['eslint'] }

" Airline

let g:airline_powerline_fonts = 1

" Tab Shortcuts nnoremap tk :tabfirst nnoremap tl :tabnext nnoremap th :tabprev nnoremap tj :tablast nnoremap tn :tabnew nnoremap tc :CtrlSpaceTabLabel nnoremap td :tabclose

" Color

colorscheme nova



Any help would be greatly appreciated!
carlitux commented 6 years ago

I can't reproduce it. I am working in my projects and looks like are working well.

Falconerd commented 6 years ago

Okay, cheers. I will try a clean setup tonight and see if I run into the same issues.

carlitux commented 6 years ago

please let me know how go all.