Skip to content

feat: add support for flow config fields in liquid lsp#1141

Draft
Gasser-Aly wants to merge 1 commit intomainfrom
03-05-feat_add_support_for_flow_config_fields_in_liquid_lsp
Draft

feat: add support for flow config fields in liquid lsp#1141
Gasser-Aly wants to merge 1 commit intomainfrom
03-05-feat_add_support_for_flow_config_fields_in_liquid_lsp

Conversation

@Gasser-Aly
Copy link

@Gasser-Aly Gasser-Aly commented Mar 5, 2026

What are you adding in this PR?

This PR adds support for URI-scoped object definitions in the theme language server. The implementation allows objects to be registered and retrieved on a per-URI basis, enabling more granular control over which objects are available in different contexts.

The key changes include:

  • Added getObjectsForURI method to the ThemeDocset interface as an optional method
  • Implemented URI-based object storage in AugmentedThemeDocset with both exact and prefix matching capabilities
  • Modified the UndefinedObject check to use URI-specific objects when available
  • Updated the TypeSystem to consider URI context when building object maps and symbol tables
  • Added a new SetObjectsNotification to allow clients to register objects for specific URIs
  • Removed memoization from object-related methods that now depend on URI context

This enables different files or paths to have different sets of available objects, which is useful for context-specific Liquid environments.

What's next? Any followup issues?

The implementation provides the foundation for URI-scoped objects. Follow-up work might include:

  • Documentation on how to use the new URI-scoped object functionality
  • Testing with real-world scenarios to validate the prefix matching behavior
  • Potential performance optimizations if the object lookup becomes a bottleneck

What did you learn?

The prefix matching implementation allows for flexible URI-based scoping where you can register objects for a base path and have them apply to all files within that path hierarchy. This provides a good balance between specificity and maintainability.

Copy link
Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant