You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@andrewnester I tried to investigate a bit 🙂
After a bit of time and a lot of breakpoints I understood that two annotations are registered because when verifying the CSS code in the worker-css.js:
There is a first SyntaxError catch in _readDeclarations() (called by _ruleset(), itself called by _stylesheet()).
Still in _readDeclarations() there is these lines:
elseif(tt!==Tokens.RBRACE){throwex;}
So the exception is forwarded and catch again by the caller _stylesheet(), this will generate the second msg.
When the exception is caught a reporter.error( is called to add an error, this is why there is two times the exact same annotation.
The questions are:
Why in _readDeclarations() the exception is consumed and throw to be consumed again ?
Why the token value is null? Since the true error is missing RBRACE.
Describe the bug
In CSS mode if we enter this:
h2 {
The newlines are mandatory to ensure the bug to occurs.
We get 2x the exact same "error" annotation (same
text
,row
,col
,rule
, ...).I currently use the 1.5.0
ace-min
version available in the build repo.Expected Behavior
Only one annotation. Not twice the same one.
Current Behavior
Currently we get twice the exact same annotation:
Reproduction Steps
Initialize an Ace editor with CSS mode, then enter these lines:
h2 {
The newlines are required.
Now if you console log the annotations of the current Editor session you will get:
Twice the same with the exact same line and column.
Possible Solution
No response
Additional Information/Context
No response
Ace Version
1.5.0
The text was updated successfully, but these errors were encountered: