Bug 121663 - Code templates should expand from embedded languages' templates
Code templates should expand from embedded languages' templates
Status: RESOLVED FIXED
Product: editor
Classification: Unclassified
Component: Completion & Templates
6.x
All Windows Vista
: P2 (vote)
: 6.x
Assigned To: Vitezslav Stejskal
issues@editor
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2007-11-10 20:12 UTC by jamespb
Modified: 2008-02-14 12:54 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description jamespb 2007-11-10 20:12:47 UTC
None of the ruby code templates appear to be working in a erb file.  The Ruby HTML templates are working (things like
table), but the regular Ruby templates aren't expanding.

Product Version: NetBeans Ruby IDE 20071110080227
Java: 1.6.0_01; Java HotSpot(TM) Client VM 1.6.0_01-b06
System: Windows Vista version 6.0 running on x86; Cp1252; en_US (nbrubyide)
Userdir: C:\Users\James\AppData\Roaming\.nbrubyide\dev
Comment 1 Torbjorn Norbye 2007-11-13 16:52:36 UTC
(As far as I know, this has never worked)

The problem is in the editor code templates code; it needs to check abbreviations in embedded languages, such that when
you're in JavaScript it expands JavaScript code templates, in HTML the HTML templates, and so on.
Comment 2 Vitezslav Stejskal 2007-11-14 10:46:51 UTC
Yeah, this needs to be fixed. Currently the editor uses codetemplates from a top-level language _anywhere_ in a file.
Comment 3 jamespb 2007-11-14 16:30:57 UTC
Given a choice between

1.  erb files use Ruby templates, and there's no way to define templates just for an *.html.erb file
2.  erb files and Ruby files have completely different code templates, so I can define templates that only work in
*.html.erb files, and different templates in *.css.erb, etc.

I'd definitely choose #1.  When I'm editing foo.html.erb, and I'm in a <% %> section, I'm writing Ruby; it's very
surprising that the code templates I use all the time don't work.
Comment 4 Vitezslav Stejskal 2008-02-11 12:58:52 UTC
I'm working on this one now.
Comment 5 Vitezslav Stejskal 2008-02-14 12:54:48 UTC
Should be working now. I also updated ruby.rhtml to make both its ruby and rhtml templates work. James, we did #1.

changeset 329dd78d09a7 in main
details: http://hg.netbeans.org/main?cmd=changeset;node=329dd78d09a7
changeset 3275161479d9 in main
details: http://hg.netbeans.org/main?cmd=changeset;node=3275161479d9


By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2012, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo