| Author |
Message |
|
kytom
Member
Joined: Thu May 31, 2007 10:14 am Posts: 6 Location: Poland
|
 Special tags (parameters) in Snippets
O, almighty FD team, please bring the special tags functionality back to FD3!
Two of the snippets I've used most often - trace (which used @CLIPBOARD), and singleton (which used @CLASSNAME), are now unusable, cause the tags are not parsed. It's always hard to take when a new version takes away features that were there before...
And while I'm at it, is it possible to simplify creation of snippets? Like I always have to look up what the tag for entrypoint looks like. Why do we have two tags, $(EntryPoint) and $(CSLB)? What does the second one stand for?
Other than that, I heart you and if you don't end up in Heaven, I don't know who might. Best regards.
|
| Thu May 31, 2007 10:30 am |
|
 |
|
Philippe
Admin
Joined: Wed Aug 31, 2005 7:27 am Posts: 7470 Location: Paris, France
|
The variable names have all be renamed.
Snippets & templates variables:
$(EntryPoint) -- cursor position
$(CSLB) ("Coding Style Line Break") -- when generating code, tells where to insert a linebreak if the "Coding Style Type" option (program setting) is set to "Brace After Line".
General variables:
$(SelText) -- selected text
$(CurWord) -- word at cursor position
$(Clipboard) -- clipboard content
$(Timestamp) -- system time
$(CurFile) -- current file
$(CurFilename) -- current file's name
$(CurDir) -- current file's directory
$(OpenFile) -- show Open.. file dialog
$(SaveFile) -- show Save As... file dialog
$(OpenDir) -- show dialog to select a directory
$(DesktopDir) -- user desktop directory
$(SystemDir) -- Windows system directory
$(ProgramsDir) -- Program Files directory
$(PersonalDir) -- user directory
$(WorkingDir) -- current working directory
$(AppDir) -- FlashDevelop program directory
$(BaseDir) -- FlashDevelop files
$(UserAppDir) -- FlashDevelop user directory
Project related:
$(ToolsDir) -- user Tools directory
$(OutputDir) -- output file direcory
$(OutputName) -- output file name
$(ProjectName) -- project name
$(ProjectDir) -- project directory
$(ProjectPath) -- project file path
Last edited by Philippe on Wed Sep 05, 2007 1:14 pm, edited 1 time in total.
|
| Thu May 31, 2007 12:38 pm |
|
 |
|
exorcyze
Member
Joined: Mon Dec 26, 2005 6:46 pm Posts: 109
|
Very handy to have this reference, thanks. I don't suppose it would be possible to add a $(CurMethod) or something similar?
|
| Thu May 31, 2007 3:14 pm |
|
 |
|
Philippe
Admin
Joined: Wed Aug 31, 2005 7:27 am Posts: 7470 Location: Paris, France
|
exorcyze wrote: Very handy to have this reference, thanks. I don't suppose it would be possible to add a $(CurMethod) or something similar?
Is that enough?
$(TypPkg) -- File package
$(TypName) -- Current type name
$(TypPkgName) -- Current type qualified name (package+type name)
$(TypKind) -- Type kind (interface, class)
$(MbrName) -- Current member (declaration at line, ie. current method)
$(MbrKind) -- Member kind (const, var, function)
$(MbrTypPkg) -- Member's type package
$(MbrTypName) -- Members's type name
$(MbrTypePkgName) -- Members's type qualified name (package+type name)
$(MbrTypKind) -- Members's type kind (interface, class)
$(ItmTypName) -- Current item name (object resolved at cursor position)
$(ItmFile) -- File where the item is declared
$(ItmKind) -- Item kind (const, var, function)
$(ItmTypPkg) -- Item's type package
$(ItmTypName) -- Item's type name
$(ItmTypePkgName) -- Item's type qualified name (package+type name)
$(ItmTypKind) -- Item's type kind (interface, class)
|
| Thu May 31, 2007 3:35 pm |
|
 |
|
exorcyze
Member
Joined: Mon Dec 26, 2005 6:46 pm Posts: 109
|
Oh goodness yes, many thanks! =D
|
| Thu May 31, 2007 3:38 pm |
|
 |
|
kytom
Member
Joined: Thu May 31, 2007 10:14 am Posts: 6 Location: Poland
|
Sweet mother of double jeopardy backstroking in butterscotch!
More than enough, more than satisfied!  Thank you!
|
| Thu May 31, 2007 3:59 pm |
|
 |
|
SamsamTS
Member
Joined: Wed Feb 08, 2006 9:15 pm Posts: 8 Location: Rosenau, France
|
Woot i was looking for a template variables list before and i never found it.
The list can be found anywhere in the documentation ? If not it should be a good idea to add it.
|
| Fri Jun 01, 2007 8:47 am |
|
 |
|
Mika
Admin
Joined: Tue Aug 30, 2005 6:14 pm Posts: 1745 Location: Helsinki, Finland
|
We are going to start a documentation project soon to produce some
real documentation for FD. This will be found there then.
|
| Fri Jun 01, 2007 8:56 am |
|
 |
|
ghost23
Member
Joined: Sun Aug 27, 2006 12:21 pm Posts: 32
|
I don't want to be nasty, but is it somehow possible to
reference a snippet in a snippet? I imagine cool things you could do with that.
Cheers
|
| Fri Jun 01, 2007 10:02 am |
|
 |
|
Mika
Admin
Joined: Tue Aug 30, 2005 6:14 pm Posts: 1745 Location: Helsinki, Finland
|
This is actually a good idea. I'll check it.
|
| Fri Jun 01, 2007 10:27 am |
|
 |
|
back2dos
Member
Joined: Wed Dec 06, 2006 3:12 pm Posts: 185 Location: Leipzig, Germany
|
i just wondered if you could include something like $(AutoComplete) in the snippets & templates variables. should work like $(EntryPoint) but automatically triggers autocompletion at cursorposition.
greetz
back2dos
|
| Thu Jun 07, 2007 12:04 pm |
|
 |
|
Jerome
Member
Joined: Wed Nov 29, 2006 10:17 pm Posts: 63 Location: Paris, France
|
Snippets are trimed. There is a solution to write some blank lines at the end ?
The code below doesn't works.
Code: // test.fds private function test ():void { $(EntryPoint) }$(CSLB)$(CSLB)
|
| Fri Jun 08, 2007 9:09 am |
|
 |
|
moloko
Member
Joined: Thu May 24, 2007 11:42 am Posts: 46
|
 help with creating snippet needed
I am sure there must be a way of doing this but I'm struggling to work it out and hope someone can help!
What I like to do is create a snippet that lets me replicate the behaviour of the 'trace variable' function in SEPY.
So given a line of code like this:
Code: this._somePropertyName = "somevalue"; and assuming that I have either highlighted '_somePropertyName' or that my cursor is somewhere in it, I want to create a new line underneath that line and then insert the following snippet: Code: trace("$(CurWord): " + $(CurWord));$(EntryPoint)
But I just can't work out how to add the new line and put the snippet in it! Can anyone help?
_________________ "Science created him. Now Chuck Norris must destroy him."
|
| Wed Jun 20, 2007 11:32 am |
|
 |
|
Jerome
Member
Joined: Wed Nov 29, 2006 10:17 pm Posts: 63 Location: Paris, France
|
|
| Wed Jun 20, 2007 11:56 am |
|
 |
|
jason.nussbaum
Member
Joined: Wed Jul 26, 2006 5:48 pm Posts: 9 Location: Toronto, Ontario
|
Potentially silly question, but - what about adding code hinting for snippet files? Such that when editing a snippet within FD you get hints for "$("?
|
| Wed Jun 20, 2007 10:54 pm |
|
|