Array initializer recognized as inner class
Closed this issue · 4 comments
Prerequisites
- Put an X between the brackets on this line if you have done all of the following:
- Reproduced the problem in Safe Mode: http://flight-manual.atom.io/hacking-atom/sections/debugging/#using-safe-mode
- Followed all applicable steps in the debugging guide: http://flight-manual.atom.io/hacking-atom/sections/debugging/
- Checked the FAQs on the message board for common solutions: https://discuss.atom.io/c/faq
- Checked that your issue isn't already filed: https://github.com/issues?utf8=✓&q=is%3Aissue+user%3Aatom
- Checked that there is not already an Atom package that provides the described functionality: https://atom.io/packages
Description
class A {
public void getParamToIntArray(String key) {
Integer.valueOf(string.trim());
new Integer[] { Integer.valueOf(string.trim()) };
}
}
Screenshot taken in VSCode using java.cson from version d48e713.
Steps to Reproduce
- Open new tab and select Java language.
- Paste code into the editor.
Expected behavior: [What you expect to happen]
The two Integer
s should have the same color and same scopes.
Actual behavior: [What actually happens]
Everything inside the array initializer is recognized in meta.inner-class.java
scope.
Reproduces how often: [What percentage of the time does it reproduce?]
Always.
Versions
You can get this information from copy and pasting the output of atom --version
and apm --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.
Good catch! It looks like begin
of meta.inner-class.java
is not exactly correct, only works when there are no spaces between square bracket and curly one. Anyway, will try fixing.
Not quite sure if this is a good fix: felixhao28@46aaaac. FYI.