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 250835 - The javascript expression is bold when it's edited
Summary: The javascript expression is bold when it's edited
Status: RESOLVED FIXED
Alias: None
Product: javascript
Classification: Unclassified
Component: Editor (show other bugs)
Version: 8.1
Hardware: PC Linux
: P2 normal (vote)
Assignee: Petr Pisl
URL:
Keywords:
: 250541 (view as bug list)
Depends on:
Blocks:
 
Reported: 2015-03-02 19:20 UTC by Petr Pisl
Modified: 2015-09-25 01:46 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Lexer debug output (16.63 KB, text/plain)
2015-09-23 14:54 UTC, Miloslav Metelka
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Petr Pisl 2015-03-02 19:20:46 UTC
If there is a file with an javascript expression like

title The title is #{something}

then the text in the expression is colored in the right way. If you try to edit it, the text became bold. After saving and reopening, then it works correctly again.
Comment 1 Petr Pisl 2015-03-17 13:24:30 UTC
This looks like a problem in editor coloring layer.
Comment 2 Petr Pisl 2015-03-17 13:33:04 UTC
IMHO the problem is that the expression delimiters are a part of the outer language.
Comment 3 Petr Pisl 2015-03-18 14:07:47 UTC
*** Bug 250541 has been marked as a duplicate of this bug. ***
Comment 4 Petr Pisl 2015-08-25 10:05:31 UTC
To reproduce the issue, just create a jade file and copy the text "title The title is #{something}" in it. 

The jade file you can create through New File-> Html 5 / JavaScript Category.
Comment 5 Miloslav Metelka 2015-09-23 14:54:40 UTC
Created attachment 156386 [details]
Lexer debug output
Comment 6 Miloslav Metelka 2015-09-23 14:55:21 UTC
I've tested the IDE with
-J-Dorg.netbeans.lib.lexer.inc.TokenHierarchyUpdate.level=FINEST
-J-Dorg.netbeans.lib.lexer.inc.TokenListUpdater.level=FINEST
and created jade file

html //
    title Title is #{something} TODO supply a title
    body

Then I type "a" right behind "//" to see full token hierarchy. Then I position the caret right before '}' and type "b".
The problem IMHO is that before typing "b" the "something" is recognized as

T[ 9]: "something" <30,39> JAVASCRIPT[51]

while after typing "b" there's

T[ 9]: "somethingb}" <30,41> EXPRESSION_DELIMITER_CLOSE[41] DefT, st=LexerState{zzState=141, zzLexicalState=0}, IHC=1965119422

IMHO the jade lexer needs to be fixed to still recognize it as an JAVASCRIPT[51] token like before.
Comment 7 Petr Pisl 2015-09-24 12:18:02 UTC
Thanks to Mila fro the advice. My fault. Now it's fixed in web-main.
Comment 8 Quality Engineering 2015-09-25 01:46:11 UTC
Integrated into 'main-silver', will be available in build *201509250002* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/e12d2a0b4a04
User: Petr Pisl <ppisl@netbeans.org>
Log: #250835 - The javascript expression is bold when it's edited