For those of you who use Dreamweaver for editing LUA and XML when creating your AddOns, I have decided to package something that I have been using for some time into an easy to install Dreamweaver Extension. The Extension provides syntax coloring for World of Warcraft LUA files.

Features -------------
- Color Coding for LUA code structure
- World of Warcraft API included as native functions (Global and Widget)
- New Functions are included as they have been announced for version 1.5.0 (still in testing on Test Server)

To Do ---------------
- Add Code Hints for LUA code, to help budding scripters get a handle on how things should be written
- Make code coloring work inside XML files.

Known Issues -----------
- Code Coloring is not available for LUA that is embedded in an XML file. I am experimenting with making this work, and should have this in the next version
- Comments that use the format --[[ comment ]]-- are not currently being color coded. The reason for this is that Dreamweaver uses CDATA entries for most of the code color definitions, and as such you cannot nest ]] inside of a <![CDATA[whatever]]> entry. Looking for ways to make this work, and welcome any suggestions

If you have questions, or find a bug, let me know. This has been something I have used for a couple months and as such is fairly bug free except for what I listed above. Be aware that this extension supports Dreamweaver MX+ (MX and MX2004) and only the windows platform...

Dreamweaver extension that adds syntax coloring for lua code, within both lua and xml files. World of Warcraft Global and Widget API are both included as native functions, up to version 1.5.0 of the game client (soon to be released).

--------------------------------------------------------------
Known Issues / Coming Soon
--------------------------------------------------------------
* Code Hints will be added to help suggest code within your scripts
* comments that use the format --[[ comment ]]-- are not currently being colored with the comment block color. This is due to a shortcoming in the dreamweaver configuration files, which use CDATA elements to define such entries, and as such does not allow ]] as part of and entry.

--------------------------------------------------------------
Version History
--------------------------------------------------------------

This extension adds several new features that will aide in developing AddOns using the popular web design application, Dreamweaver. Features include syntax coloring for lua code within lua or xml files, and code hints for xml elements.

--------------------------------------------------------------
Known Issues / Coming Soon
--------------------------------------------------------------
* --[[ comment blocks ]] are now colored correctly
* --comments MUST be formatted as --<space>comment (example: -- this is a comment). Unfortunately Dreamweaver cannot tell the difference between -- and --[[ so the space is needed to make them appear different to the program. (otherwise --[[ comment blocks ]] would not work correctly)
* renamed the extension, which means it will attempt to install parallel to the previous extension. Please remove the previous extension before installing this one to make sure that all configuration changes remain intact and correct. The reason for the name change was to better reflect the purpose of the extension (no longer just code coloring) as well as prepare for additional plugins to be released soon (news coming soon)

* Add an API browser that shows you the functions, calls, and widgets available, even allowing you to drag and drop them into your code

------- Items with stars are things I plan or hope to implement soon. No guarantee that all of them will be possible, but my initial impression is that they should be ;)
-- oh and the new dreamweaver 8 is nice ;D

Kaelten

09-21-05 08:22 AM

Hey Bela, what about auto-complete?

I currently use EditPlus and if I type

Code:

if

it changes it to

Code:

if ( ) then

end

putting the curser between the two ( )

is this type of thing in there already and I over looked it or is it something that could be added to a future version?

Beladona

09-21-05 09:39 AM

1 Attachment(s)

that is called code hinting / code completion. It isn't in yet for LUA code, but will be soon. It IS however available for XML files:

Basically start entering stuff into an xml file, and it should suggest possible matches based on the tag library. Everything should be rpesent and accounted for in the XML library, from AbsDimension to WorldFrame...

I am working on a LUA tag library right now. It is harder to accomplish because tag libraries for programming languages are akin to creating an entire interpreter for Dreamweaver. My goal however is to have all of that in there. That way you can use Dreamweaver and it will do everything that editpad does, or other such script editors. (function browsers, autocompletion, etc...)

PS: fixed an error in my notes about the --[[ comment blocks ]]. I meant to say that they are NOW colored correctly, but instead I said NOT. Opps lol. They are actually colored correctly, and wrap to multiple lines correctly (until you type in the closing ]] braces of course). The side affect was that regular single line comments that begin with -- must have a space after it before the text, or else it wouldn't let me color code it.

Beladona

09-21-05 10:48 AM

updated to version 1.5.1700 -- fixed an issue where the tag library would be installed multiple times (and be displayed multiple times) each time you installed the extension.

KalZakath

10-14-05 09:04 AM

This looks excellent Bela, and I'll be downloading it tonight :D

I used DW (UD through to MX) for several years whilst web developing, and since I'm used to the interface this Extension will be great - for all it's faults, DW does make a great XML/Text editor :) hehe

Thanks Beladona!

Beladona

10-14-05 10:53 AM

you should look into DW8 -- they added a lot of enhancements to improve XML editing as well as XSL and XML handling. It is finally able to do correct stylesheet work for XML

And I absolutely love the new CSS handling

bonus - my extension is fully DW8 capable. On a side note, I should be updating the plugin for version 1.8 this weekend. Work has been insane, so I haven't had a chance to update it, nor have I been able to upload the compares to my wdn.wowinterface.com website

KalZakath

10-20-05 02:28 PM

Hi again Beladona.

I've been using your extension for about a week now, and I have to say it's just the ticket for me :) DW makes a great all-round text or script editor (I do still use it for web stuff occasionally, but less so these days). I may well check out v8 - the old CSS stuff was 'usable' at best, and I'd be interested to see what they've done with it. To be honest, I never used the true features of DW (all the drag-and-drop and design mode HTML authoring) - I'm a coder first and foremost, and most of work used to be in the source view. And, I absolutely hate the code/HTML DW produces - call me sad, but I like nicely indented code, even in HTML - and that means tabs, not spaces for a start :)

OOops wandering off topic there! Anyhow, a big thank you from me for this great extension.

On a side note, do you need/want any help with the code hints side of things? I haven't done any DW-specific coding/customisation, but would be happy to help wherever I can.

Cheers,

Kalz.

Beladona

10-21-05 06:48 AM

Actually I find DW is capable of coding exactly the way you want it to. I agree that using spaces for indenting is horrible, but you should really consider looking at the preferences. You can specifically tell DW qhat to use for indenting. Default is 2 spaces, but you can set it to 1 Tab, and even set the size of the tab (default is 4)

I use tabs for my indenting as well, it just looks better, especially when viewing source in something else like notepad

That is probably what makes DW my favorite editor for just about any programming language. You really can customize it to follow any standard, including XHTML strict...

KalZakath

10-25-05 02:40 AM

Probably a good recommendation there :)

I have to admit, most of my DW drag-and-drop experience is based on good old UltraDev, and the first MX version. Ultradev used to drop things in the wrong place, or drop them before you'd released the button which was annoying! Macromedia build their software using JavaScript by the looks of things, and it really doesn't handle certain Windows situations very well (it was never meant for true App development). Updating pages and the site window when window focus changes is a big no-no (updating *anything* on focus change is generally frowned upon, as it brings it's own set of problems - and it goes against the 'windows logo' guidelines for usability).

I think my experience was soured a bit by using UltraDev originally - but DW has certainly come a long way since then :) It's definitely a good all-round code editor, and one of the great things is how well it handles large files - DW will happily open files that would choke other text editors (data files, etc.), and I've used it lots for that reason in the past.

I actually wish I was still doing web stuff, then I would have justification for checking out DW8 - I'm intrigued by the CSS improvements, since CSS is a bit of beast, and getting an idea of 'best practice' is quite difficult (found lots of different ideas on that). Unfortunately if I did get it, it wouldn't be used to it's fullest.

Ooops I'm dragging your thread off-topic again, sorry :)

Dridzt

11-25-05 05:22 PM

This is an excellent contribution! (which I was too late discovering)
Many thanks for it.

I've been using UltraEdit for my coding... (with a modified lua wordfile)
It supports code formatting, autocomplete and code folding.
It has the same "problem" distinguishing between line and block comments though, which
I overcame by adopting this coding practice:
Instead of using -- for the line comment , I'm using ---
That keeps it readable and familiar to the eye, is still a valid lua comment and provides for
easy updating of existing lua files (some of which are huge) by just doing a mass search
replace of -- with --- and then of ---[[ with --[[
(I've put this in an UltraEdit macro actually so bringing new files in is 1-click affair)

I'll give this a try too though,
thx again

Beladona

11-26-05 10:20 AM

I thought of that too, but then none of the comments in the default blizzard lua files had their comments colored correctly. By using -- with a space afterwards, I found that most blizzard coded lua files were accurately colored. There were a few exceptions of course where even they did not use a space, but for the most part they did...

Beladona

12-09-05 03:53 PM

updated to API version 10900. This is not final, as this version is still on the test server. If any API changes take place between now and when it goes live, I will update the plugin again, otherwise it will remain as is.

I also corrected a NewDocument issue. When you create a lua script from the New File dialog, it would not open the default code provided by the plugin. This was corrected, and new lua documents should show some example code to get you started (and to showcase code color/highlighting as well.)

Post with any issues you find!

Esamynn

12-14-05 08:26 PM

What is the minimum version of Dreamweaver required for this? I have a copy of DW3 that I still use sometimes, but haven't bothered to upgrade. Is it too old?

Beladona

12-15-05 02:49 PM

dw3 is too old. I believe the minimum is Dreamweaver MX (the first one)

There are things not available in previous versions that this plugin uses...

Naiji

07-09-06 04:29 AM

This is probably one of the more useful little DW Extensions I've found. Thank you very much! :) I can't wait until you finish your proposed features, etc. I'd love to have the full XML/Lua library that's specific to WoW's engine available.

Cogwheel

08-04-06 11:57 AM

Quote:

Originally Posted by Beladona

you should look into DW8 -- they added a lot of enhancements to improve XML editing as well as XSL and XML handling. It is finally able to do correct stylesheet work for XML

I can't seem to get this extension to install in DW8. It gives me the error that MX or greater is required... :confused:

Beladona

08-04-06 12:24 PM

that is because MX or greater is required... sorry, but some of teh features, and code structure is exclusive to MX or greater.