-
Notifications
You must be signed in to change notification settings - Fork 58
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
Minor code cleanup #998
Minor code cleanup #998
Conversation
...eclipse.lsp4e/src/org/eclipse/lsp4e/operations/hover/FocusableBrowserInformationControl.java
Show resolved
Hide resolved
...eclipse.lsp4e/src/org/eclipse/lsp4e/operations/hover/FocusableBrowserInformationControl.java
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would it be good to add the analysis tools that you used to our verify jobs? Which ones did you use?
Also, I think you have converted some classes to lambdas. We could adapt the configuration of the JDT for our plugins, so that the editor does that on save. Would it be good to do it?
If you think so, I could lookup how to do that.
*/ | ||
protected abstract SelectionRangeHandler.Direction getDirection(); | ||
} | ||
/******************************************************************************* |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What did change in this file? Line endings?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In this class an anonymous inner class was replaced by a shorter lambda, see 3075595
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, looks like the line endings changed too as part of 6f33fc4. So it probably was with Windows line endings committed to git before. To avoid this, we have a .gitattributes file in tm4e https://github.com/eclipse/tm4e/blob/main/.gitattributes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the explanation.
We could have it also for LSP4E, I do not have a strong opinion for or against it.
@mickaelistria , do you have an opinion?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can prepare a PR where I normalize the line endings of all files in the repo and add the gitattributes file, similar to how I did it for tm4e.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That sounds great to me.
org.eclipse.lsp4e/src/org/eclipse/lsp4e/outline/LSSymbolsContentProvider.java
Show resolved
Hide resolved
I know that @mickaelistria is not a big fan of adding more "compliance" tools to the build process as from his view it prevents people from contributing. I think there are probably some checks worthy to be checked automatically, esp. that influence security, stability and performance. I personally would also like to have a check that ensures the source code is formatted using the configured Eclipse formatter profile as it is super annoying that currently each file is a unicorn and when I use the code formatter dozens of lines not related to my code changes get modified.
I used strict eclipse compiler settings, sonarlint and ucdetector. in other projects I also use checkstyle.
Before introducing automatic save actions we would need to run them once across the whole code base in a single commit as otherwise every time you edit a file code unintentionally may changed that is not related to what you are currently modifying. So we should have an Eclipse cleanup profile that is in sync with enabled Save Actions. |
I'm not against tools/configuration adding recommendation in the workspace or in some build report, I just want to avoid that a contribution gets delayed or even abandoned by its contributor because of recommendations becoming constraints during review and then putting to bar often too high for newcomers. |
That might not be needed. The project is not so big and usually the refactors are easy to recognize, so adapting the files next time they are touched would be fine for me (of course cleaning up is also fine). In any case , we do not need to it know, it is just that since where doing some of these refactors that the JDT can do, I wondered if you would like to just add the preference (and eventually run the cleanup). |
This PR fixes a few minor issues detected using static code analysis tools.