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 parsing + prettier support for @param in {% doc %} tags #646

Draft
wants to merge 1 commit into
base: main
Choose a base branch
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 3, 2024

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

@jamesmengo jamesmengo mentioned this pull request Dec 3, 2024
8 tasks
@jamesmengo jamesmengo force-pushed the jm/implement_fallbackNode branch from 4d4c72d to 92a1d96 Compare December 4, 2024 17:28
@jamesmengo jamesmengo force-pushed the jm/doc_param branch 2 times, most recently from 64f7dd8 to 944ecb4 Compare December 4, 2024 17:37
@jamesmengo jamesmengo force-pushed the jm/implement_fallbackNode branch from 92a1d96 to 10ded69 Compare December 4, 2024 19:36
@jamesmengo jamesmengo changed the base branch from jm/doc_param to jm/doc_tag December 4, 2024 19:36
@jamesmengo jamesmengo changed the title Implement fallbackNode for LiquidDoc Add parsing support for @param tags in LiquidDoc Dec 4, 2024
Base automatically changed from jm/doc_tag to main December 4, 2024 22:10
@jamesmengo jamesmengo force-pushed the jm/implement_fallbackNode branch from 10ded69 to 79f4c94 Compare December 5, 2024 00:56
@@ -402,7 +402,8 @@ function findCurrentNode(
case NodeTypes.TextNode:
case NodeTypes.LiquidLiteral:
case NodeTypes.String:
case NodeTypes.Number: {
case NodeTypes.Number:
case NodeTypes.LiquidDocParamNode: {
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 exists to appease CI for the moment - I foresee us revisiting this once we are implementing completions

@jamesmengo jamesmengo changed the title Add parsing support for @param tags in LiquidDoc Add basic parsing support for @param tags in LiquidDoc Dec 5, 2024
@@ -1103,7 +1109,7 @@ export function cstToAst(
}

function buildAst(
cst: LiquidHtmlCST | LiquidCST | ConcreteAttributeNode[],
cst: LiquidHtmlCST | LiquidCST | LiquidDocCST | ConcreteAttributeNode[],
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Should I just be adding this to LiquidHtmlCST ? My plan is to allow LiquidDocCST to evolve over time. I wanted to keep them separate as much as possible since LiquidDoc is kind of its own thing

cc: @charlespwd

Implement fallbackNode for LiquidDoc

Enhance Liquid HTML Parser: Introduce paramNode and update CST tests

- 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.

Introduce LiquidDocCST and LiquidDocConcrete

Add liquidDocParam handling to stage2 AST

- Updated the `toLiquidDocAST` function to include handling for `@param` syntax and fallback text node

Prettier - Add CSS Handling

Enhance LiquidCompletionParams: Add handling for LiquidDocParamNode in LiquidCompletionParams

Add LiquidCST to union of LiquidHTMLCST types

Add LiquidDocParamNode case to print function

Add basic prettier support for doc tag
@jamesmengo jamesmengo force-pushed the jm/implement_fallbackNode branch from 68227c4 to e7ed99d Compare December 11, 2024 00:42
@jamesmengo jamesmengo changed the title Add basic parsing support for @param tags in LiquidDoc Add basic parsing + prettier support for LiquidDoc param tag Dec 11, 2024
@jamesmengo jamesmengo changed the title Add basic parsing + prettier support for LiquidDoc param tag Add parsing + prettier support for @param in {% doc %} tags 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.

1 participant