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

Add section & block schema registries for use in the language server and theme checks #572

Open
charlespwd opened this issue Nov 7, 2024 · 0 comments
Assignees
Labels

Comments

@charlespwd
Copy link
Contributor

charlespwd commented Nov 7, 2024

Describe the solution you'd like
I want folks to be able to easily build other features as though all the schemas of all the files were available at any time in a very performant way.

In checks:

const schema = await context.getSectionSchema('main-product');
const schema = await context.getBlockSchema('slide');

In the language server

const rootUri = await findRootUri(textDocument.uri);
const registry = SchemaRegistryManager.get(rootUri);
const schema = await registry.getSectionSchema('main-product');
const schema = await registry.getBlockSchema('slide');

Under the hood:

  • Should only update itself if the file changes (parse only once)
  • Should work for unopened files
  • Should be lazy (?) tbd...

cc @miazbikowski @albchu

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant