`try`-with-resources syntax highlighting broken at block start
Closed this issue · 1 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
Here's a couple screenshots, which should explain everything. The first is within a Markdown document, and the second is the same snippet, in its own file.
Steps to Reproduce
- Type the above into a source file.
Here's the source code, if you just want to copy/paste:
// Java 6
static String readFirstLineFromFile(String path) throws IOException {
BufferedReader br = new BufferedReader(new FileReader(path));
try {
return br.readLine();
} finally {
if (br != null) br.close();
}
}
// Java 7
static String readFirstLineFromFile(String path) throws IOException {
try (BufferedReader br = new BufferedReader(new FileReader(path))) {
return br.readLine();
}
}
If you're curious, it's mostly stolen from this tutorial example targeting Java 8, just with the methods renamed.
Expected behavior: It to highlight correctly.
Actual behavior: Lots of incorrect red highlighting.
Reproduces how often: 100% of the time.
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.
Atom version: 1.30.0
apm version: 1.19.0
OS: macOS High Sierra (64-bit)
Additional Information
Any additional information, configuration or data that might be necessary to reproduce the issue.