Rework `DocumentLinks` to use `@shopify/theme-graph`
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 234
- Forks
- 92
- Avg merge
- 1d 3h
- Merged PRs (30d)
- 6
Description
Is your feature request related to a problem? Please describe.
Shopify/theme-graph allowed each file to be able to tell if it has a reference or dependency to another file.
Instead of explicitly looking through Liquid Tags and checking to see if it's a variable or liquid string, we can just underline all references in liquid files using theme-graph's reference.
File in question: https://github.com/Shopify/theme-tools/blob/main/packages/theme-language-server-common/src/documentLinks/DocumentLinksProvider.ts#L37-L50
- Refactor provider to include theme-graph
- Introduce document linking from Liquid schemas to blocks/sections it's referencing
- Introduce document linking from web components to the javascript file it's referencing
Describe the solution you'd like
- Ideally we can keep this file extremely minimal and only check the theme-graph for references and where it's located in the file
- Introduces schema level document linking (which currently doesn't exist)
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with packages/theme-language-server-common/src/documentLinks/DocumentLinksProvider.ts, especially lines 37-50, and review the linked theme-graph change. Trace how references are currently identified, then verify the intended document-link coverage for Liquid references, Liquid schemas to blocks or sections, and web components to JavaScript files.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- developer-experience, tooling
- Issue type
- Refactor
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100