carlitux / deoplete-ternjs

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

Doesn't seem to work #8

Closed wavded closed 8 years ago

wavded commented 8 years ago

Running latest deoplete and deoplete-ternjs, I get this when autocompletion starts:

[deoplete] Traceback (most recent call last):
[deoplete]   File "/Users/wavded/.config/nvim/plugged/deoplete.nvim/rplugin/python3/deoplete/deoplete.py", lin
e 64, in completion_begin
[deoplete]     complete_position, candidates = self.gather_candidates(context)
[deoplete]   File "/Users/wavded/.config/nvim/plugged/deoplete.nvim/rplugin/python3/deoplete/deoplete.py", lin
e 99, in gather_candidates
[deoplete]     results = self.gather_results(context)
[deoplete]   File "/Users/wavded/.config/nvim/plugged/deoplete.nvim/rplugin/python3/deoplete/deoplete.py", lin
e 174, in gather_results
[deoplete]     context['candidates'] = source.gather_candidates(context)
[deoplete]   File "/Users/wavded/.config/nvim/plugged/deoplete-ternjs/rplugin/python3/deoplete/sources/ternjs.
py", line 335, in gather_candidates
[deoplete]     result = self.completation(pos)
[deoplete]   File "/Users/wavded/.config/nvim/plugged/deoplete-ternjs/rplugin/python3/deoplete/sources/ternjs.
py", line 295, in completation
[deoplete]     data = self.run_command(command, pos)
[deoplete]   File "/Users/wavded/.config/nvim/plugged/deoplete-ternjs/rplugin/python3/deoplete/sources/ternjs.
py", line 206, in run_command
[deoplete]     raise e
[deoplete]   File "/Users/wavded/.config/nvim/plugged/deoplete-ternjs/rplugin/python3/deoplete/sources/ternjs.
py", line 200, in run_command
[deoplete]     data = self.make_request(doc, silent)
[deoplete]   File "/Users/wavded/.config/nvim/plugged/deoplete-ternjs/rplugin/python3/deoplete/sources/ternjs.
py", line 148, in make_request
[deoplete]     req = opener.open("http://" + self.localhost + ":" + str(self.port) + "/", payload, self._tern_
timeout)
[deoplete]   File "/usr/local/Cellar/python3/3.5.1/Frameworks/Python.framework/Versions/3.5/lib/python3.5/urll
ib/request.py", line 465, in open
[deoplete]     response = self._open(req, data)
[deoplete]   File "/usr/local/Cellar/python3/3.5.1/Frameworks/Python.framework/Versions/3.5/lib/python3.5/urll
ib/request.py", line 483, in _open
[deoplete]     '_open', req)
[deoplete]   File "/usr/local/Cellar/python3/3.5.1/Frameworks/Python.framework/Versions/3.5/lib/python3.5/urll
ib/request.py", line 443, in _call_chain
[deoplete]     result = func(*args)
[deoplete]   File "/usr/local/Cellar/python3/3.5.1/Frameworks/Python.framework/Versions/3.5/lib/python3.5/urll
ib/request.py", line 1268, in http_open
[deoplete]     return self.do_open(http.client.HTTPConnection, req)

Tern is installed globally:

└── tern@0.17.0

This is my tern config:

{
  "libs": [ "browser", "ecma6", "ecma5" ],
  "loadEagerly": [],
  "dontLoad": ["node_modules"],
  "plugins": {
    "complete_strings": true,
    "doc_comment": true,
    "modules": true,
    "node": true,
    "node_require": true
  }
}

Any ideas?

carlitux commented 8 years ago

Just tested and it is working for me.

iamcco commented 8 years ago

it seems the same issue

[deoplete] Traceback (most recent call last):
[deoplete]   File "/home/yuuko/dotfiles/nvim/plugged/deoplete.nvim/rplugin/python3/deoplete/deoplete.py", line 64, in completion_begin
[deoplete]     complete_position, candidates = self.gather_candidates(context)
[deoplete]   File "/home/yuuko/dotfiles/nvim/plugged/deoplete.nvim/rplugin/python3/deoplete/deoplete.py", line 99, in gather_candidates
[deoplete]     results = self.gather_results(context)
[deoplete]   File "/home/yuuko/dotfiles/nvim/plugged/deoplete.nvim/rplugin/python3/deoplete/deoplete.py", line 174, in gather_results
[deoplete]     context['candidates'] = source.gather_candidates(context)
[deoplete]   File "/home/yuuko/dotfiles/nvim/plugged/deoplete-ternjs/rplugin/python3/deoplete/sources/ternjs.py", line 337, in gather_candidates
[deoplete]     result = self.completation(pos)
[deoplete]   File "/home/yuuko/dotfiles/nvim/plugged/deoplete-ternjs/rplugin/python3/deoplete/sources/ternjs.py", line 297, in completation
[deoplete]     data = self.run_command(command, pos)
[deoplete]   File "/home/yuuko/dotfiles/nvim/plugged/deoplete-ternjs/rplugin/python3/deoplete/sources/ternjs.py", line 206, in run_command
[deoplete]     raise e
[deoplete]   File "/home/yuuko/dotfiles/nvim/plugged/deoplete-ternjs/rplugin/python3/deoplete/sources/ternjs.py", line 200, in run_command
[deoplete]     data = self.make_request(doc, silent)
[deoplete]   File "/home/yuuko/dotfiles/nvim/plugged/deoplete-ternjs/rplugin/python3/deoplete/sources/ternjs.py", line 148, in make_request
[deoplete]     req = opener.open("http://" + self.localhost + ":" + str(self.port) + "/", payload, self._tern_timeout)
[deoplete]   File "/usr/lib/python3.4/urllib/request.py", line 464, in open
[deoplete]     response = self._open(req, data)
[deoplete]   File "/usr/lib/python3.4/urllib/request.py", line 482, in _open
[deoplete]     '_open', req)
[deoplete]   File "/usr/lib/python3.4/urllib/request.py", line 442, in _call_chain
[deoplete]     result = func(*args)
[deoplete]   File "/usr/lib/python3.4/urllib/request.py", line 1211, in http_open
[deoplete]     return self.do_open(http.client.HTTPConnection, req)
[deoplete]   File "/usr/lib/python3.4/urllib/request.py", line 1186, in do_open
[deoplete]     r = h.getresponse()
[deoplete]   File "/usr/lib/python3.4/http/client.py", line 1227, in getresponse
[deoplete]     response.begin()
[deoplete]   File "/usr/lib/python3.4/http/client.py", line 386, in begin
[deoplete]     version, status, reason = self._read_status()
[deoplete]   File "/usr/lib/python3.4/http/client.py", line 348, in _read_status
[deoplete]     line = str(self.fp.readline(_MAXLINE + 1), "iso-8859-1")
[deoplete]   File "/usr/lib/python3.4/socket.py", line 374, in readinto
[deoplete]     return self._sock.recv_into(b)
[deoplete] socket.timeout: timed out
[deoplete] An error has occurred. Please execute :messages command.
[deoplete] Traceback (most recent call last):
[deoplete] Traceback (most recent call last):
[deoplete] Traceback (most recent call last):
[deoplete]   File "/home/yuuko/dotfiles/nvim/plugged/deoplete.nvim/rplugin/python3/deoplete/deoplete.py", line 64, in completion_begin
[deoplete]   File "/home/yuuko/dotfiles/nvim/plugged/deoplete.nvim/rplugin/python3/deoplete/deoplete.py", line 64, in completion_begin
[deoplete]   File "/home/yuuko/dotfiles/nvim/plugged/deoplete.nvim/rplugin/python3/deoplete/deoplete.py", line 64, in completion_begin
[deoplete]     complete_position, candidates = self.gather_candidates(context)
[deoplete]     complete_position, candidates = self.gather_candidates(context)
[deoplete]     complete_position, candidates = self.gather_candidates(context)
[deoplete]   File "/home/yuuko/dotfiles/nvim/plugged/deoplete.nvim/rplugin/python3/deoplete/deoplete.py", line 99, in gather_candidates
[deoplete]   File "/home/yuuko/dotfiles/nvim/plugged/deoplete.nvim/rplugin/python3/deoplete/deoplete.py", line 99, in gather_candidates
[deoplete]   File "/home/yuuko/dotfiles/nvim/plugged/deoplete.nvim/rplugin/python3/deoplete/deoplete.py", line 99, in gather_candidates
[deoplete]     results = self.gather_results(context)
[deoplete]     results = self.gather_results(context)
[deoplete]     results = self.gather_results(context)
[deoplete]   File "/home/yuuko/dotfiles/nvim/plugged/deoplete.nvim/rplugin/python3/deoplete/deoplete.py", line 174, in gather_results
[deoplete]   File "/home/yuuko/dotfiles/nvim/plugged/deoplete.nvim/rplugin/python3/deoplete/deoplete.py", line 174, in gather_results
[deoplete]   File "/home/yuuko/dotfiles/nvim/plugged/deoplete.nvim/rplugin/python3/deoplete/deoplete.py", line 174, in gather_results
[deoplete]     context['candidates'] = source.gather_candidates(context)
[deoplete]     context['candidates'] = source.gather_candidates(context)
[deoplete]     context['candidates'] = source.gather_candidates(context)
[deoplete]   File "/home/yuuko/dotfiles/nvim/plugged/deoplete-ternjs/rplugin/python3/deoplete/sources/ternjs.py", line 337, in gather_candidates
[deoplete]   File "/home/yuuko/dotfiles/nvim/plugged/deoplete-ternjs/rplugin/python3/deoplete/sources/ternjs.py", line 337, in gather_candidates
[deoplete]   File "/home/yuuko/dotfiles/nvim/plugged/deoplete-ternjs/rplugin/python3/deoplete/sources/ternjs.py", line 337, in gather_candidates
[deoplete]     result = self.completation(pos)
[deoplete]     result = self.completation(pos)
[deoplete]     result = self.completation(pos)
[deoplete]   File "/home/yuuko/dotfiles/nvim/plugged/deoplete-ternjs/rplugin/python3/deoplete/sources/ternjs.py", line 297, in completation
[deoplete]   File "/home/yuuko/dotfiles/nvim/plugged/deoplete-ternjs/rplugin/python3/deoplete/sources/ternjs.py", line 297, in completation
[deoplete]   File "/home/yuuko/dotfiles/nvim/plugged/deoplete-ternjs/rplugin/python3/deoplete/sources/ternjs.py", line 297, in completation
[deoplete]     data = self.run_command(command, pos)
[deoplete]     data = self.run_command(command, pos)
[deoplete]     data = self.run_command(command, pos)
[deoplete]   File "/home/yuuko/dotfiles/nvim/plugged/deoplete-ternjs/rplugin/python3/deoplete/sources/ternjs.py", line 206, in run_command
[deoplete]   File "/home/yuuko/dotfiles/nvim/plugged/deoplete-ternjs/rplugin/python3/deoplete/sources/ternjs.py", line 206, in run_command
[deoplete]   File "/home/yuuko/dotfiles/nvim/plugged/deoplete-ternjs/rplugin/python3/deoplete/sources/ternjs.py", line 206, in run_command
[deoplete]     raise e
[deoplete]     raise e
[deoplete]     raise e
[deoplete]   File "/home/yuuko/dotfiles/nvim/plugged/deoplete-ternjs/rplugin/python3/deoplete/sources/ternjs.py", line 200, in run_command
[deoplete]   File "/home/yuuko/dotfiles/nvim/plugged/deoplete-ternjs/rplugin/python3/deoplete/sources/ternjs.py", line 200, in run_command
[deoplete]   File "/home/yuuko/dotfiles/nvim/plugged/deoplete-ternjs/rplugin/python3/deoplete/sources/ternjs.py", line 200, in run_command
[deoplete]     data = self.make_request(doc, silent)
[deoplete]     data = self.make_request(doc, silent)
[deoplete]     data = self.make_request(doc, silent)
[deoplete]   File "/home/yuuko/dotfiles/nvim/plugged/deoplete-ternjs/rplugin/python3/deoplete/sources/ternjs.py", line 148, in make_request
[deoplete]   File "/home/yuuko/dotfiles/nvim/plugged/deoplete-ternjs/rplugin/python3/deoplete/sources/ternjs.py", line 148, in make_request
[deoplete]   File "/home/yuuko/dotfiles/nvim/plugged/deoplete-ternjs/rplugin/python3/deoplete/sources/ternjs.py", line 148, in make_request
[deoplete]     req = opener.open("http://" + self.localhost + ":" + str(self.port) + "/", payload, self._tern_timeout)
[deoplete]     req = opener.open("http://" + self.localhost + ":" + str(self.port) + "/", payload, self._tern_timeout)
[deoplete]     req = opener.open("http://" + self.localhost + ":" + str(self.port) + "/", payload, self._tern_timeout)
[deoplete]   File "/usr/lib/python3.4/urllib/request.py", line 464, in open
[deoplete]   File "/usr/lib/python3.4/urllib/request.py", line 464, in open
[deoplete]   File "/usr/lib/python3.4/urllib/request.py", line 464, in open
[deoplete]     response = self._open(req, data)
[deoplete]     response = self._open(req, data)
[deoplete]     response = self._open(req, data)
[deoplete]   File "/usr/lib/python3.4/urllib/request.py", line 482, in _open
[deoplete]   File "/usr/lib/python3.4/urllib/request.py", line 482, in _open
[deoplete]   File "/usr/lib/python3.4/urllib/request.py", line 482, in _open
[deoplete]     '_open', req)
[deoplete]     '_open', req)
[deoplete]     '_open', req)
[deoplete]   File "/usr/lib/python3.4/urllib/request.py", line 442, in _call_chain
[deoplete]   File "/usr/lib/python3.4/urllib/request.py", line 442, in _call_chain
[deoplete]   File "/usr/lib/python3.4/urllib/request.py", line 442, in _call_chain
[deoplete]     result = func(*args)
[deoplete]     result = func(*args)
[deoplete]     result = func(*args)
[deoplete]   File "/usr/lib/python3.4/urllib/request.py", line 1211, in http_open
[deoplete]   File "/usr/lib/python3.4/urllib/request.py", line 1211, in http_open
[deoplete]   File "/usr/lib/python3.4/urllib/request.py", line 1211, in http_open
[deoplete]     return self.do_open(http.client.HTTPConnection, req)
[deoplete]     return self.do_open(http.client.HTTPConnection, req)
[deoplete]     return self.do_open(http.client.HTTPConnection, req)
[deoplete]   File "/usr/lib/python3.4/urllib/request.py", line 1186, in do_open
[deoplete]   File "/usr/lib/python3.4/urllib/request.py", line 1186, in do_open
[deoplete]   File "/usr/lib/python3.4/urllib/request.py", line 1186, in do_open
[deoplete]     r = h.getresponse()
[deoplete]     r = h.getresponse()
[deoplete]     r = h.getresponse()
[deoplete]   File "/usr/lib/python3.4/http/client.py", line 1227, in getresponse
[deoplete]   File "/usr/lib/python3.4/http/client.py", line 1227, in getresponse
[deoplete]   File "/usr/lib/python3.4/http/client.py", line 1227, in getresponse
[deoplete]     response.begin()
[deoplete]     response.begin()
[deoplete]     response.begin()
[deoplete]   File "/usr/lib/python3.4/http/client.py", line 386, in begin
[deoplete]   File "/usr/lib/python3.4/http/client.py", line 386, in begin
[deoplete]   File "/usr/lib/python3.4/http/client.py", line 386, in begin
[deoplete]     version, status, reason = self._read_status()
[deoplete]     version, status, reason = self._read_status()
[deoplete]     version, status, reason = self._read_status()
[deoplete]   File "/usr/lib/python3.4/http/client.py", line 348, in _read_status
[deoplete]   File "/usr/lib/python3.4/http/client.py", line 348, in _read_status
[deoplete]   File "/usr/lib/python3.4/http/client.py", line 348, in _read_status
[deoplete]     line = str(self.fp.readline(_MAXLINE + 1), "iso-8859-1")
[deoplete]     line = str(self.fp.readline(_MAXLINE + 1), "iso-8859-1")
[deoplete]     line = str(self.fp.readline(_MAXLINE + 1), "iso-8859-1")
[deoplete]   File "/usr/lib/python3.4/socket.py", line 374, in readinto
[deoplete]   File "/usr/lib/python3.4/socket.py", line 374, in readinto
[deoplete]   File "/usr/lib/python3.4/socket.py", line 374, in readinto
[deoplete]     return self._sock.recv_into(b)
[deoplete]     return self._sock.recv_into(b)
[deoplete]     return self._sock.recv_into(b)
[deoplete] socket.timeout: timed out
[deoplete] socket.timeout: timed out
[deoplete] socket.timeout: timed out
[deoplete] An error has occurred. Please execute :messages command.
[deoplete] An error has occurred. Please execute :messages command.
[deoplete] An error has occurred. Please execute :messages command.

.tern-project

{
    "libs": [
        "browser",
        "jquery",
        "ecma5",
        "ecma6"
    ],
    "plugins": {
        "node": {}
    }
}

the way to reproduct this:

git clone https://github.com/iamcco/markdown.css
cd markdown.css
npm install
nvim gulpfile.js

then add an newline at the bottom and type gulp.

wavded commented 8 years ago

Some more info. When I switched back to tern_for_vim and manually added sources to deoplete, I do not experience this issue. Same configs, perhaps isolated to this plugin?

carlitux commented 8 years ago

looks like it is timeout... I added settings for timeout same as tern_for_vim

carlitux commented 8 years ago

@wavded your tern_for_vim ternjs is up to date?

Olical commented 8 years ago

I'm getting intermittent timeouts too, usually just after I've launched neovim. I can dump my stack trace if you want, but it looks essentially identical to the one above. My plugins https://github.com/Olical/dotfiles/blob/master/neovim/.config/nvim/plugins.vim

carlitux commented 8 years ago

Is it a long file? The one are you editing?

On Tue, Mar 22, 2016, 12:51 PM Oliver Caldwell notifications@github.com wrote:

I'm getting intermittent timeouts too, usually just after I've launched neovim. I can dump my stack trace if you want, but it looks essentially identical to the one above. My plugins https://github.com/Olical/dotfiles/blob/master/neovim/.config/nvim/plugins.vim

— You are receiving this because you commented.

Reply to this email directly or view it on GitHub https://github.com/carlitux/deoplete-ternjs/issues/8#issuecomment-199901982

Olical commented 8 years ago

Nope, not particularly. After the first run it's okay though. Maybe my imports slow it down though on the server startup? On 22 Mar 2016 16:59, "Luis Carlos Cruz" notifications@github.com wrote:

Is it a long file? The one are you editing?

On Tue, Mar 22, 2016, 12:51 PM Oliver Caldwell notifications@github.com wrote:

I'm getting intermittent timeouts too, usually just after I've launched neovim. I can dump my stack trace if you want, but it looks essentially identical to the one above. My plugins

https://github.com/Olical/dotfiles/blob/master/neovim/.config/nvim/plugins.vim

— You are receiving this because you commented.

Reply to this email directly or view it on GitHub < https://github.com/carlitux/deoplete-ternjs/issues/8#issuecomment-199901982

— You are receiving this because you commented. Reply to this email directly or view it on GitHub https://github.com/carlitux/deoplete-ternjs/issues/8#issuecomment-199906585

carlitux commented 8 years ago

well just tested and looks like is failing with gulpfiles

Olical commented 8 years ago

There's no gulp involved here at all :) I would put it down to when the server starts up it has to read all dependencies, I have stuff like lodash and other big libraries being imported. After it's up it's okay, but initial startup time causes it to timeout a few times.

Maybe there's a nicer way to wait for the initial startup instead of a hard timeout?

carlitux commented 8 years ago

@Olical edit any other javascript file and works, but if you try to edit a gulpfile stop working. Just tested with another project.

Olical commented 8 years ago

Ah, I see. What if you include babel or lodash alongside something like bluebird and winston. Just a lot of mildly sizes projects? I just have a feeling it's sheer size and not gulp specifically. React is big too, so that plus a few others could do it.

carlitux commented 8 years ago

@Olical could you test with a simple gulpfile? maybe this bug will be to tern project.

Olical commented 8 years ago

Tried the example mentioned above. With all require lines, timeout. With just gulp, it works. With gulp + the second one, it works. Gulp + two more (including stylus) it timed out. So then I tried it with three, but no stylus: Timeout.

It's not a specific module, it's the amount. I tried every combination, as I started to add too many (didn't matter how many) it took longer until it timed out.

carlitux commented 8 years ago

well, so this bug should be reported to https://github.com/ternjs/tern/

wavded commented 8 years ago

On lastest ternjs, seems to work "better", but I always get this timeout error the first time it tries to autocomplete, seems to work better after that. Can the timeout be extended @carlitux ?

carlitux commented 8 years ago

Yeah read the timeout settings on README file.

wavded commented 8 years ago

nvm @carlitux , see there are some docs for that, bumped timeout, working so far.