TechnionYP5777 / Leonidas-FTW

Leonidas FTW
7 stars 1 forks source link

Make SpartanizerUtils.java unspartanizable #64

Closed michalcohen closed 7 years ago

michalcohen commented 7 years ago

@orenafek sujested including file for the user convenient that will state the exculded files from spartanization. Another option is to work with the IDE somehow and insert the the right click menu of a file "don't spartanize" option. Write in this issue what is the prefered way.

amirsagiv83 commented 7 years ago

I think the final solution for this will be through the GUI part we are planning for next semester. Question is, how will it be implemented? maybe for now a good idea will be to just leave it on hold until we start thinking about levels of spartanization, GUI, and and similar things we will need to take care of after building a working prototype that uses Leonidas. What do you think?


@michalcohen , Someone has to be assigned to this so I'm assigning you, only for completeness... I'm tagging all of you so no one misses this. please leave a comment stating your opinion. @orenafek @AnnaBel7 @RoeyMaor @RoeiRaz

michalcohen commented 7 years ago

I think it is still a good idea, just for now, to make the specific file "SpartanizerUtils.java" unspartanizable, as spartanizing the SpartanizerUtils is an undefined behaviour . I can search for a fast and convenient way to do that this week. What do you say?

amirsagiv83 commented 7 years ago

If you find an easy solution then it's great! I just don't think we should spend a lot of time trying to fix it right now, considering we will need to think about the best way of doing that in the future for the features we're planning on. Update us if you find a nice solution 😄

michalcohen commented 7 years ago

A button name "Enable Spartanization" (or "Disable Spartanization") was added to "Refactor" menu. The only problem is with instant update of the annotations of the spartanizer. I tried everything: refreshing the file, manually updating it's time-stamp, using "DefaultHighlightVisitorBasedInspection" to manually call the annotator and many other approaches and combinations - nothing works... The spartanize action does follow the chosen state, it only takes one char changed for the annotator to be updated as well. As I have no suitable solution, I'm putting this issue on hold, and gladly will continue working on it once other group members will find time to help...

amirsagiv83 commented 7 years ago

I tried to see if there is a way to disable inspections of code in IntelliJ, and it turns out that inspections work through inspection profiles. From what I understand you can disable or enable inspections in some different ways. I didn't have much time to investigate it, but I'll try to see if I have a lead as soon as possible. @michalcohen

amirsagiv83 commented 7 years ago

There is a possibility that we are not working correctly with the IntelliJ. We have to try and investigate how to work with inspections properly. http://www.jetbrains.org/intellij/sdk/docs/tutorials/code_inspections.html I'll try to work on it when I have time, you are all welcome to try. Worst case, we will deal with it next semester!

michalcohen commented 7 years ago

Ok, I dug a little bit and found that all that time the action was never called at all! we used only the annotator! even when pressing alt + enter and seeing an intention like action, it was not the SpartanizerAction, but the annotator! (Is it a surprise just for me?) So I managed to create an intention according to this project: https://github.com/edvin/tornadofx-idea-plugin But now when remove the annotator in order to use only the intention, nothing is suggested. There is more to investigate here, but for now it seems that if we want our code to have this "zig zag" feature given by the annotator - we get an action inside of it that can not be removed.

michalcohen commented 7 years ago

done!!! I was never happier to close an issue!!! thank you, @amirsagiv83 and @AnnaBel7 for your support!