Thread Tools Display Modes
05-27-05, 07:37 PM   #1
Beladona
A Molten Giant
 
Beladona's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2005
Posts: 539
Dreamweaver Code Colors

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...

Download is located at http://www.wowinterface.com/download...fo.php?id=3971 and I will support the plugin as well as announce updates in this thread...

Last edited by Beladona : 05-28-05 at 08:51 AM.
  Reply With Quote
05-30-05, 01:49 AM   #2
Beladona
A Molten Giant
 
Beladona's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2005
Posts: 539
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
--------------------------------------------------------------

* Version 1.1.0 - added support for lua within xml files
* Version 1.0.0 - initial release

-------------------------------------------------------------
You can find the updated version at http://www.wowinterface.com/download...fo.php?id=3971
  Reply With Quote
09-20-05, 10:42 PM   #3
Beladona
A Molten Giant
 
Beladona's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2005
Posts: 539
Pending Release:

Dreamweaver Extension (supports Dreamweaver MX and higher)

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.

------------------------------------------------------------------------
Current Features
------------------------------------------------------------------------
* Adds LUA as a document type within Dreamweaver
* Adds Color Coding for LUA code. These apply to lua documents, and xml documents
* Adds an XML tag library for the WOW XML elements
* Adds code hints that draw from the XML Tag Library while editing WOW XML files

--------------------------------------------------------------
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)

--------------------------------------------------------------
Version History
--------------------------------------------------------------
* Version 1.4.0 (1700) - updated API to 1700, changed extension name
* Version 1.3.0 (1500) - added code hints and tag library for XML files
* Version 1.2.0 (1500) - fix (workaround) for the --[[ comments ]] not being colored
* Version 1.1.0 (1500) - added support for lua within xml files
* Version 1.0.0 (1500) - initial release

Last edited by Beladona : 09-21-05 at 09:41 AM.
  Reply With Quote
09-20-05, 10:58 PM   #4
Beladona
A Molten Giant
 
Beladona's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2005
Posts: 539
Need to obtain some files from my laptop tomorrow, at which time I can compile the updated extension and upload it. Sorry for the delay, I should have it uploaded no later than 9am EST

Just to give you an diea of where I hope to take this extension:

Already added code coloring definitions for LUA code (WOW specific, not the full 5.0 LUA spec)

Added LUA as a supported document type within Dreamweaver

Added tag library for the XML DOM (WOW specific) complete with code hinting

* Ability to see context and property menu items for most elements. If it has configurable options, it should be visible in the properties pane when clicking in that element.

* Function List panel that dynamicaly displays all functions in a LUA script, and allows you to jump to that function with a single click within the list panel.

* EXPERIMENTAL * maybe add a LUA interpreter as an integrated external "validator" of your lua scripts.

* Add a Tag Library for the LUA scripting API with code hinting

* 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
  Reply With Quote
09-21-05, 08:22 AM   #5
Kaelten
Jack's raging bile duct
 
Kaelten's Avatar
Featured
Join Date: May 2005
Posts: 782
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?
__________________
WowAce.com & CurseForge.com Adminstrator
Developer of Ace3, OneBag3, and many other addons and libraries
Project lead and Mac developer for the Curse Client

Anyone that needs what they want
And doesn't want what they need
I want nothing to do with
  Reply With Quote
09-21-05, 09:39 AM   #6
Beladona
A Molten Giant
 
Beladona's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2005
Posts: 539
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.
Attached Thumbnails
Click image for larger version

Name:	dwlua_example.jpg
Views:	4774
Size:	43.1 KB
ID:	192  

Last edited by Beladona : 09-21-05 at 09:47 AM.
  Reply With Quote
09-21-05, 10:48 AM   #7
Beladona
A Molten Giant
 
Beladona's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2005
Posts: 539
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.
  Reply With Quote
10-14-05, 09:04 AM   #8
KalZakath
A Murloc Raider
Join Date: Oct 2005
Posts: 4
Thumbs up

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

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!
  Reply With Quote
10-14-05, 10:53 AM   #9
Beladona
A Molten Giant
 
Beladona's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2005
Posts: 539
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
  Reply With Quote
10-20-05, 02:28 PM   #10
KalZakath
A Murloc Raider
Join Date: Oct 2005
Posts: 4
Thumbs up

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.
  Reply With Quote
10-21-05, 06:48 AM   #11
Beladona
A Molten Giant
 
Beladona's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2005
Posts: 539
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...
  Reply With Quote
10-25-05, 02:40 AM   #12
KalZakath
A Murloc Raider
Join Date: Oct 2005
Posts: 4
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
  Reply With Quote
11-25-05, 05:22 PM   #13
Dridzt
A Pyroguard Emberseer
 
Dridzt's Avatar
AddOn Author - Click to view addons
Join Date: Nov 2005
Posts: 1,359
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
  Reply With Quote
11-26-05, 10:20 AM   #14
Beladona
A Molten Giant
 
Beladona's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2005
Posts: 539
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...
  Reply With Quote
12-09-05, 03:53 PM   #15
Beladona
A Molten Giant
 
Beladona's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2005
Posts: 539
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!
  Reply With Quote
12-14-05, 08:26 PM   #16
Esamynn
Featured Artist
Premium Member
Featured
Join Date: Jan 2005
Posts: 395
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?
  Reply With Quote
12-15-05, 02:49 PM   #17
Beladona
A Molten Giant
 
Beladona's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2005
Posts: 539
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...
  Reply With Quote
07-09-06, 04:29 AM   #18
Naiji
Guest
Posts: n/a
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.
  Reply With Quote
08-04-06, 11:57 AM   #19
Cogwheel
Sans Poisson
 
Cogwheel's Avatar
AddOn Author - Click to view addons
Join Date: Oct 2005
Posts: 237
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...
__________________
[SIGPIC][/SIGPIC]
  Reply With Quote
08-04-06, 12:24 PM   #20
Beladona
A Molten Giant
 
Beladona's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2005
Posts: 539
that is because MX or greater is required... sorry, but some of teh features, and code structure is exclusive to MX or greater.
  Reply With Quote

WoWInterface » Developer Discussions » Dev Tools » Dreamweaver Code Colors

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off