-
Notifications
You must be signed in to change notification settings - Fork 383
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
Supports JEP 330 in 'java' autocompletion #662
base: main
Are you sure you want to change the base?
Conversation
JEP 330 allows execution of single-file source code with "java" command as follows: $ java HelloWorld.java This commit updates the bash autocompletion to suggest *.java files in addition to precompiled classes.
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! This is in principle good, but there are a few things to address:
It causes multiple failures in the test suite because test_2 to test_5 of test/t/test_java.py now start to look for .java files, so we end up with dirs in completions we did not expect. The test suite needs to be fixed to cater this.
The commit message does not follow the format we expect. See CONTRIBUTING.md for why this is important. This needs to be addressed too, but we could do it while (squash-)merging this eventually.
For future reference, be sure to install the pre-commit checks or run them manually otherwise, that would have caught the commit message formatting issue here. Be sure to run the test suite regarding the modifications, too. See CONTRIBUTING.md for more info on both.
Thank you for your review! I was able to repro the test failures. With the new completion rule looking for individual ".java" files, all the directories are now included in the completion results. I'm puzzled for the right fix. Should I include all the sub-directories in the test? That would make these tests fragile. Example pytest output (with --vv):
|
I think one good way would be to modify the tests affected like this so that they are run in the Would be a good thing to also add a let's say |
JEP 330 allows execution of single-file source code with "java" command as follows:
$ java HelloWorld.java
This commit updates the bash autocompletion to suggest *.java files in addition to precompiled classes.