Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upExtensions for PiranhaJava #28
Comments
|
@sivacoder @mkruber Currently, it takes a look at a) If Fixing (3) will require adding info to the config format, namely changing from "list of methods" to "list of method, arg# pair" (see #6). Right now I am not sure how involved that will be. Finally, (4) is a bit more involved, it might be a limited instance of deep clean, which is not currently part of PiranhaJava. I'd say (1)/(a) above is good first PR. |
|
For b), I think there should be some way to get the Then from the right-hand side of the declaration, you could use code like this to get the constant value: At least I think that should work. |
|
@manishamishra2715 - This ticket is to discuss new extensions support. Is it fair for you to create a separate ticket and discuss this issue rather than polluting this one? It's easier to report, trace, fix, and for other who will face the same issue to search and find. Hopefully, it makes sense. |
|
@lazaroclapp @mkruber @msridhar - For #1 and #2, we have raised this PR - #30 Please review |
|
@mkruber @lazaroclapp @msridhar - Can you help with the next steps for #3 and #4 extensions? |
|
I assume you are referring to 3 and 4 above. The links pointed in the comment refer to different issues. For issue 3, I propose deleting the checks for argument count here. This still assumes that the first argument is the flag name. If you want to extend this further where flag name can be at any index, you will have to update the For issue 4, there are many ways of handling it. It will require two passes. In the first pass, remember all assignments where the RHS contains the flag API expression and the result of the RHS. In the second pass, delete these assignment expressions and where ever the fully qualified name of the LHS occurs (for local variables, maybe you can use the Class name + methodname + variable name) to determine the FQN) and evaluate expressions. This change will be involved -- so propose that this be handled in a separate PR. You can take a look at the deepclean pass of PiranhaSwift for the general strategy. |
Following up on issue 25, the following extensions were requested by @sivacoder:
Filing this issue to continue the discussions here.