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

feat: added ability to override mirai parsers and action_parsers. #81

Conversation

khanjasir90
Copy link
Contributor

Description

  1. Added a feature where users will able to override the existing parsers and action_parsers.
  2. This will provide better customization and flexibitlity.

Related Issues

Closes #17

Type of Change

  • New feature (non-breaking change which adds functionality)
  • Bug fix (non-breaking change which fixes an issue)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Code refactor
  • Build configuration change
  • Documentation
  • Chore

@divyanshub024
Copy link
Member

Hey @khanjasir90, The analyze check is failing due to an unused import. Please check it.

https://github.com/BuildMirai/mirai/actions/runs/12608379968/job/35142662480?pr=81

Copy link
Member

@divyanshub024 divyanshub024 left a comment

Choose a reason for hiding this comment

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

Thanks for this great work 🎉

Please check my suggestions.

@@ -16,24 +16,14 @@ class MiraiRegistry {

bool register(MiraiParser parser) {
Copy link
Member

Choose a reason for hiding this comment

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

@khanjasir90 Can we add an optional param called "bool override". And the parser will be overridden only of the value is true.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure, added the same @divyanshub024

return true;
}
_miraiActionParsers[type] = parser;
return true;
}

Future<dynamic> registerAll(List<MiraiParser> parsers) {
Copy link
Member

Choose a reason for hiding this comment

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

Also, please add the same logic to registerAll and registerAllActions functions.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Update the registerAll and update registerAllActions functions with the same logic

@divyanshub024
Copy link
Member

Hey @khanjasir90, There is some formatting issue. Can you please run dart format . in your branch?

Copy link
Member

@divyanshub024 divyanshub024 left a comment

Choose a reason for hiding this comment

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

Thanks for this amazing PR @khanjasir90 🥇

@divyanshub024 divyanshub024 merged commit 7e32dbb into StacDev:dev Jan 5, 2025
3 checks passed
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.

feat: Allow Override Widgets and Actions Registration
2 participants