Closed kmARC closed 8 years ago
A good start for debugging would be to attach somehow to the tsserver that was started by YouCompleteMe. Any idea how to do this?
Are the log files listed in YcmDebugInfo ?
This is what I have after :YcmDebugInfo
Printing YouCompleteMe debug information...
-- Server has Clang support compiled in: True
-- Clang version: clang version 3.7.0 (tags/RELEASE_370/final)
--
-- Server running at: http://127.0.0.1:56312
-- Server process ID: 10183
-- Server logfiles:
-- /tmp/ycm_temp/server_56312_stdout.log
-- /tmp/ycm_temp/server_56312_stderr.log
From these, I attached stderr.log. stdout.log is empty.
I would say post the tsserver logs file, but apparently we don't make them :astonished:
EDIT: forget this. There should be a log file, but I don't know where the server saves it.
- Typing again my. neither works anymore.
This makes me think that the tsserver crashed or something.
This makes me think that the tsserver crashed or something.
According to ps
it's running even after exiting vim. Killing it kills YouCompleteMe
process too. Maybe it's not a YCM bug but TypeScript?
I'll try to find the log file.
Unfortunately I could not find the logs. However, I found out the following.
After completion stops working, if I try to :YcmCompleter GoToDefinition
, vim freezes for a long time and then I get a python stack trace too complaining on a timeout:
HTTPConnectionPool(host='127.0.0.1', port=43038): Read timed out. (read timeout=0.5)
Error detected while processing function <SNR>119_CompleterCommand:
line 18:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/home/oro/.vim/plugged/YouCompleteMe/autoload/../python/ycm/youcompleteme.py", line 207, in SendCommandRequest
return SendCommandRequest( arguments, completer )
File "/home/oro/.vim/plugged/YouCompleteMe/autoload/../python/ycm/client/command_request.py", line 111, in SendCommandRequest
request.Start()
File "/home/oro/.vim/plugged/YouCompleteMe/autoload/../python/ycm/client/command_request.py", line 53, in Start
'run_completer_command' )
File "/home/oro/.vim/plugged/YouCompleteMe/autoload/../python/ycm/client/base_request.py", line 71, in PostDataToHandler
timeout ) )
File "/home/oro/.vim/plugged/YouCompleteMe/autoload/../python/ycm/client/base_request.py", line 163, in JsonFromFuture
response = future.result()
File "/home/oro/.vim/plugged/YouCompleteMe/third_party/pythonfutures/concurrent/futures/_base.py", line 404, in result
return self.__get_result()
File "/home/oro/.vim/plugged/YouCompleteMe/third_party/pythonfutures/concurrent/futures/_base.py", line 356, in __get_result
raise self._exception
requests.exceptions.ReadTimeout: HTTPConnectionPool(host='127.0.0.1', port=43038): Read timed out. (read timeout=30)
I tried the following:
import * as Kefir from 'kefir';
This works perfectly.var stream = Kefir.
completion shows up immediately.var stream = Kefir.interval(1.5);
stream.
<- and from this point, YCM stops working. :YcmCompleter GoToDefinition
then after several seconds I get the stacktrace.Additional info:
stream.
, but at least doesn't hang). stream
.Do you know for sure if Atom uses the tsserver as well?
@icholy maybe this would interest you.
@vheon Sorry you're right probably they don't (seems they had their stuff before MS released TSServer)
I'll get on this.
If https://github.com/Quramy/tsuquyomi can't complete in the same spot then that is a tsserver issue. I really don't like the fact that vim freeze.
@icholy thanks :+1:
I'm able to reproduce this. My vim doesn't freeze though.
Looks like a tsserver issue:
Err 27 Exception on executing command {"command": "completions", "type": "request", "arguments": {"line": 8, "file": "/home/icholy/test/foo.ts", "offset": 5}, "seq": 7}:
EAGAIN: resource temporarily unavailable, write
Error: EAGAIN: resource temporarily unavailable, write
at Error (native)
at Object.fs.writeSync (fs.js:706:20)
at Object.write (/usr/local/lib/node_modules/typescript/lib/tsserver.js:944:43)
at IOSession.Session.sendLineToClient (/usr/local/lib/node_modules/typescript/lib/tsserver.js:40992:27)
at IOSession.Session.send (/usr/local/lib/node_modules/typescript/lib/tsserver.js:40999:22)
at IOSession.Session.response (/usr/local/lib/node_modules/typescript/lib/tsserver.js:41026:22)
at IOSession.Session.output (/usr/local/lib/node_modules/typescript/lib/tsserver.js:41030:22)
at IOSession.Session.onMessage (/usr/local/lib/node_modules/typescript/lib/tsserver.js:41695:30)
at Interface.<anonymous> (/usr/local/lib/node_modules/typescript/lib/tsserver.js:43663:27)
at emitOne (events.js:77:13)
Info 28 response: {"seq":0,"type":"response","command":"completions","request_seq":7,"success":false,"message":"Error processing request. EAGAIN: resource temporarily unavailable, write"}
Okay, so what's the next step? Should we probably create a bugreport to the TypeScript guys? Or is it possible that YCM doesn't use the API properly?
Looks like it's already fixed: https://github.com/Microsoft/TypeScript/pull/5354
The sublime plugin was having the same issue: https://github.com/Microsoft/TypeScript-Sublime-Plugin/issues/379
EDIT: You'll have to wait till 1.7 is released unless you're ok with using their master.
EDIT: FYI, you can enable tsserver logging by setting the TSS_LOG
env variable:
export TSS_LOG='-level verbose -file /tmp/tsserver.log'
FYI, you can enable tsserver logging by setting the
TSS_LOG
env variable:export TSS_LOG='-level verbose -file /tmp/tsserver.log'
Thanks.
@Valloric, @micbou, @puremourning @oblitum I think we should add this to the typescript completer so we could keep the logs around like we do with every other completers.
Thanks for all. With npm install -g typescript@next
works like a charm.
Can we redirect to ycmd log file? This makes it simpler IMO.
On 27 Nov 2015, at 18:24, Andrea Cedraro notifications@github.com wrote:
FYI, you can enable tsserver logging by setting the TSS_LOG env variable:
export TSS_LOG='-level verbose -file /tmp/tsserver.log' Thanks.
@Valloric, @micbou, @puremourning @oblitum I think we should add this to the typescript completer so we could keep the logs around like we do with every other completers.
— Reply to this email directly or view it on GitHub.
Can we redirect to ycmd log file? This makes it simpler IMO.
I don't think so.
Because we communicate with tsserver via stdin/stdout ? Makes sense.
@puremourning I'm working on adding logs file for tsserver ;)
nice one
@kmARC FYI 1.7 was released today.
Yepp, thanks for heads up.
$ npm install -g typescript@latest
...
$ tsc --version
message TS6029: Version 1.7.3
Works perfectly with YCM.
YouCompleteMe completion works very well with TypeScript if the semantic trigger (by default,
.
) is pressed. However, when I want to get completion and type hints without pressing a trigger (e.g. using<C-Space>
or<C-x> <C-o>
), YCM stops working, even worse, after exiting vim, YCM and tsserver processes are still running.I also tried Python completion, works out of the box, even after pressing
<C-Space>
.Example
my.
then suggestions show up (in this case, the MyClass::add method)add<C-Space>
then vim freezes for around half a second, and doesn't offer completionmy.
neither works anymore.Versions
Attachments