Open felixhao28 opened 6 years ago
Same happens if the class name starts with a lower case character. And the behavior differs a little bit depending on whether the class is fully consisted of lower case characters.
signPdf sign = new signPdf(userinfor.getUserMail(), userinfor.getUserId(), file, fileSign);
signpdf sign = new signPdf(userinfor.getUserMail(), userinfor.getUserId(), file, fileSign);
SignPdf sign = new signPdf(userinfor.getUserMail(), userinfor.getUserId(), file, fileSign);
That is interesting. We might need to extend pattern to handle these characters. Thanks! I will have a look.
Same happens if the class name starts with a lower case character.
This was mentioned on the message board recently:
https://discuss.atom.io/t/java-syntax-highlighting-for-lowercase-object-variable-names/66322
Their example:
public class Test {
public static void main(String[] args) {
for (int i = 0; i < 10; i++) {
System.out.println(i);
}
someObjectType tcObj = null;
for (int i = 0; i < 10; i++) {
System.out.println(i);
}
}
}
And screenshot:
(See someObjectType
).
@rsese this issue does not exist tree-sitter, along with other stuff like generics, variables, multiline methods, etc. that we struggle to fix properly with regex.
I already use experimental tree-sitter when working with Java; and I am trying to merge my PR as soon as possible to get that into Atom release.
Thanks for letting me know! We can still patch this in TextMate grammar. I will take a look this weekend if it is okay (a bit snowed under with some other stuff at work), or can do tonight, if it is urgent. Let me know!
What is tree-sitter?
Text-mate is where the original syntax highlighting for Atom (and sublime, and I believe VS Code) comes from. It's a whole bunch of regexes with some smarts layered on top so they can do more than a single regex could.
Tree sitter is a new parser generator tool that creates much more correct (and often faster!) parsers using syntax trees: http://tree-sitter.github.io/tree-sitter/
@sadikovi I made the post on the message board about the lowercase object types. This issue is not urgent, but thank you for looking into it!
Prerequisites
Description
If the class name starts with underscore, the tokenizing of the whole line of variable definition breaks.
Steps to Reproduce
Expected behavior: [What you expect to happen]
_BaseActionController
gets treated equally likeBaseActionController
.Actual behavior: [What actually happens]
The whole line is not tokenized.
Reproduces how often: [What percentage of the time does it reproduce?]
Versions
You can get this information from copy and pasting the output of
atom --version
andapm --version
from the command line. Also, please include the OS and what version of the OS you're running.Additional Information
Any additional information, configuration or data that might be necessary to reproduce the issue.