Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

deoplete-ternjs can't deal with files open with Netrw #36

Open
glacambre opened this issue Dec 16, 2016 · 2 comments
Open

deoplete-ternjs can't deal with files open with Netrw #36

glacambre opened this issue Dec 16, 2016 · 2 comments

Comments

@glacambre
Copy link

When trying to autocomplete the content of a file open over the scp:// protocol, deoplete-ternjs will display errors and won't fill the autocompletion popup menu.
Here are the steps to reproduce the bug, provided that deoplete and deoplete-ternjs are loaded in your vimrc:

nvim scp://server//tmp/tmp.js
:set ft=javascript
a (go into insert mode)
let

Once you do that, the following errors will be shown:

[deoplete] Traceback (most recent call last):
[deoplete]   File "/home/me/.vim/bundle/repos/github.com/Shougo/deoplete.nvim/rplugin/python3/deoplete/deoplete.py", line 100, in gather_results
[deoplete]     ctx['candidates'] = source.gather_candidates(ctx)
[deoplete]   File "/home/me/.vim/bundle/repos/github.com/carlitux/deoplete-ternjs/rplugin/python3/deoplete/sources/ternjs.py", line 351, in gather_candidates
[deoplete]     result = self.completation(pos) or []
[deoplete]   File "/home/me/.vim/bundle/repos/github.com/carlitux/deoplete-ternjs/rplugin/python3/deoplete/sources/ternjs.py", line 307, in completation
[deoplete]     data = self.run_command(command, pos)
[deoplete]   File "/home/me/.vim/bundle/repos/github.com/carlitux/deoplete-ternjs/rplugin/python3/deoplete/sources/ternjs.py", line 180, in run_command
[deoplete]     self.start_server()
[deoplete]   File "/home/me/.vim/bundle/repos/github.com/carlitux/deoplete-ternjs/rplugin/python3/deoplete/sources/ternjs.py", line 92, in start_server
[deoplete]     portFile = os.path.join(self._project_directory, ".tern-port")
[deoplete] Traceback (most recent call last):
[deoplete]   File "/usr/lib64/python3.4/posixpath.py", line 82, in join
[deoplete]   File "/home/me/.vim/bundle/repos/github.com/Shougo/deoplete.nvim/rplugin/python3/deoplete/deoplete.py", line 100, in gather_results
[deoplete]     path += b
[deoplete]     ctx['candidates'] = source.gather_candidates(ctx)
[deoplete] TypeError: unsupported operand type(s) for +=: 'NoneType' and 'str'
[deoplete]   File "/home/me/.vim/bundle/repos/github.com/carlitux/deoplete-ternjs/rplugin/python3/deoplete/sources/ternjs.py", line 351, in gather_candidates
[deoplete] Could not get completions from: ternjs.  Use :messages for error details.
[deoplete]     result = self.completation(pos) or []
[deoplete]   File "/home/me/.vim/bundle/repos/github.com/carlitux/deoplete-ternjs/rplugin/python3/deoplete/sources/ternjs.py", line 307, in completation
[deoplete]     data = self.run_command(command, pos)
[deoplete]   File "/home/me/.vim/bundle/repos/github.com/carlitux/deoplete-ternjs/rplugin/python3/deoplete/sources/ternjs.py", line 198, in run_command
[deoplete]     doc["files"].append(self.full_buffer())
[deoplete]   File "/home/me/.vim/bundle/repos/github.com/carlitux/deoplete-ternjs/rplugin/python3/deoplete/sources/ternjs.py", line 236, in full_buffer
[deoplete]     "name": self.relative_file(),
[deoplete]   File "/home/me/.vim/bundle/repos/github.com/carlitux/deoplete-ternjs/rplugin/python3/deoplete/sources/ternjs.py", line 251, in relative_file
[deoplete]     return filename[len(self._project_directory) + 1:]
[deoplete] TypeError: object of type 'NoneType' has no len()
[deoplete] Could not get completions from: ternjs.  Use :messages for error details.

I believe this is a bug with deoplete-ternjs and not a deoplete one because other autocompletion plugins (such as deoplete-jedi) work over scp.

@carlitux
Copy link
Owner

I didn't tested over it and I don't have time to do it. If you can look at it and do a pull request would be good.

@glacambre
Copy link
Author

I found a way to prevent the errors from popping up but haven't found a way to actually have autocompletion work.
I opened an issue on another deoplete plugin because a similar bug was happening (deoplete-plugins/deoplete-clang#69) and deoplete's maintainer said opening remote files wasn't supported. I asked him for more information and will continue working on this issue once he gives me an answer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants