Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[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

Closed
patrick-slagle wants to merge 15 commits into pH-7:master from patrick-slagle:autocomplete

Conversation

@patrick-slagle
Copy link
Contributor

@patrick-slagle patrick-slagle commented Mar 13, 2016

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.

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.
Copy link
Contributor Author

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.
Copy link
Owner

pH-7 commented Mar 18, 2016

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~

Copy link
Contributor Author

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

Copy link
Owner

pH-7 commented Mar 21, 2016

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.
Copy link
Contributor Author

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.

Copy link
Owner

pH-7 commented Mar 26, 2016

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

Copy link
Contributor Author

No problem. Gad to help! Happy easter to you too. Giving the +1 now.

@pH-7 pH-7 closed this Mar 28, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

AltStyle によって変換されたページ (->オリジナル) /