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

Write to cutomized file during DartFix #185

Open
matthiaslarisch opened this issue Sep 7, 2023 · 4 comments
Open

Write to cutomized file during DartFix #185

matthiaslarisch opened this issue Sep 7, 2023 · 4 comments
Assignees
Labels
enhancement New feature or request

Comments

@matthiaslarisch
Copy link

We need to be able to write to cutomized files when a QuickFix is performed.
For that reason we did a fork and added a parameter named "String? customPath" to the "addGenericFileEdit" from abstract class "ChangeBuilder".
The implementation of the method "addGenericFileEdit" looks like this:
@override void addGenericFileEdit( void Function(analyzer_plugin.FileEditBuilder builder) buildFileEdit, { String? customPath, }) { _operations.add( _innerChangeBuilder.addGenericFileEdit(customPath ?? path, buildFileEdit), ); }

Would it be possible to generally allow writing to customized files.

@matthiaslarisch matthiaslarisch added the enhancement New feature or request label Sep 7, 2023
@rrousselGit
Copy link
Collaborator

For what reason do you need this?

@matthiaslarisch
Copy link
Author

We have a rule that is searching for StringLiterals used e.g. in Text widget and a DartFix which replaces them with our own translation implementation and for this translation implementation we need to write data to a properties file.
For that reason I already tried what I proposed in the previous note and this is working perfectly fine.
If you want I can do a pull request with my proposal.

@rrousselGit
Copy link
Collaborator

I'm not sure if addGenericFileEdit is the right place, but sure

@Mike278
Copy link

Mike278 commented Sep 15, 2023

I also have this exact same use case

@rrousselGit rrousselGit linked a pull request Sep 18, 2023 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants