Fix section rename updates for settings_data#1207
Open
omribz156 wants to merge 1 commit into
Open
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 are you adding in this PR?
Fixes #713.
When a section file is renamed, the language server already updates references in template JSON files, section group JSON files, and
{% section %}tags. This adds the same focused rename behavior forconfig/settings_data.json, updating onlycurrent.sections[*].typevalues that match the renamed section.I also added coverage to the existing section rename handler spec and included the required patch changeset.
What's next? Any followup issues?
Nothing from this patch. It intentionally does not rename block references inside
settings_data.json; the maintainer note on the issue asked to update only the sectiontypeattribute.What did you learn?
The rename flow already had a nice split between template, section group, and Liquid tag edits, so
settings_data.jsoncould be added as one more JSON source without changing the broader rename behavior.Tophatting
Not applicable; language server rename behavior.
Verification:
yarn workspace @shopify/liquid-html-parser buildyarn workspace @shopify/theme-check-common buildyarn workspace @shopify/theme-language-server-common buildyarn vitest run packages/theme-language-server-common/src/renamed/handlers/SectionRenameHandler.spec.tsyarn workspace @shopify/theme-language-server-common type-checkNote:
yarn install --frozen-lockfileinitially failed on Windows because thetheme-check-vscodepostinstall script callssh scripts/fetch-syntaxes.sh; after dependencies were linked, building the needed workspaces allowed the targeted test/type-check path to run.This was implemented with Codex assistance and manually reviewed before opening the PR.
Before you deploy
changeset