carlitux / deoplete-ternjs

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

Undefined variable: b:node_root #17

Closed FuzzOli87 closed 8 years ago

FuzzOli87 commented 8 years ago

Hello!

I've been using Deoplete with Deoplete-tern. There has been a consistent error message when I'm working on some projects. The projects are those that use the require() import instead of the new import statement. Is there any chance this is an issue related to this plugin?

[deoplete] Traceback (most recent call last):
[deoplete]   File "/Users/daniel.olivares/.nvim/plugged/deoplete.nvim/rplugin/python3/deoplete/deoplete.py", line 47, in completion_begin
[deoplete]     complete_position, candidates = self.gather_candidates(context)
[deoplete]   File "/Users/daniel.olivares/.nvim/plugged/deoplete.nvim/rplugin/python3/deoplete/deoplete.py", line 81, in gather_candidates
[deoplete]     results = self.gather_results(context)
[deoplete]   File "/Users/daniel.olivares/.nvim/plugged/deoplete.nvim/rplugin/python3/deoplete/deoplete.py", line 132, in gather_results
[deoplete]     context['candidates'] = source.gather_candidates(context)
[deoplete]   File "/Users/daniel.olivares/.nvim/plugged/deoplete.nvim/rplugin/python3/deoplete/sources/tag.py", line 32, in gather_candidates
[deoplete]     self.__make_cache(context)
[deoplete]   File "/Users/daniel.olivares/.nvim/plugged/deoplete.nvim/rplugin/python3/deoplete/sources/tag.py", line 43, in __make_cache
[deoplete]     for filename in self.__get_tagfiles():
[deoplete]   File "/Users/daniel.olivares/.nvim/plugged/deoplete.nvim/rplugin/python3/deoplete/sources/tag.py", line 55, in __get_tagfiles
[deoplete]     'exists', '*neoinclude#include#get_tag_files') else []
[deoplete]   File "/usr/local/lib/python3.5/site-packages/neovim/api/nvim.py", line 213, in call
[deoplete]     return self.request('vim_call_function', name, args, **kwargs)
[deoplete]   File "/usr/local/lib/python3.5/site-packages/neovim/api/nvim.py", line 129, in request
[deoplete]     res = self._session.request(name, *args, **kwargs)
[deoplete]   File "/usr/local/lib/python3.5/site-packages/neovim/msgpack_rpc/session.py", line 98, in request
[deoplete]     raise self.error_wrapper(err)
[deoplete] neovim.api.nvim.NvimError: b'Vim(return):E121: Undefined variable: b:node_root'
[deoplete] An error has occurred. Please execute :messages command.
carlitux commented 8 years ago

It is related in some way... I am getting also this some times I think is on gather_results but I couldn't find how this happens.

But reading your traceback looks like now it is related with tag files when tries to gather_results on it.

[deoplete]     for filename in self.__get_tagfiles():
FuzzOli87 commented 8 years ago

@carlitux Do you by any chance have neoinclude.vim installed?

carlitux commented 8 years ago

@FuzzOli87 yes I have installed.

FuzzOli87 commented 8 years ago

@carlitux That is the source of the issue. I'm not exactly sure what the plugin is meant to do, I don't even remember why I installed it. I looked it up in the deoplete docs and it was a recommended install so I added it. I know, lazy.

Anyways, I removed it and it stopped the errors. Not sure what the cause is but I might go back and investigate further. I don't get those errors when I'm using ES6 modules though, at least not that I remember.

It sounds like neoinclude.vim is for "include" files. I thought it meant stuff like import/require files? The only language I can think of that "includes" is C.

carlitux commented 8 years ago

That could be... anyway I reported the issue and it will be fixed soon.