Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[LiquidDoc] Formatting support for optional @param delimiters [] #734

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

jamesmengo
Copy link
Contributor

@jamesmengo jamesmengo commented Jan 25, 2025

What are you adding in this PR?

Part of https://github.com/Shopify/developer-tools-team/issues/525

Adds prettier support for LiquidDoc parameters with optional params, indicated by wrapping the param name in []

Cursor -  Extension Development Host  product-variant-picker liquid — jm-theme

What's next? Any followup issues?

#735

Before you deploy

  • I included a minor bump changeset
  • My feature is backward compatible

@jamesmengo jamesmengo changed the title Add optional param delimiters to liquid doc printer [LiquidDoc] Formatting support for optional @param delimiters [] Jan 25, 2025
@jamesmengo jamesmengo marked this pull request as ready for review January 25, 2025 00:19
@jamesmengo jamesmengo marked this pull request as draft January 25, 2025 00:19
@jamesmengo jamesmengo force-pushed the jm/prettier_opt_param branch from a07c1e9 to 40ad9c4 Compare January 25, 2025 00:21
@jamesmengo jamesmengo force-pushed the jm/parse_optional_params branch from 720b222 to 31d1bd9 Compare January 27, 2025 17:15
@jamesmengo jamesmengo force-pushed the jm/prettier_opt_param branch from 40ad9c4 to 299b434 Compare January 27, 2025 17:15
@jamesmengo jamesmengo force-pushed the jm/parse_optional_params branch 2 times, most recently from a62068b to 5426ddb Compare January 27, 2025 17:54
@jamesmengo jamesmengo force-pushed the jm/prettier_opt_param branch from 299b434 to 35d7e8f Compare January 27, 2025 17:54
@jamesmengo jamesmengo force-pushed the jm/parse_optional_params branch from 5426ddb to dcb46c0 Compare January 27, 2025 20:36
@jamesmengo jamesmengo force-pushed the jm/prettier_opt_param branch from 35d7e8f to 2d086a3 Compare January 27, 2025 20:36
@jamesmengo jamesmengo added the #gsd:44310 LiquidDoc label Jan 27, 2025 — with Graphite App
@jamesmengo jamesmengo force-pushed the jm/parse_optional_params branch 3 times, most recently from 03f0a91 to 0387935 Compare January 28, 2025 01:32
@jamesmengo jamesmengo force-pushed the jm/prettier_opt_param branch from 2d086a3 to 9acae35 Compare January 28, 2025 01:38
@jamesmengo jamesmengo force-pushed the jm/parse_optional_params branch 2 times, most recently from e91db5d to 374d89f Compare January 28, 2025 01:45
@jamesmengo jamesmengo force-pushed the jm/prettier_opt_param branch from 9acae35 to 3c791ea Compare January 28, 2025 01:46
@jamesmengo jamesmengo force-pushed the jm/prettier_opt_param branch from 3c791ea to 7038766 Compare February 4, 2025 03:16
@jamesmengo jamesmengo changed the base branch from jm/parse_optional_params to jm/parse_optional_param_with_default February 4, 2025 03:19
@jamesmengo jamesmengo changed the base branch from jm/parse_optional_param_with_default to main February 4, 2025 22:02
@jamesmengo jamesmengo force-pushed the jm/prettier_opt_param branch 3 times, most recently from dd32d08 to e0d3790 Compare February 4, 2025 22:20
@@ -520,8 +520,10 @@ export function printLiquidDocParam(
parts.push(' ', `{${node.paramType.value}}`);
}

if (node.paramName.value) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is always true, so I'm just removing this

@@ -19,6 +19,7 @@ It should format the param description with a dash separator
{% enddoc %}

It should respect the liquidDocParamDash option liquidDocParamDash: false
liquidDocParamDash: false
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixing a test - this got removed at some point

@jamesmengo jamesmengo force-pushed the jm/prettier_opt_param branch 3 times, most recently from 55ca388 to c085ac9 Compare February 4, 2025 22:55
----
- Preserve `[]` delimiters
- Strips whitespace between delimiter and param name
@jamesmengo jamesmengo force-pushed the jm/prettier_opt_param branch from c085ac9 to 357feaa Compare February 4, 2025 22:56
@jamesmengo jamesmengo marked this pull request as ready for review February 4, 2025 23:03
@jamesmengo jamesmengo requested a review from a team as a code owner February 4, 2025 23:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
#gsd:44310 LiquidDoc
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant