ternjs / tern_for_vim

Tern plugin for Vim
MIT License
1.83k stars 100 forks source link

Empty Port File #173

Open sangaline opened 7 years ago

sangaline commented 7 years ago

I've been frequently running into this error:

Error detected while processing function provider#python3#Call:                                                        
line   18:                                                                                                             
Traceback (most recent call last):                                                                                     
  File "<string>", line 1, in <module>                                                                                 
  File "/home/sangaline/.config/nvim/plugged/tern_for_vim/script/tern.py", line 246, in tern_sendBufferIfDirty         
    if curSeq > vim.eval("b:ternBufferSentAt") and tern_sendBuffer():                                                  
  File "/home/sangaline/.config/nvim/plugged/tern_for_vim/script/tern.py", line 234, in tern_sendBuffer                
    port, _portIsOld = tern_findServer()                                                                               
  File "/home/sangaline/.config/nvim/plugged/tern_for_vim/script/tern.py", line 98, in tern_findServer                 
    port = int(open(portFile, "r").read())                                                                             
ValueError: invalid literal for int() with base 10: ''  

where it appears that the port file is empty. The error is displayed when switching buffers.

Aside from how the port file gets empty in the first place, perhaps this is something that tern_for_vim should be able to recover from?