Closed razor-x closed 8 years ago
Could you send minimal init.vim config file
@carlitux Sure, right after lunch :apple:
call plug#begin('~/.config/nvim/plugged.test')
" Set Python 3 host (optional: based on environment).
" let g:python3_host_prog = '/bin/python3'
function! DoRemote(arg)
UpdateRemotePlugins
endfunction
Plug 'shougo/deoplete.nvim',
\ { 'do': function('DoRemote') }
Plug 'ternjs/tern_for_vim',
\ { 'for': 'javascript' }
Plug 'carlitux/deoplete-ternjs',
\ { 'for': 'javascript' }
let g:deoplete#enable_at_startup = 1
let g:tern#command = ['tern']
let g:tern#arguments = ['--persistent']
call plug#end()
set omnifunc=syntaxcomplete#Complete
inoremap <silent><expr> <Tab>
\ pumvisible() ?
\ deoplete#manual_complete() :
\ deoplete#manual_complete()
Note I'm using Tab to trigger completion for this example.
Another thing that is broken: assume I'm editing index.js
and mylib.js
is in same directory.
import './|
# Have to press <Tab> to trigger deoplete#manual_complete()
# select from popup: './mylib'
# result is
import './'./mylib'
This too:
import './m|
# Try to press <Tab> to trigger deoplete#manual_complete()
# No [ternjs] items in popup, so cannot select './mylib'
Normal
I also don't get why I have to trigger manual completion to see [ternjs] options for these examples.
Well I think this is related with your setup, using pumvisible and
To get working deoplate just setup the basic one and install this source with the plugin.
@carlitux Do you have a working example then?
I only put the last mapping there so I'd have a way to trigger [ternjs] sources appearing in the popup. If I don't have a mapping to trigger manual completion, then the popup will never appear for the examples I gave. I actually use the mapping
inoremap <expr> <C-Space> deoplete#manual_complete()
in my main config, but that was not working for me when testing it for some reason.
If I understand you correctly, then the following works for you?
call plug#begin('~/.config/nvim/plugged.test')
function! DoRemote(arg)
UpdateRemotePlugins
endfunction
Plug 'shougo/deoplete.nvim', { 'do': function('DoRemote') }
Plug 'carlitux/deoplete-ternjs'
let g:deoplete#enable_at_startup = 1
call plug#end()
If I use that, then
import '|
will not show a popup and I never get any [ternjs] completions to appear
https://github.com/linkux-it/linkux-dev/blob/master/conf/osx/nvimrc this for osx https://github.com/linkux-it/linkux-dev/blob/master/conf/ubuntu/nvimrc this for ubuntu you can only see the deoplete setup
Popup will appear as you type, and also ternjs depends on your setup to start serving the autocomplete.
Sorry @carlitux I don't want to run such a large vim config on my system as I don't know what side effects it may have. Do you have a minimal example? From what I can see, the only references to deoplete and ternjs in that config are
call dein#add('Shougo/deoplete.nvim', {'on_i': 1}) "{{{
let g:deoplete#enable_at_startup = 1
" }}}
call dein#add('zchee/deoplete-jedi', )
call dein#add('carlitux/deoplete-ternjs')
which seems about the same as what I just added.
Any thoughts on this one @Shougo?
For ternjs, I know it works for other input cases, for example, using
call plug#begin('~/.config/nvim/plugged.test')
function! DoRemote(arg)
UpdateRemotePlugins
endfunction
Plug 'shougo/deoplete.nvim', { 'do': function('DoRemote') }
Plug 'carlitux/deoplete-ternjs'
let g:deoplete#enable_at_startup = 1
call plug#end()
then
function myFunc () {
}
my|
will show the popup automatically with [ternjs] completion option for myFunc
.
Yes, those should works.
On Tue, Aug 9, 2016, 9:06 PM Evan Sosenko notifications@github.com wrote:
Sorry @carlitux https://github.com/carlitux I don't want to run such a large vim config on my system as I don't know what side effects it may have. Do you have a minimal example? From what I can see, the only references to deoplete and ternjs in that config are
call dein#add('Shougo/deoplete.nvim', {'on_i': 1}) "{{{
let g:deoplete#enable_at_startup = 1" }}}
call dein#add('zchee/deoplete-jedi', ) call dein#add('carlitux/deoplete-ternjs')
which seems about the same as what I just added.
Any thoughts on this one @Shougo https://github.com/Shougo?
For ternjs, I know it works for other input cases, for example, using
call plug#begin('~/.config/nvim/plugged.test')
function! DoRemote(arg) UpdateRemotePlugins endfunction
Plug 'shougo/deoplete.nvim', { 'do': function('DoRemote') }
Plug 'carlitux/deoplete-ternjs'
let g:deoplete#enable_at_startup = 1
call plug#end()
then
function myFunc () { }
my|
will show the popup automatically with [ternjs] completion option for myFunc.
— You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub https://github.com/carlitux/deoplete-ternjs/issues/25#issuecomment-238738523, or mute the thread https://github.com/notifications/unsubscribe-auth/AACeWhCMPdUNmgL0BgEindOP0Wu-5Vqaks5qeSQWgaJpZM4JgdZJ .
Right, so with that working, the popup does not appear on import '|
so I have to open it by triggering deoplete#manual_complete()
but then I get the extra quote issue as I reported. Compare with using <C-X><C-O>
with tern_for_vim and I get the other behaviour (no extra quote for the first case).
I see, I don't think ternjs has support to work on imports yet... If you have docs would be good
On Tue, Aug 9, 2016, 9:15 PM Evan Sosenko notifications@github.com wrote:
Right, so with that working, the popup does not appear on import '| so I have to open it by triggering deoplete#manual_complete() but then I get the extra quote issue as I reported. Compare with using
with tern_for_vim and I get the other behaviour (no extra quote for the first case). — You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub https://github.com/carlitux/deoplete-ternjs/issues/25#issuecomment-238739804, or mute the thread https://github.com/notifications/unsubscribe-auth/AACeWqIVkHOL4pxeTrBUJJhJCWrtAmBpks5qeSZEgaJpZM4JgdZJ .
As far as I can tell it works well with imports via the official plugins. I am using
{
"plugins": {
"node": {},
"node_resolve": {},
"modules": {},
"es_modules": {}
}
}
but those may not all be needed for it to work.
The key point is that tern is giving me correct module completion for local modules and modules in node_modules
, but the result after selecting one differs depending on if I select from the omni list populated by tern_for_vim vs. the [ternjs] source provided here, per my comments:
https://github.com/carlitux/deoplete-ternjs/issues/25#issue-170256206 https://github.com/carlitux/deoplete-ternjs/issues/25#issuecomment-238719760
Here is the first case: https://asciinema.org/a/1d8jq2va1dpp4uat2e8nb4y3p
Here is the local module issue: https://asciinema.org/a/brkv2of697nhbigcmy7k749f5
try to change your config to user another key instead of tab.
Sure, I'm actually using <C-Space>
in the videos, but running say
:inoremap <expr> <C-Q> deoplete#manual_complete()
and using that makes no difference.
I can't reproduce it with the setup, config
The extra quote issue, or getting the module completion to appear at all?
You would need to put a .tern-project
in your working directory with
{
"plugins": {
"node": {},
"node_resolve": {},
"modules": {},
"es_modules": {}
}
}
Both, I tested with big project and as you did on test... In both I can't get working neither issues.
On Tue, Aug 9, 2016, 10:38 PM Evan Sosenko notifications@github.com wrote:
The extra quote issue, or getting the module completion to appear at all?
You would need to put a .tern-project in your working directory with
{ "plugins": { "node": {}, "node_resolve": {}, "modules": {}, "es_modules": {} } }
— You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub https://github.com/carlitux/deoplete-ternjs/issues/25#issuecomment-238750472, or mute the thread https://github.com/notifications/unsubscribe-auth/AACeWhdjnpALivXvsl3DzNoBEizzwfY1ks5qeTmFgaJpZM4JgdZJ .
http://ternjs.net/doc/demo/#ES6 looks like the module adds the closing quote, so if you have a plugin that add the closing quote that should be the issue.
Maybe you need to setup tern plugin to avoid add the quote.
Well, yes, the closing quote issue is only for omni, so I expected it to be from tern, but the opening quote issue is only for this source.
As long this source gets the behaviour correct, I don't need to use omni. Even if you are not using a autoclose type plugin, it should still produce correct output in the case import '|'
.
I can't work on this until possibly tomorrow, but I'd love to get this fixed since importing stuff is so frequent.
I'll make a minimal repo which reproduces it for me and include my Neovim, tern, and node versions.
Ok, see here: https://github.com/rxbugs/vim-ternjs-imports
Let me know if that lets you reproduce it.
Can anyone else try too?
@razor-x did you ever get this working?
No, the project on rxbugs to reproduce the issue is where I stopped working on it (since carlitux closed it and couldn't reproduce).
Can you confirm this is an issue for you, in particular can you reproduce it on https://github.com/rxbugs/vim-ternjs-imports ?
I can confirm it does not work for me. If I use C-x C-o it works fine, just doesn't do it through deoplete.
@razor-x @wavded please see https://github.com/carlitux/deoplete-ternjs/issues/32 sorry to be late
With deoplete: extra leading
'
With
<C-X><C-O>
: worksRelated: if using something that automatically adds quote pairs.
With deoplete: extra leading
'
With
<C-X><C-O>
: extra trailing'
Tern config: