-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Parsing + Prettier support for {% doc %} open and close tags
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
- Loading branch information
1 parent
026da63
commit e7ed99d
Showing
13 changed files
with
135 additions
and
29 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
9 changes: 9 additions & 0 deletions
9
packages/prettier-plugin-liquid/src/test/liquid-doc/fixed.liquid
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
It should indent the body | ||
{% doc %} | ||
@param body | ||
{% enddoc %} | ||
|
||
It should not dedent to root | ||
{% doc %} | ||
@param body | ||
{% enddoc %} |
9 changes: 9 additions & 0 deletions
9
packages/prettier-plugin-liquid/src/test/liquid-doc/index.liquid
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
It should indent the body | ||
{% doc %} | ||
@param body | ||
{% enddoc %} | ||
|
||
It should not dedent to root | ||
{% doc %} | ||
@param body | ||
{% enddoc %} |
7 changes: 7 additions & 0 deletions
7
packages/prettier-plugin-liquid/src/test/liquid-doc/index.spec.ts
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import { test } from 'vitest'; | ||
import { assertFormattedEqualsFixed } from '../test-helpers'; | ||
import * as path from 'path'; | ||
|
||
test('Unit: liquid-doc', async () => { | ||
await assertFormattedEqualsFixed(__dirname); | ||
}); |
This file contains 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