Auto Insertion of Tag attributes and Function arguments in ColdFusion Builder 2
The Editor is the most important feature in an IDE and the code assist
features in the Editor helps in developing applications quickly and
hence help in increasing the productivity. One of features is the 'Auto
insertion of tag attributes'. Most of the tags in ColdFusion have a
mandatory attribute, for example the attribute 'name' is mandatory when
using the cffunction tag. In ColdFusion Builder 2, these attributes are auto inserted i.e. when a user types in the cffunction tag and invokes code assist (using CTRL + SPACE) the name attribute is auto inserted.
Auto insertion also works for function arguments wherein the required arguments are auto inserted.
Auto Insertion of Tag attributes
As explained above, the mandatory attributes are auto inserted whenever the code assist is invoked for tags such as cffunction:

In the above picture, code assist for cffunction is invoked and the tag is selected from the list. This would auto insert the required attribute 'name':

There are some tags such as cfpdf, cfimage wherein a few attributes become mandatory when one of the attributes' value is specified. For example, in case of cfimage when the action attribute is specified as 'convert', the attributes destination and source become mandatory and are auto inserted:

Now on selecting the action attributes' value as convert, the attributes destination and source are auto inserted:

If the user selects action attributes' value as rotate, then the attributes angle and source are auto inserted:

Another thing to note here is that, after inserting the required attributes the cursor is positioned such that one can go about specifying the next attributes' value.
Auto Insertion of required function arguments
Whenever one tries to invoke a built-in function or a user defined function the required arguments are auto inserted. For example, consider a function foo which takes three arguments, of which the first two arguments are mandatory:
When
this function is invoked using code assist, the required arguments are
auto inserted. As seen above, arguments arg1 and arg2 are marked as
required and are auto inserted when the function is invoked. After
inserting the required arguments the first argument is selected so that
the user can go about specifying a value for the argument. The tooltip
here shows the list of arguments that the function accepts along with
the argument type. The last argument - arg3 is marked optional and is
surrounded by square brackets indicating that it is optional.
Auto insertion also works for function arguments wherein the required arguments are auto inserted.
Auto Insertion of Tag attributes
As explained above, the mandatory attributes are auto inserted whenever the code assist is invoked for tags such as cffunction:

In the above picture, code assist for cffunction is invoked and the tag is selected from the list. This would auto insert the required attribute 'name':

There are some tags such as cfpdf, cfimage wherein a few attributes become mandatory when one of the attributes' value is specified. For example, in case of cfimage when the action attribute is specified as 'convert', the attributes destination and source become mandatory and are auto inserted:

Now on selecting the action attributes' value as convert, the attributes destination and source are auto inserted:

If the user selects action attributes' value as rotate, then the attributes angle and source are auto inserted:

Another thing to note here is that, after inserting the required attributes the cursor is positioned such that one can go about specifying the next attributes' value.
Auto Insertion of required function arguments
Whenever one tries to invoke a built-in function or a user defined function the required arguments are auto inserted. For example, consider a function foo which takes three arguments, of which the first two arguments are mandatory:
When
this function is invoked using code assist, the required arguments are
auto inserted. As seen above, arguments arg1 and arg2 are marked as
required and are auto inserted when the function is invoked. After
inserting the required arguments the first argument is selected so that
the user can go about specifying a value for the argument. The tooltip
here shows the list of arguments that the function accepts along with
the argument type. The last argument - arg3 is marked optional and is
surrounded by square brackets indicating that it is optional. Tags:
Published at DZone with permission of Sagar H Ganatra, author and DZone MVB. (source)(Note: Opinions expressed in this article and its replies are the opinions of their respective authors and not those of DZone, Inc.)




