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 initializationOptions in 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 initialize with the appropriate parameters and the user's project settings included in the initializationOptions (should document this on the wiki as well, since it is server-specific) for every project switch
  • Request an exit when the server should be closed completely

[1] https://github.com/Microsoft/language-server-protocol/blob/master/versions/protocol-2-x.md#initialize

Assignee Loading
Time tracking Loading