Closed l-cornelius-dol closed 5 years ago
Thanks @lawrence-dol! Can you share a minimal example that we can copy/paste for testing?
This file, saved as TestComment.js
works for me:
/**/function myFunction=function() {
let one=1;
one+=one;
console.log("One","is not",one);
};
I can replicate with any JS file, just by inserting an empty comment at the start of any line. Very occasionally, it won't happen, but then doing a CTL+SHF+F5 to force reload will cause the problem.
Note that it's not always to the end of the file either, on some larger files it just mysteriously begins working again on some random line. So to the end of the current line is most common, but sometimes for some number of following lines as well.
Is there an easy way to install a side-copy of Atom without disturbing my existing install so I can check for a problem with a vanilla install? I've already done safe-mode and it does replicate there.
A correlated behavior is that when I type the /*
it does not immediately mark all following text as a comment up to the next */
as it does in other files (like Java). This, I think, provides a valuable clue as to what's happening.
This should be fixed on nightly, maybe beta but I’m not sure.
@Aerijo : Do you have a commit reference?
oh lol that's the second time I've missed that one, thanks for catching it again @Aerijo 👍
Confirmed fixed on beta channel.
Prerequisites
Description
Syntax highlighting fails to correctly highlight the rest of the line when an empty multiline comment, that is
/**/
, is encountered. I've noticed this in Javascript source, though it does not seem to happen in Java source files -- it's likely to be specific to Javascript and others, but not all.Sometimes the highlighting for the rest of the file is also confused as well.
Steps to Reproduce
Expected behavior:
Correct syntax highlighting.
Actual behavior:
Some or all elements are highlighted using the styles for a comment, depending on the exact theme. In my minimalist theme it tends to be the entire line, but in the default safe-mode theme it tends to be only program identifiers and punctuation, but not keywords and constants.
Reproduces how often:
100% for the same line. About 50% for the rest of the file being affected, unpredictably.
Versions
Atom : 1.40.1 Electron: 3.1.10 Chrome : 66.0.3359.181 Node : 10.2.0
Windows 10 1903 18362.295.
Additional Information
Expected:
With empty comments:
Sometimes the rest of the file, sometimes not: