Refactor LSP to enable remote schema invalidation
acao opened this issue · comments
Refactor in this case is referring to the highest level interface of the LSP server - the LSP protocol server itself. Perhaps we will make sure runServer
is still 100% in parity as well. But MessageProcessor
and anything inside the GraphQLLanguageService
and GraphQLCache
could change completely.
The MessageProcessor
class has grown unwieldy, taking on responsibilities beyond it's duty that would make more sense for GraphQLCache
to own, and in some cases even duplicating the file cache to some degree.
- All methods related to cacheing code-first schemas need to be migrated from
MessageProcessor
toGraphQLCache
(so that it can make this part of the schema cache lifecycle, thus more up-to-date generated schema files!) - All methods related to loading config and cacheing files should also be migrated from
MessageProcessor
toGraphQLCache
- it makes more sense for the cache class to own this lifecycle, and it will make it easier to handle cache invalidation across code first and schema first scenarios. - The
_textDocumentCache
inMessageProcessor
should be migrated to/merged withGraphQLCache
's file cache
Before we begin this we refactor, we will wait for #3521 to be merged, so that we have a high quality test plane from which to detect regressions.
Then, we can fix the code first schema invalidation scenario!