View unanswered posts | View active topics


Reply to topic  [ 25 posts ]  Go to page 1, 2  Next
[FD3] EnhancedArguments - Snippets, File Templates, ect 
Author Message
Member

Joined: Wed Apr 19, 2006 12:39 pm
Posts: 245
Post [FD3] EnhancedArguments - Snippets, File Templates, ect
Enhanced Arguments - Alpha

This plugin's goal is to extend FlashDevelop's argument processing. Currently FlashDevelop supports many variables. But this plugin is going to expand on that. The most common use for these enhancements are going to be FlashDevelop's snippets, but they can be used in other places like file templates.

Updates
    [01-06-09] - Initial Release... prolly has some bugs. Also no cancel button :)
    [01-07-09] - Added cancel button. Added default values. Added environmental variables. Again this plugin has been written in just a couple days. May have bugs. Let me know.
    [01-08-09] - Added dropdown for default values. Added Special Arguments (DateTime). Modified Environmental Argument syntax (all Enhanced Arguments will start with $$ as to be less confused with built in arguments). Some refactoring. Updated RegEx's for User Arguments and Environmental Arguments to allow more characters in optional value. Hopefully no bugs.
    [01-09-09] - Plugin now in FD svn.

Screen Shots
Image Image Image Image

Features
    User Arguments $$(var=value1,value2,value3) - This allows snippets to prompt the user for variables. By using variables with a double $ the user will be prompted for these variables. Also by using the = and comma separated text, you can set the default value(s). Note the default value(s) should be set on the first occurrence of the variable.
    For example if I had a snippet of
    Code:
    trace($$(text));

    The user will be prompted for the text variable.
    Another more useful example:
    Code:
    for (var $$(var=i,x,y):int = $$(min=1); $$(var) < $$(max=100); $$(var)++) $(CSLB){
       $(EntryPoint)
    }

    The user will be prompted for var, min, and max and they will have the default values of i with options for x and y, 1, and 100 respectively. You may cancel the replace variables screen and Enhanced Arguments will blank out the text to be inserted. Please note that if you are using the variable substitution in a file template and cancel the dialog the file will be created blank.

    Environment Arguments $$(%environvar%) - This allows snippets to use environmental variables. These are global variables to the OS. To use these variables you will use the syntax $$(%variable%). For example to get the Windows temp directory you can use $$(%temp%).

    Special Arguments $$(#specialarg=args) - This allows snippets to use special arguments created by the plugin. The currently available special arguments are:
      DateTime - This inserts the current date and/or time. Usage is $$(#DateTime#) to insert the default format, but you may also specify a custom format by using the =arguments (ex $$(#DateTime#=MM/dd/yyyy) ). You can read on the syntax here.



Download:
This plugin is for RC1. Since the RC1 release it has been included into FD source.
EnhancedArguments.dll


Last edited by xMCNUGGETx on Sat Jan 17, 2009 2:54 pm, edited 9 times in total.



Wed Jan 07, 2009 4:33 am
Profile
Admin

Joined: Wed Aug 31, 2005 7:27 am
Posts: 7503
Location: Paris, France
Post Re: EnhancedArguments - Alpha
Very smart!


Wed Jan 07, 2009 8:39 am
Profile WWW
Member

Joined: Wed Dec 06, 2006 3:12 pm
Posts: 185
Location: Leipzig, Germany
Post Re: [FD3] EnhancedArguments - Alpha
that's totally cool ... :wink:
but cancel button would be really helpful sometimes ... :mrgreen:

greetz
back2dos


Wed Jan 07, 2009 12:15 pm
Profile E-mail
Member

Joined: Wed May 09, 2007 4:32 am
Posts: 12
Location: Rio de Janeiro - Brazil
Post Re: [FD3] EnhancedArguments - Alpha
nice feature

does it support autocompletition?

_________________
--
Pedro Taranto


Wed Jan 07, 2009 1:24 pm
Profile WWW
Member

Joined: Wed Apr 19, 2006 12:39 pm
Posts: 245
Post Re: [FD3] EnhancedArguments - Alpha
back2dos wrote:
that's totally cool ... :wink:
but cancel button would be really helpful sometimes ... :mrgreen:

greetz
back2dos

Cancel button is coming... along with default values.

ptaranto wrote:
nice feature

does it support autocompletition?

Not sure what you mean by auto completion. The prompted arguments can be used in normal snippets. Then control+b pulls up a list of your snippets and enter to insert.

*edit*
Also note I updated the plugin again with some new features (like cancel) :) But still wrapping my head around regular expressions so they may be some bugs :)


Thu Jan 08, 2009 2:22 am
Profile
Admin

Joined: Wed Aug 31, 2005 7:27 am
Posts: 7503
Location: Paris, France
Post Re: [FD3] EnhancedArguments - Alpha
Amazing - I was just thinking yesterday that default values would be great. Now what about *several* default values which would appear in a (editable) combo box? :twisted:


Thu Jan 08, 2009 8:49 am
Profile WWW
Member

Joined: Wed Apr 19, 2006 12:39 pm
Posts: 245
Post Re: [FD3] EnhancedArguments - Snippets, File Templates, ect
Philippe wrote:
Amazing - I was just thinking yesterday that default values would be great. Now what about *several* default values which would appear in a (editable) combo box? :twisted:

ask and ye shall receive.


Thu Jan 08, 2009 4:04 pm
Profile
Admin

Joined: Wed Aug 31, 2005 7:27 am
Posts: 7503
Location: Paris, France
Post Re: [FD3] EnhancedArguments - Snippets, File Templates, ect
Your plugin rocks!

I'd suggest that if you press Cancel you just replace all enhanced arguments with empty or default values, but don't clear all the text.


Thu Jan 08, 2009 4:39 pm
Profile WWW
Member

Joined: Wed Apr 19, 2006 12:39 pm
Posts: 245
Post Re: [FD3] EnhancedArguments - Snippets, File Templates, ect
Philippe wrote:
I'd suggest that if you press Cancel you just replace all enhanced arguments with empty or default values, but don't clear all the text.


Ya... I can't get a correct feel for all situations. If the argument processing is being done on a file template, then I would like cancel to insert default values or clear just user variables. But when inserting a snippet I like the idea that cancel doesn't insert anything it cancels the snippet insertion.


Thu Jan 08, 2009 4:50 pm
Profile
Admin

Joined: Wed Aug 31, 2005 7:27 am
Posts: 7503
Location: Paris, France
Post Re: [FD3] EnhancedArguments - Snippets, File Templates, ect
Some other random suggestions:
- the fields labels should not be bold,
- a bit technical: position the dialog under/over the caret position so it's close to the eye focus,
- I'll look into letting you get completion context (for instance to fill the combobox with the class members/local vars).


Thu Jan 08, 2009 5:04 pm
Profile WWW
Member

Joined: Sat Nov 01, 2008 2:00 pm
Posts: 7
Post Re: [FD3] EnhancedArguments - Snippets, File Templates, ect
hey xMCNUGGETx,

you rock, this plug-in is so cool, thank you for this..


Sun Jan 11, 2009 1:09 am
Profile E-mail
Member

Joined: Wed Jul 30, 2008 7:34 pm
Posts: 17
Post Re: [FD3] EnhancedArguments - Snippets, File Templates, ect
Great addition to FD! Snippets needed some attention.

Prolly should remove the link to the 'no longer needed' dll... ;)


Mon Jan 26, 2009 6:12 pm
Profile
Member

Joined: Sun May 11, 2008 3:01 pm
Posts: 860
Post Re: [FD3] EnhancedArguments - Snippets, File Templates, ect
I've a question...
Imagine this snippet:
Code:
//------------------------------------
//  Public property $$(variable=foo)
//------------------------------------

private var _$$(variable=foo):$$(Type=Class) = $$(initializer=null);

[Bindable("$$(variable=foo)Change")]

/**
* ...
* This property can be used as the source for data binding.
* When this property is modified, it dispatches the <code>$$(variable=foo)Change</code> event.
*/
public function get $$(variable=foo)():$$(Type=Class) { return _$$(variable=foo); }

public function set $$(variable=foo)(value:$$(Type=Class)):void $(CSLB){
   if (_$$(variable=foo) == value) return;
   _$$(variable=foo) = value;
   dispatchEvent(new Event("$$(variable=foo)Change"));
}

But I'd like to have some parts of it conditionally removed (i.e. if I don't wont either setter part or getter part, or I don't need an initializer) I.e. having a checkbox in the prompt window asking for to enter the values and having it's values translated to some sort of "include this block" if checked and "exclude this block" if not checked wold be cool :)

Anyways, thumbs up, really useful plugin!

_________________
http://www.couchsurfing.com/people/wvxvw


Sat Jan 31, 2009 11:18 am
Profile
Member

Joined: Sun Aug 19, 2007 4:56 pm
Posts: 9
Post Re: [FD3] EnhancedArguments - Snippets, File Templates, ect
A great addon!

I also need check box a lot... there are function with optional parameters... especially.. if you coding in away3d. (there is a lot of them!) so having on option to include one or another parameter ... would be great help! and great speed improvement..

one more idea... that can save space in snippets.. that clutters so fast... make an drop down menu...! lets say... I want to make visual object... instead of having separate sniped for all available options... I would like to place all in one sniped.. and let something like switch statement to use one or another portion of the snippet...
so.. if switch is present.. snippet window show available blocks in drop down.. and change options according selection..

thanks for you work! and please... consider my ideas. Snippets speed up work a lot... and for me.. it replaces FDT build in auto generate functionality... so whats why we want more control... its huge time saver!


Mon Mar 30, 2009 5:01 am
Profile
Member

Joined: Thu Mar 19, 2009 2:16 am
Posts: 25
Post Re: [FD3] EnhancedArguments - Snippets, File Templates, ect
MCNUGGET, well done on this app. It's addicting!

My only minor gripe is that the window doesn't autosize to adjust for longer varname prompts but cuts them off instead. The combos are a little snug as well. Did they charge you by the inch for controls or something? :lol:

Beyond that it works flawlessly for me.

Hat's off and thanks!


Thu Apr 02, 2009 1:37 pm
Profile E-mail
Display posts from previous:  Sort by  
Reply to topic   [ 25 posts ]  Go to page 1, 2  Next

Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software for PTF.