Shopify / Shopify/theme-tools

Rework `DocumentLinks` to use `@shopify/theme-graph`

Open
#968 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

area:language-server enhancement good first issue tech debt
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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.