theme-language-server-common: support go-to-definition for Liquid file references#1140
Open
RomainDW wants to merge 1 commit intoShopify:mainfrom
Open
theme-language-server-common: support go-to-definition for Liquid file references#1140RomainDW wants to merge 1 commit intoShopify:mainfrom
RomainDW wants to merge 1 commit intoShopify:mainfrom
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Add
textDocument/definitionsupport for Liquid file references by reusing document-link targets.Supported references:
{% render 'snippet' %}/{% include 'snippet' %}->snippets/<name>.liquid{% section 'name' %}->sections/<name>.liquid{{ 'file.ext' | asset_url }}->assets/<file.ext>{% content_for 'block', type: 'name' %}->blocks/<name>.liquidWhy
Today these references are available through
documentLinkbut not throughdefinition, so cmd/ctrl+click go-to-definition does not work in editors that usetextDocument/definition.How
DocumentLinksDefinitionProviderthat:LocationLinkfor that targetDefinitionProviderfindThemeRootURIintoDefinitionProviderfromstartServerTests
Added
DocumentLinksDefinitionProvider.spec.tscovering:nullExecuted locally:
CI=1 corepack yarn test \ packages/theme-language-server-common/src/definitions/providers/DocumentLinksDefinitionProvider.spec.ts \ packages/theme-language-server-common/src/definitions/providers/TranslationStringDefinitionProvider.spec.ts \ packages/theme-language-server-common/src/definitions/providers/SchemaTranslationStringDefinitionProvider.spec.tsResult: 3 files passed, 6 tests passed.
Closes #1139