This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 248984 - css editor assumes // comment is ok
Summary: css editor assumes // comment is ok
Status: VERIFIED FIXED
Alias: None
Product: web
Classification: Unclassified
Component: CSS Editor (show other bugs)
Version: 8.1
Hardware: PC All
: P2 normal (vote)
Assignee: Milutin Kristofic
URL:
Keywords:
: 258490 (view as bug list)
Depends on:
Blocks:
 
Reported: 2014-11-28 15:12 UTC by Petr Hejl
Modified: 2016-07-15 14:38 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Petr Hejl 2014-11-28 15:12:16 UTC
CSS editor does not display error when // comment is used. It actually pretends this is valid syntax (grey coloring etc.) This is source of bugs which are extremely hard to find especially when editor says "all ok".
Comment 1 Milutin Kristofic 2014-12-12 15:29:56 UTC
The line comments were introduced in http://hg.netbeans.org/main-golden/rev/82b0b65079cc by Marek. I supposed it was because SCSS (and Less) are supporting them. You are right they aren't support in CSS (CSS3). 

I will look how to disable this for CSS, but I am surprised you are first to report this after 21 months in build. Maybe users prefer this, because browsers usually ignore lines with // since it is invalid syntax.

Vlada what is your opinion about this?
Comment 2 Vladimir Riha 2014-12-12 15:50:32 UTC
I tend to agree with Petr. If you have

div{
    // neco2
    color: red;
    
}

then browser will ignore everything up to the first semicolon. Maybe users are using toggle comment action, doing it manually correctly or they just haven't noticed it yet :)
Comment 3 Milutin Kristofic 2015-04-28 14:07:04 UTC
I have implemented conditions in Lexer for comments (ignore in LESS, SCSS, throw Unexpected token Line_comment in CSS). Is this solution ok with both of you? If yes, I can push it to repository.
Comment 4 Milutin Kristofic 2015-04-28 14:58:19 UTC
Ok, i checked how it was in NB 7.1 and it is quite similar after this fix. http://hg.netbeans.org/web-main/rev/c9c1405f4f7d 

I can revert, or change anything.
Comment 5 Quality Engineering 2015-04-29 02:32:34 UTC
Integrated into 'main-silver', will be available in build *201504290001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/c9c1405f4f7d
User: Milutin Kristofic <mkristofic@netbeans.org>
Log: #248984 - css editor assumes // comment is ok
Comment 6 Vladimir Riha 2015-04-29 07:27:08 UTC
Thank you, verified

Product Version: NetBeans IDE Dev (Build 201504290001)
Java: 1.8.0_40; Java HotSpot(TM) Client VM 25.40-b25
Runtime: Java(TM) SE Runtime Environment 1.8.0_40-b25
System: Linux version 3.13.0-35-generic running on i386; UTF-8; en_US (nb)
Comment 7 Milutin Kristofic 2016-07-15 14:38:11 UTC
*** Bug 258490 has been marked as a duplicate of this bug. ***