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.
Summary: | Ant Code Completion | ||
---|---|---|---|
Product: | projects | Reporter: | shemnon <shemnon> |
Component: | Ant | Assignee: | Jesse Glick <jglick> |
Status: | RESOLVED FIXED | ||
Severity: | blocker | CC: | issues |
Priority: | P3 | ||
Version: | 3.x | ||
Hardware: | All | ||
OS: | All | ||
Issue Type: | ENHANCEMENT | Exception Reporter: | |
Bug Depends on: | 34515, 37113 | ||
Bug Blocks: |
Description
shemnon
2002-12-11 15:30:39 UTC
I believe someone was already working on a "scenario" XML plug-in for Ant scripts? I have prototype/skeletal implementation of Ant grammar bridge. I'll commit first shareable code soon under nb_all/ant/grammar. It's there, it works. I have made some fixes to it, will make some more. Do you think it is reasonable to put this on the Dev Alpha Daily update server? Just how unstable is the XML code completion API ("scenarios" I guess)? A few questions about this: So this is for code completion for tags in an Ant script? Which tags would code completion be available for (standard Ant task names?) What needs to be configured for this to work? (Ant docs module installed?) When would this be implemented for? (4.0?) Thanks. "So this is for code completion for tags in an Ant script?" - right. "Which tags would code completion be available for (standard Ant task names?)" - currently supports standard Ant tasks and types, their attributes, and subelements (only direct subelements tho, and not their attributes), and a couple special elements like <description>. To do: custom-defined tasks and types that have been used at least once (as with the New... submenus in the Explorer), and full support for all recursive subelements and their attributes. "What needs to be configured for this to work? (Ant docs module installed?)" - no need for the docs module, just need to add this one and it starts working. Depends on some XML modules. "When would this be implemented for? (4.0?)" - I suppose so; stability of the XML module APIs it uses is TBD. Custom tasks/types now supported. Forgot another to-do: better type-specific completion of attr values, not just names. For example, you type: <target name="foo"> <copy fail ^- cursor here and press Ctrl-Space and complete to <target name="foo"> <copy failonerror=" ^- cursor here Fine, but now Ctrl-Space does nothing. Should offer "true" and "false". Ditto for any attribute whose possible values are fixed - all booleans, EnumeratedValue types, maybe others. Cool would be: completion of target names in depends, antcall, etc.; completion of property names after "${" (if they were already defined elsewhere in the script); completion of property names in if/unless; completion of ids in refid=" (if already defined elsewhere in the script); etc. Have now implemented fully recursive support for nested elements etc. Rather than seeing that the containing element is called "classpath", it actually checks if this is a <classpath> inside <project> or inside <target> or inside <xmlcatalog> etc., and can behave appropriately. Benefits: - completion of subelements and attributes in deeply nested structures - understands context, i.e. if you have: public class A extends Task { public void setFoo(String x) {} } public class B extends Task { public void addA(BA x) {} public class BA { public void setBar(String x) {} } } and a project <project default="all"> <target name="all"> <taskdef name="a" classname="A" classpath="..."/> <taskdef name="b" classname="B" classpath="..."/> <a foo="x"/> <b> <a bar="y"/> </b> </target> </project> then completion should know that the first <a> can have only the 'foo' attr but the second can have only the 'bar' attr. This kind of precision is not possible to capture with a DTD, by the way, so e.g. Emacs' PSGML mode with the DTD from <antstructure> will goof on the above example. The module seems pretty useful now, though it is still using an unstable API so should be considered experimental. I put in a hook to have it added to the NetBeans Alpha update server in the Nightly Builds section, so anyone interested in trying it should be able to get it easily. Several kinds of completion on attributes working now. Let's call it FIXED for now - particular enhancement requests can be filed separately. |