Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor LSP to enable remote schema invalidation #3541

Open
3 tasks
acao opened this issue Mar 1, 2024 · 0 comments
Open
3 tasks

Refactor LSP to enable remote schema invalidation #3541

acao opened this issue Mar 1, 2024 · 0 comments
Labels
lsp-rewrite lsp-server graphql-language-service-server

Comments

@acao
Copy link
Member

acao commented Mar 1, 2024

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!

@acao acao added lsp-rewrite lsp-server graphql-language-service-server labels Mar 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lsp-rewrite lsp-server graphql-language-service-server
Projects
None yet
Development

No branches or pull requests

1 participant