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 124071 - synax coloring error: self + array index
Summary: synax coloring error: self + array index
Status: RESOLVED FIXED
Alias: None
Product: ruby
Classification: Unclassified
Component: Editing (show other bugs)
Version: 6.x
Hardware: PC Windows XP
: P3 blocker (vote)
Assignee: Erno Mononen
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-12-15 06:57 UTC by jariw
Modified: 2009-09-16 15:44 UTC (History)
0 users

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 jariw 2007-12-15 06:57:35 UTC
This syntax becomes incorrectly colored in the editor:
self[1..4]
(the 2 characters after "self" becomes boldface)
Comment 1 Torbjorn Norbye 2007-12-17 21:49:05 UTC
The editor highlights all method calls without receivers in bold. This helps disambiguate the local variable reference
   foo
from the method call
   foo
(they can otherwise only be told apart from inspecting the scope and seeing if foo is defined elsewhere).

In any case, in

self[1..4]

there is a method call -- the method "[]". The method call starts at the character "[", so the semantic highlighter is
blindly highlighting the first 2 characters starting at [.

The scheme for obtaining the editor offsets obviously breaks down for a method like this.
Comment 2 Erno Mononen 2009-05-19 14:52:48 UTC
Still valid.
Comment 3 Erno Mononen 2009-09-16 15:44:52 UTC
Fixed in a0c8505d1a2b. The fix isn't too elegant, just handles this particular case (i.e. "[]"). Operators as method 
names are already handled in somewhere unknown place, this would need to be handled together with those.