Skip to content

feat: add registry-driven extension parsing and formatting#40

Merged
wackywendell merged 11 commits intomainfrom
extensions
Feb 24, 2026
Merged

feat: add registry-driven extension parsing and formatting#40
wackywendell merged 11 commits intomainfrom
extensions

Conversation

@wackywendell
Copy link
Copy Markdown
Collaborator

@wackywendell wackywendell commented Nov 14, 2025

Description

  • Introduce a registry-backed extension model (ExtensionArgs, ExtensionValue, Any) so parser and formatter can translate extension relations to typed protobuf payloads.
  • Extend the parser grammar, relation context, and error types to consume extension relations, including a new ParseError::ExtensionDetail for registry failures.
  • Teach textification, fixtures, examples, and roundtrip tests to format custom extensions via the registry and ensure the new flows stay covered.

Type of Change

  • Bug fix
  • New feature
  • Documentation update
  • Example update
  • Other (please describe)

Testing

  • Added tests for new functionality
  • All existing tests pass
  • Ran examples to verify behavior

Checklist

  • Code follows Rust conventions
  • Documentation updated if needed
  • No breaking changes (or breaking changes documented)
  • Pre-commit hooks pass

Related Issues

Closes #32

@wackywendell
Copy link
Copy Markdown
Collaborator Author

@codex review

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/extensions/args.rs
@wackywendell wackywendell force-pushed the extensions branch 2 times, most recently from 1f17b29 to fe7a50d Compare November 24, 2025 20:04
@wackywendell wackywendell marked this pull request as ready for review January 6, 2026 19:24
@wackywendell wackywendell requested a review from a team as a code owner January 6, 2026 19:24
@wackywendell
Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector
Copy link
Copy Markdown

To use Codex here, create a Codex account and connect to github.

@gord02
Copy link
Copy Markdown
Collaborator

gord02 commented Feb 18, 2026

@codex review

@gord02
Copy link
Copy Markdown
Collaborator

gord02 commented Feb 18, 2026

@cursor review

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 062efe0d0b

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread src/parser/extensions.rs
Comment on lines +360 to +363
Rule::expression => {
// TODO: Handle expressions properly when ExtensionColumn::Expression is implemented
unimplemented!("Expression handling in ExtensionColumn not yet implemented")
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Replace expression-column panic with parse error

The grammar allows expression in extension_column (see src/parser/expression_grammar.pest), but this branch calls unimplemented!, so a valid plan containing an expression output column will panic the parser instead of returning a ParseError. This is a runtime crash path for user-supplied input; the branch should return a structured parse error (or support an expression column variant) rather than aborting.

Useful? React with 👍 / 👎.

Comment thread src/parser/extensions.rs Outdated
Comment thread src/textify/extensions.rs Outdated
Adds support for custom extension relations in the parser and textify system.
Includes extension registry, Any encoding/decoding, and conversion utilities.
Enhances linting, adds test coverage, and completes extension relation
refactoring with improved textify support.
wackywendell added a commit that referenced this pull request Feb 24, 2026
…literals

Address PR #40 review comments:
- Replace unimplemented!() panic in ExtensionColumn expression parsing
  with Expression(RawExpression) variant
- Replace silent string coercion of expression arguments with proper
  Expression variant (no more data loss on round-trip)
- Escape string literals in ExtensionValue::Textify using escaped()
- Remove dead From<&ExtensionValue> for Value impl
Centralizes relation parsing context, cleans clippy warnings, and simplifies
the Parser API to enforce hard errors for extension parsing.
Moves name() into Explainable trait, simplifies Any/AnyConvertible,
cleans up extension errors, and improves examples with ErrorList usage.
Simplifies trait bounds and Any implementation, removes debug prints,
simplifies main.rs, enables cli feature by default, and cleans up
extension naming.
Introduces ArgsExtractor for easier argument validation and simplifies
the extension args API with expect_named_arg and get_named_or helpers.
Add comprehensive documentation for the custom extension type system:

- Document the three requirements: prost::Message, prost::Name, Explainable
- Document the Explainable trait and ArgsExtractor helpers
- Add a compilable code example using the ExtensionRegistry
- Reference examples/extensions.rs for complete implementation
- Update GRAMMAR.md with Extension Relations section
…literals

Address PR #40 review comments:
- Replace unimplemented!() panic in ExtensionColumn expression parsing
  with Expression(RawExpression) variant
- Replace silent string coercion of expression arguments with proper
  Expression variant (no more data loss on round-trip)
- Escape string literals in ExtensionValue::Textify using escaped()
- Remove dead From<&ExtensionValue> for Value impl
@wackywendell wackywendell merged commit 5f759a1 into main Feb 24, 2026
2 checks passed
@wackywendell wackywendell deleted the extensions branch February 24, 2026 17:26
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.

Implement Extension relations (ExtensionLeaf, ExtensionSingle, ExtensionMulti)

2 participants