-
Notifications
You must be signed in to change notification settings - Fork 128
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
Added Basic Java Highlighting #38
base: master
Are you sure you want to change the base?
Conversation
@ouuan You might need to pull this to your QCodeEditor, It will be good to have Actual Java Syntaxhighlighting in 6.0 for us. Or maybe @tay10r could you also open this PR at https://github.com/ouuan/QCodeEditor |
</root> |
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.
This was by mistake, but can probably stay in the PR.
@coder3101 It looks like @ouuan has made some commits that have not been merged to upstream. I think it's best in this case for any forks to pull the changes if they want them, either from my fork or from upstream if this gets merged. |
These commits add some specific features to the editor that we need in our project, which might not be needed here. If your PR was possibly showing a conflict, It would still be when he tries to pull upstream. @ouuan will merge these changes directly because it might take more time for your PR to get merged here and even more time for us to pull upstream changes. I asked you to open a PR because there because it would have eased his job of visiting your fork to get changes! |
@coder3101 I see what you're saying. If it takes more than a few days to merge this PR, I'll just start sending this and further PRs to your branch (if they're useful to what you're using it for.) In the mean time, the feature isn't really complete anyway so you'll probably be better off waiting. There's still missing language features that haven't been added, such as annotation highlighting and Javadoc highlighting. |
I forked and not send PR basically because:
Feel free to either use my fork, merge/cherry-pick my changes, or even copy my codes without commits if there are conflicts that are hard to resolve. |
I think the numbers regex should be modified? I don't know Java much, but I think it should be different from C++17. |
Sure, let's adjust this for Java:
All jokes aside, there's no way I'm touching that. Java supports a very similar set of a rules for numeric literals, as described here. If there's someone who is smarter with regex who can patch this, they can go ahead and give it a go. Otherwise, they're similar enough that I wouldn't care too much. Is it binary literals? If it is, I can't really tell towards the end what part of the pattern I can remove. Feel free to suggest something. |
I just couldn't find a good reference for number literals in Java, now I can work on it. |
See 11f5647 |
@ouuan thank you that's really helpful! I'll commit that here shortly. Thanks for the help |
Highlights most (all?) Java keywords and comments. Most of the boilerplate code was copied from the C++ highlighter. Keywords retrieved here.