nim-lang / vscode-nim

A VS Code plugin for the Nim language
Other
78 stars 8 forks source link

Language server does not restart properly #70

Closed RazrFalcon closed 4 months ago

RazrFalcon commented 4 months ago

I'm seeing this in plugin's logs:

DBG Started...                                 benchmark="chk \"test.nim\";\"/var/folders/y5/sbsfmdzj4yvf243x6q18ghhc0000gn/T/nimlangserver/000000006F11245E.nim\":0:0" command="chk \"test.nim\";\"/var/folders/y5/sbsfmdzj4yvf243x6q18ghhc0000gn/T/nimlangserver/000000006F11245E.nim\":0:0"
DBG timeoutCallback is set                     timeout=120000 command="chk \"test.nim\";\"/var/folders/y5/sbsfmdzj4yvf243x6q18ghhc0000gn/T/nimlangserver/000000006F11245E.nim\":0:0"
DBG Router: dispatching                        method=textDocument/codeAction id=26
DBG Found nimble project                       projectFile=test.nim
DBG getProjectFile                             project=test.nim
DBG Router: sending response                   method=textDocument/codeAction id=26
>> SIGSEGV: Illegal storage access. (Attempt to read from nil?)
WRN Server stopped.                            projectFile=test.nim
DBG ShowMessage                                message="Server failed with Server crashed/socket closed.."
DBG Server socket closed                       command="chk \"test.nim\";\"/var/folders/y5/sbsfmdzj4yvf243x6q18ghhc0000gn/T/nimlangserver/000000006F11245E.nim\":0:0"
DBG Call cancelled before sending error        command="chk \"test.nim\";\"/var/folders/y5/sbsfmdzj4yvf243x6q18ghhc0000gn/T/nimlangserver/000000006F11245E.nim\":0:0"
DBG Call was cancelled before sending the result command="chk \"test.nim\";\"/var/folders/y5/sbsfmdzj4yvf243x6q18ghhc0000gn/T/nimlangserver/000000006F11245E.nim\":0:0"
DBG CPU Time                                   benchmark="chk \"test.nim\";\"/var/folders/y5/sbsfmdzj4yvf243x6q18ghhc0000gn/T/nimlangserver/000000006F11245E.nim\":0:0" time=0.309 command="chk \"test.nim\";\"/var/folders/y5/sbsfmdzj4yvf243x6q18ghhc0000gn/T/nimlangserver/000000006F11245E.nim\":0:0"
DBG Nimsuggest is not working, returning empty result... 

(I have replaced actual file path with test.nim)

As soon as this happens autocomplete and go-to definition are no longer working and I have to restart VSCode.

Happens during regular nim code editing, when code is partially malformed.

jmgomez commented 4 months ago

This is a nimlangserver issue rather than an extension one. Can you repost there and also post the code that makes nimsuggest crash (so we can tackle it as another issue in nimsuggest?

RazrFalcon commented 4 months ago

Ok, next time I will see this crash I will report to nimlangserver.