graphql / graphql/graphiql

Refactor LSP to enable remote schema invalidation

Open
#3,541 0 comments 0 reactions 0 assignees View on GitHub
lsp-rewrite lsp-server
Dominant language
TypeScript
Stars
16.9k
Forks
1.9k
Avg merge
22h 45m
Merged PRs (30d)
70

Description

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` to `GraphQLCache` (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` to `GraphQLCache` - 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` in `MessageProcessor` should be migrated to/merged with `GraphQLCache`'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!

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.