fix(vscode): language server error when formatting models with Unsupported fields#1558
fix(vscode): language server error when formatting models with Unsupported fields#1558
Unsupported fields#1558Conversation
WalkthroughWalkthroughThe Changes
Sequence Diagram(s)The following Mermaid diagram illustrates the updated sequence for handling a field with the sequenceDiagram
participant Client
participant Formatter
participant ASTNode
Client->>Formatter: Format ASTNode
Formatter->>ASTNode: Get field type
ASTNode-->>Formatter: Unsupported("foo")
Formatter->>Formatter: Compute length for Unsupported type
Formatter-->>Client: Formatted ASTNode
Assessment against linked issues
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
There was a problem hiding this comment.
Actionable comments posted: 0
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (2)
- packages/schema/src/language-server/zmodel-formatter.ts (1 hunks)
- tests/integration/tests/cli/format.test.ts (4 hunks)
Additional comments not posted (3)
tests/integration/tests/cli/format.test.ts (2)
25-25: LGTM!The test case correctly includes the
Unsupportedfield and verifies the formatted output.Also applies to: 38-38
52-52: LGTM!The test case correctly includes the
Unsupportedfield and verifies the formatted output with Prisma style.Also applies to: 63-63, 65-65
packages/schema/src/language-server/zmodel-formatter.ts (1)
108-120: LGTM!The method correctly handles unsupported field types and integrates well with the existing logic.
Fixes #1517