Revise project switching flow for Language Server Protocol (initialize, shutdown and exit commands)
We already have an Initialize command, so we should probably temporarily choose another name, until we implement #91 (closed) and drop non-LSP-compliant commands.
Currently the Atom base package (client) handles initializing a project, setting the correct database path, and finally requesting an index for the appropriate folders. All of this will move to the core and be handled by this new command. It will:
- Switch the active database to the appropriate one
- Remember/store the
initializationOptionsin a registry or manager somewhere, so it can be used inside the core - Automatically handle upgrading the database if it is outdated (
TestCommand) - Schedule indexing the stubs (#153 (closed) is related), if they haven't been initialized yet
- Schedule indexing the project folders specified in the
initializationOptions - Schedule a prune for the index
The client should:
- Start the server, if it isn't running yet
- Request a
shutdown, if a project is already active - Request an
initializewith the appropriate parameters and the user's project settings included in theinitializationOptions(should document this on the wiki as well, since it is server-specific) for every project switch - Request an
exitwhen the server should be closed completely