Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Summary: Our goal is for Flow to speak LSP natively. `flow lsp` will launch an "LSP adapter". The purpose of this LSP adapter is primarily just to manage the lifetime and connection status of the Flow server. Most LSP servers just spin up when needed, and close when needed. But Flow and Hack are different: they are singleton persistent services. So when an editor like Nuclide invokes `flow lsp`, it will launch the adapter process and speak LSP to it over stdin/stdout. The adapter process will start up a flow server if necessary, or connect to an existing one if there. It will (in a future diff) forward LSP requests to that server, and forward the responses back to the client. If ever the flow server exits (as is normal in a rebase\! or if the user types commands at the command-line) then the LSP adapter process continues to run. It will offer the user a button to click to restart the flow server, or restart it automatically. It will monitor whether the server is running, and reconnect to it as soon as it is running. I had wanted to write `flow lsp` just as a really thin layer which basically did nothing other than forwarding LSP messages to the server. But because it has to monitor the status of the server, and clean up + restart nicely in the event of the server going down, that makes it a more heavyweight layer. In future diffs I'll add the actual forwarding of messages to the server. Haven't got there yet. Reviewed By: gabelevi Differential Revision: D6508165 fbshipit-source-id: 46cb378534c9798c2b0647b51e5563801bdb8092
- Loading branch information