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

Add basic prettier support for doc tag #652

Closed
wants to merge 10 commits into from

Conversation

jamesmengo
Copy link
Contributor

What are you adding in this PR?

What's next? Any followup issues?

What did you learn?

Before you deploy

  • This PR includes a new checks or changes the configuration of a check
    • I included a minor bump changeset
    • It's in the allChecks array in src/checks/index.ts
    • I ran yarn build and committed the updated configuration files
      • If applicable, I've updated the theme-app-extension.yml config
  • I included a minor bump changeset
  • My feature is backward compatible
  • I included a patch bump changeset

Copy link
Contributor Author

jamesmengo commented Dec 5, 2024

Warning

This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
Learn more

This stack of pull requests is managed by Graphite. Learn more about stacking.

// One of the benefits of leaving it here is that we can use the indentation and other logic from the raw markup.
// The benefit of doing it in LiquidRawTag is that we can keep the logic for doc separate
// I still want to understand how embeddings would work in this scenario. Maybe that's a complete different approach that we could take.
return [indent([hardline, body]), hardline];
Copy link
Contributor

Choose a reason for hiding this comment

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

LiquidRawTag exists mostly because we want to paste the body back as it was ("raw"). So body here is actually just a string and not a "recursive call to print". This is why the asdf thing at the bottom never gets called. You need to do some kind of path.call(p => print(p), 'children') to make it recursive.

Add doc param tag
- Added `paramNode` to the grammar for LiquidDoc, allowing for parameter definitions in doc tags.
- Updated the parsing logic to recognize and handle `@param` syntax correctly.
- Modified CST tests to validate the new structure, ensuring proper identification of `LiquidDocParamNode` and associated text nodes.
- Refactored existing tests to align with the new parsing rules and improve accuracy.
- Updated the `toLiquidDocAST` function to include handling for `@param` syntax and fallback text node
@jamesmengo jamesmengo force-pushed the jm/implement_fallbackNode branch from 1a1108a to 68227c4 Compare December 11, 2024 00:29
@jamesmengo jamesmengo force-pushed the jm/basic_prettier_support branch from d4803fa to 0f17fef Compare December 11, 2024 00:29
@jamesmengo jamesmengo force-pushed the jm/implement_fallbackNode branch from 68227c4 to e7ed99d Compare December 11, 2024 00:42
@jamesmengo jamesmengo closed this Dec 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants