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.
With Rails3 Beta2 is a new deprecation - "<% %> style block helpers are deprecated. Please use <%= %>." These warnings are for blocks such as - <% form_for %> <% form.fields_for %> Converting these blocks to the <%= xxx %> style results in a parsing error.
Beta2 CHANGELOG reference - http://github.com/rails/rails/raw/v3.0.0.beta2/actionpack/CHANGELOG
Thanks for the report. For some reason I'm not seeing the error, can you please post here an example view where you get the parsing error? Thanks.
Created attachment 96868 [details] Screenshot of the parsing error This screenshot shows the parsing error caused by line 1 and the syntax highlighting side effects it has. The view was generated using the following command - rails generate scaffold User name:string email:string
Thanks. One more thing: which Ruby version do you use, 1.8 or 1.9? I can reproduce this with 1.9, but not with 1.8.
(In reply to comment #4) > Thanks. One more thing: which Ruby version do you use, 1.8 or 1.9? I can > reproduce this with 1.9, but not with 1.8. ruby 1.9.1p376 (2009-12-07 revision 26041) [x86_64-linux]
OK, so this is specific to the 1.9 parser. I'll need to fix this in jruby-parser and then upgrade it in NB.
Turns out the problem is not in the parser really, but in the translated code produced by our embedding provider. I'm not sure how to fix that though as even ERB itself produces uncompilable code for this case, e.g. if you do the following in the Rails console template = %( # form_for ... } rhtml = ERB.new(template) rhtml.src => shows the translated code rhtml.run => syntax error I guess there is something magical that Rails does to make this work, but I haven't found yet what exactly, and even if I found it I'm not sure if our embedding provider could mimic that behavior. I guess I may just end up disabling error badges for rhtml files.
Fixed in b1b4b687bfd6 by disabling explorer error badges for rhtml files. Will revisit this if I figure out what Rails is doing to make views with <%= form_for %> compilable.
(In reply to comment #8) > Fixed in b1b4b687bfd6 by disabling explorer error badges for rhtml files. Will > revisit this if I figure out what Rails is doing to make views with <%= > form_for %> compilable. Thanks Erno. Is it possible for end users to disable syntax checking for particular file types like rhtml? I'm still stuck on 6.8 (mainly because of the nbgit plugin) and although there are no error badges in that version, this issue still causes problems with the syntax highlighting there as well.
>Thanks Erno. Is it possible for end users to disable syntax checking for >particular file types like rhtml? Unfortunately not, the syntax errors are from the parser, but we can't skip parsing rhtml files altogether as most of the editing features would not work then (highlighting, code completion etc). I will still try to investigate how we could make the translated code for <$=form_for%> views error free.
Integrated into 'main-golden', will be available in build *201004131450* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main/rev/b1b4b687bfd6 User: Erno Mononen <emononen@netbeans.org> Log: #183453 - ERB Parsing Error