-
-
Notifications
You must be signed in to change notification settings - Fork 119
[WIP]-Some Auto Complete Functionalities #5
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
This is for getting the text of the textArea so we can perform autocomplete. It takes two parameters which directly correlate to the getText() method of the TextArea class.
The beginnings of the autocomplete class. So far, I have a general layout of what I want to do and am entering some content.
The code works great, but I want to clean it up.
Going to re-comment the code.
Performed some documentation and code cleanup.
I forgot to mention this but I changed tab indentation to 2 in UI.java as well. The smaller indentation looked better when coding.
Removed unnecessary else statement from inner class CommitAction.
Users won’t be bothered with java keywords if they are not editing a java file.
Okay, thank you very much for your contribution Patrick! Always welcome! I will test it this weekend. On what Java version did you run it?
P.S. You added a temporary file in your commit src/simplejavatexteditor/UI.java~
Thank you for pointing that out, the temp file is deleted. I used Java 1.8.0.51 to be exact. I believe it's the latest version of Java 8. I am actually still working with this as well. I'd like the auto complete to be compatible with multiple languages. So, you might get another pull request from me in the near future. When you test it, remember the code completion will only work if the file you're working on has been saved as a ".java" file.
Glad to contribute. It's a handy editor.
Thanks,
Patrick
Very well Patrick! And very nice commits (details). I tested and was working OK but I didn't do any legitimate Q/A. So let me know if you are still working on this branch or aren't WIP anymore
I want to make the editor supportive of multiple languages. Putting the keywords in a separate class and going to add more languages. Code to handle the different languages added to UI.java. I’m not finished yet, need to do some clean up/documenting. This works though.
This is the completed enhancement. I have found this useful so I might expand on it in the future, but for now I think I am finished with it.
Thank you very much. Glad to be of service.
I just finished it. What I wanted to do was make it compatible with multiple languages, not just Java. So, I made a separate class for the keywords and made it so you could kind of plug them into the auto complete class. I did find a bug as well. If you saved the file with a supported extension twice it would have two listeners on the text area and it just looked bad. I fixed that as well. It's reasonably simple for keyword support to be added to it, which is good. I have Java and C++ keywords in there now. If the user saves it as a .cpp extension it will now have C++ keyword suggestions. It can be expanded to support pretty much any number of languages.
Hi again! Very sorry for the delay but was quite busy! Okay, super for that! Your branch got conflict with https://github.com/pH-7/Simple-Java-Text-Editor/pull/4/files (branch I merged just after you created this PR) so I have fixed the conflict here -> #6
Please just review it (if I didn't do anything wrong, I've done it quite quick). If it's OK just give a 👍 and I will merge it right away.
Again, thanks for your help. I really appreciate Patrick! Have a good Easter
No problem. Gad to help! Happy easter to you too. Giving the +1 now.
This implements some code completion functionalities for the Simple Java Text Editor program. I like this editor so I added this to help with java programming. It provides code completion for Java keywords, brackets and parentheses. There may be a small bug or two so this is a work in progress and I hope to perfect it as issues arise. Any feedback on how this was implemented or ways to improve it is welcome.