dhall-lang / vscode-dhall-lsp-server

VSCode pluging that provides LSP support for the Dhall programming language
MIT License
17 stars 8 forks source link

"The server process has timed out" upon opening VS Code with a Dhall file open #18

Open SiriusStarr opened 4 years ago

SiriusStarr commented 4 years ago

If I open VS Code (from the program being closed), switch to a new workspace, reload the window, etc. (i.e. do anything that loads extensions) with a Dhall file as the open tab, the extension fails to load with the message The server process has timed out. In order to then actually have the language server functional, one has to do any of the above things (close and reopen, reload the window, etc.) with a non-Dhall file as the open tab (or nothing open).

If VS Code loads fully without trying to activate the extension, opening any Dhall file causes it to load just fine and work normally.

This may be more a VS Code issue (slow extension loading?) than something actually wrong with this extension, but it's extremely annoying, since one tends to have a Dhall file open when switching back to a project.

No relevant messages of any kind that I can find, but if someone has suggestions for how to generate a more useful debugging message, I am all ears. The only messages I can find whatsoever are the normal extension host loading messages, i.e.

[2019-12-22 14:59:07.172] [exthost] [info] ExtensionService#_doActivateExtension panaeon.vscode-dhall-lsp-server {"startup":false,"extensionId":{"value":"panaeon.vscode-dhall-lsp-server","_lower":"panaeon.vscode-dhall-lsp-server"},"activationEvent":"onLanguage:dhall"}
[2019-12-22 14:59:07.172] [exthost] [info] ExtensionService#loadCommonJSModule file:///home/user/.vscode/extensions/panaeon.vscode-dhall-lsp-server-0.0.4/out/extension.js

(It should be noted that this occurs for me regardless of the Dhall file in question. Very simple or very complex, valid or invalid, any file that causes the extension to activate will cause this to occur.)

arobertn commented 3 years ago

The issue traces down to the obtainExecutableStatus() function in extension.ts. There are hardcoded 2- and 1-second timeouts. Aside from the 2 never being able to have any effect with the 1 there, it would be best if these were configurable or at least higher (say, 10-15 seconds) since entering a dhall file while VS Code is starting up can cause quite a delay.