-
Notifications
You must be signed in to change notification settings - Fork 385
Add VS Code settings and update Makefile #80
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
Conversation
|
Updated with a settings file dedicated for handout. |
|
The |
|
That is understandable concern. I have removed the Notice that currently IDE would still report that almost all methods as unused in solution template. This hinders identifying actual unused methods (and quite annoying). One possible fix would be changing the visibility of all methods that are accessed through reflection. Do you think that is an acceptable approach? If so I will open another PR for that. |
| @@ -0,0 +1,6 @@ | |||
| { | |||
| "recommendations": [ | |||
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.
These don't automatically install then, right? redhat.java seems fine but I don't love installing for students some plugin maintained by a random guy.
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.
No it just trigger a popup on the corner like this

I agree that install unpopular extension is concerned, but it's the most efficient (and probably the minimal) way to prevent hitting formatting document shortcut to mess up the template's format (because redhat extension format the code differently from google-java-format, and there's no way to configure it to match the style).
There are multiple VS Code extensions that integrate google-java-format to VS Code, I tried some and found this one is the most recent one and works fine.
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.
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.
And the student can always opt-out formatting through VS Code at all and run make format directly.
|
Thanks! Are the dead code warnings noisy/do they get in the way of other warnings? I'm not super concerned about students dealing with dead code warnings in general. (I typically only look at dead code warnings in particular just before submission, as during development, you naturally have lots of dead code.) It is an unfortunate side-effect of the message/timer delivery reflection magic. |
|
In an empty solution template there are around 20 dead code warnings because of reflection. Well it's probably "tolerable" annoying. Just I personally follow "treat warnings as errors" rule :) It's fine for me to leave it as is. |
|
Ack, thanks! I guess the other solution is to change (and force) all of the message handlers to be public. That is probably the correct approach, actually. They're methods other code "calls" into. Not sure why I made them private in the first place. |

The
.settings/org.eclipse.jdt.core.prefsis read by VS Code Java extension. The content is three fold: the first part is auto-generated by extension so I keep it as is. The second part is for suppress "unused" warnings on thehandleXXandonXXprivate methods which are actually used through reflection. The last part is for formatter. I figure out a set of options that are "backward compatible" i.e. it would not modify an empty solution.The settings are mostly for handout (though dslabs develop may also benefit), so Makefile is also updated to copy it into handout bundle. This should improve development experience when working on solutions with VS Code. For example, now can hit "format document" without messing any comment in the skeleton.