Thread Tools Display Modes
06-23-13, 02:38 PM   #1
fRodzet
A Flamescale Wyrmkin
Join Date: Mar 2013
Posts: 114
WoW Development Package for Sublime Text.

Greetings,

My Sublime Text 2 WoW Development package is now available for download. It is in its beta stage and i have not added a readme file to the package yet. It will soon be online @ package control, but till then you can download it here:

github

Installation notes:

1, Click the Download Zip.
2, Extract the .zip file.
3, Copy/Paste the extracted .zip file to your packages. (Open Sublime Text.... Click Preferences -> Browse Packages... -> Paste the extracted folder here. You might have to remove the "-master" from the folders name.
4, Bring up the command pallette (CTRL + SHIFT + P), type: WoW Lua and press enter.

If you want the same settings as i, go to Preferences -> Settings - User -> Copy/Paste the following:
{
"color_scheme": "Packages/SublimeWoWDevelopment/Scheme/WoWBeauty - Chocolate.tmTheme",
"font_face": "Consolas",
"font_size": 10,
"ignored_packages":
[
"Vintage"
]
}
How to use:

www.youtube.com/watch?v=heX7U_UM0Ws

Upcoming features:

1, Improved syntax highlighting - Already working on it, detects global variables, has a more feature rich highlighting system.
2, Improved auto-completion - Newest API support + easier to use system. Already working on it.
3, Available through package control.
4, WoWBeauty - Vanilla theme aswell as a WoWBeauty - Classic black and a classic white.
5, Library support - WoW Ace and others.
6, XML and TOC syntax highlighting - in progress.
7, Normal Quoted Strings will be one color, while quoted strings like "OnAnimFinished" will have its own special quote highlight. - Already added, but not yet tested.
8, Syntax Highlighting for Events.
9, Additional completions - such as backdrop with full tab support, types(http://wowprogramming.com/docs/api_types)
10, Clean way to detect where stuff belong using the CTRL + SHIFT + ALT + P command.
11, More.


please post any bugs. and tell me if you have any requests or suggestions.

Just a little update on how to use:
1, When you type something, e.g: GameTooltip:SetOwner, in order to get the exact match avoid using : but simply type GameTooltipSetOwner and press tab. If you use the : only the SetOwner will be matched, so the first tab stop will not be GameTooltip but SetOwner.

In case Widget's also has return values, you will not have to type: _GameTooltip:IsUnit, simply just provide: _IsUnit which will match: isUnit = GameTooltip:IsUnit("unit")

2, Using an _ before typing anything, indicates that what you are about to type includes a return value, e.g: UnitAura will post the following - UnitAura(arguments) while _UnitAura will post all-the-return-values = UnitAura(arguments).

3, If you find the above examples somewhat annoying to use and you prefer to use the old style - simply type it as you would: local some_return_value = frame:CreateTexture, now as you press tab only CreateTexture will be matched and you'll get the following: local some_return_value = frame:CreateTexture(arguments)

So you can pretty much select any style you'd like. Some prefer to just write local _CreateFrame and tab to get the following: local frame = CreateFrame(arguments) while other prefer to write local frame = CreateFrame tab.

4, The → arrow in the dropdown menu shown when typing, means that the function has more arguments than the dropdown menu can show. so e.g: SetOwner(frame, →) means that the first argument is a frame and that there is an additional 1 or more arguments.

Last edited by fRodzet : 06-30-13 at 01:30 PM.
  Reply With Quote
06-23-13, 03:33 PM   #2
Nibelheim
local roygbi-
 
Nibelheim's Avatar
AddOn Author - Click to view addons
Join Date: Jan 2010
Posts: 1,600
Woo!

Last edited by Nibelheim : 06-23-13 at 04:32 PM.
  Reply With Quote
06-23-13, 04:26 PM   #3
Dridzt
A Pyroguard Emberseer
 
Dridzt's Avatar
AddOn Author - Click to view addons
Join Date: Nov 2005
Posts: 1,359
Testing it on Sublime3, great job
  Reply With Quote
06-23-13, 05:44 PM   #4
fRodzet
A Flamescale Wyrmkin
Join Date: Mar 2013
Posts: 114
Updated:

Added Global and Local variable detection for functions.

Use CTRL + SHIFT + ALT + P when you have marked a thing, e.g the variable for a function. At the bottom you'll see where it belongs to - i'll clean this up so you'll se a better understanding later. But for now if you create e.g a global, you can simply mark the variable that becomes highlighted and press CTRL + SHIFT + ALT + P - this will tell you what scope it belongs to, this can help you keep track on whether a thing is deprecated, requires a hardware event, is a local variable or what do i know.

NOTE: HW, Deprecated, PROTECTED, etc is not yet added to the scopes. This is another upcoming feature.

Last edited by fRodzet : 06-23-13 at 05:51 PM.
  Reply With Quote
06-23-13, 06:16 PM   #5
jaliborc
A Chromatic Dragonspawn
 
jaliborc's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2007
Posts: 196
Awesome!

One comment: maybe you should rename the github repo to something in the likes of "Sublime Text - WoW Development", to make it clear for people it is a sublime text package. Will also help google searches.
  Reply With Quote
06-23-13, 06:18 PM   #6
fRodzet
A Flamescale Wyrmkin
Join Date: Mar 2013
Posts: 114
Originally Posted by jaliborc View Post
Awesome!

One comment: maybe you should rename the github repo to something in the likes of "Sublime Text - WoW Development", to make it clear for people it is a sublime text package. Will also help google searches.
Yeah i thought of that aswell, i figured that you can actually name it something with sublime and ask for it to be changed to just WoW Development @ package control. So that on GitHub it will say: SublimeText - WoW Development and in the command pallette it just says: WoW Development. But as mentioned its still in Beta stage and i'm not even sure if WoW Development will be the appropriate name for it.

For the readme file i'd like to ask if someone could help me translate my English to real English?
  Reply With Quote
06-25-13, 09:07 AM   #7
fRodzet
A Flamescale Wyrmkin
Join Date: Mar 2013
Posts: 114
Highly improved syntax highlighting in two days.

The features next version includes:

Local and Global syntax highlighting for anything.
Parameters "( )" syntax highlighting, which means everything inside a bracket will be highlighted properly.
Improved Auto-Completion and latest API's added.
Syntax Highlighting for Deprecated functions.
  Reply With Quote
06-25-13, 07:41 PM   #8
Rainrider
A Firelord
AddOn Author - Click to view addons
Join Date: Nov 2008
Posts: 454
Awesome! I just took a look at the Reference folder - have you created every file there by hand?

I'm not sure whether you'd like to have feedback here or over at github, I'll post here for the moment.

Look at the coloring of CreateFrame at line 112 in the attachment. This happens because of the use of GetName().

Also local variables are colored properly when using them as a call reference but not when used as a table (or by themselves i.e. for later assignment) (not quite sure if I'm using the proper terminology) as you can see in lines 113 to 119.

Also, is there a way to separate the lua api from the wow api and color them differently? It helps when learning the language through programming for wow.

I also got this when cloning the repository:
###@### ~/AppData/Roaming/Sublime Text 2/Packages
$ git clone https://github.com/frodzet/WoWDevelopment.git
Cloning into WoWDevelopment...
remote: Counting objects: 5337, done.
remote: Compressing objects: 100% (73/73), done.
remote: Total 5337 (delta 5274), reused 5318 (delta 5264)Receiving objects: 92%
Receiving objects: 93% (4964/5337), 460.00 KiB | 166 KiB/s
Receiving objects: 100% (5337/5337), 517.26 KiB | 166 KiB/s, done.
Resolving deltas: 100% (5274/5274), done.
error: unable to create file Reference/Widget Reference/Widget API/Model-SetLigh
t(enabled, omni, dirX, dirY, dirZ, ambIntensity [, ambR [, ambG [, ambB [, dirIn
tensity [, dirR [, dirG [, dirB]]]]]]]).sublime-snippet (No such file or directo
ry)
Thaks a ton for all the effort you are putting in this!
Attached Thumbnails
Click image for larger version

Name:	st2 wow lua 1.png
Views:	702
Size:	10.9 KB
ID:	7784  
  Reply With Quote
06-26-13, 02:06 AM   #9
Dridzt
A Pyroguard Emberseer
 
Dridzt's Avatar
AddOn Author - Click to view addons
Join Date: Nov 2005
Posts: 1,359
If this is the highlight for globals it looks like the scheme doesn't understand colon or dot notation for functions.

It highlights the whole thing as global.
Note that 'addon' in the partial screenshot I attached is in fact a local reference on top of the method being scoped under addon.
The same happens in the case of
Code:
local functions = {}
function functions.myFunc() -- < highlighted as global
  -- blah
end
Edit
When using the default Lua syntax (or with https://github.com/rorydriscoll/LuaSublime) I don't have this issue so that might help you spot the difference.
Attached Thumbnails
Click image for larger version

Name:	sub3wowlua.png
Views:	725
Size:	8.8 KB
ID:	7785  

Last edited by Dridzt : 06-26-13 at 10:45 AM.
  Reply With Quote
06-26-13, 10:32 AM   #10
fRodzet
A Flamescale Wyrmkin
Join Date: Mar 2013
Posts: 114
Thanks Dridzt and Rainrider - fixing it right away

To rainrider - if you read the post just before the one you posted you'll see that the next version have a fix for this

And yes Rainrider i created every single file by hand Creating a Sublime-snippet file, using CTRL + SHIFT + S to "save as" and then creating a new file, repeat.

I simply forgot to use a "$" indicating that the line has ended :P Anyways - i'll have to re-write all the syntax highlighting, or not have to - but i do it just to make it more clear to myself aswell


And to you dridzt, i accidently made a match instead of a begin/end scope.

Could you Dridzt maybe post the full function you are trying to achieve - then i can work from there

Last edited by fRodzet : 06-26-13 at 11:17 AM.
  Reply With Quote
06-26-13, 12:05 PM   #11
Dridzt
A Pyroguard Emberseer
 
Dridzt's Avatar
AddOn Author - Click to view addons
Join Date: Nov 2005
Posts: 1,359
I'm not sure I understand the - edited in - question

User global like
function myFunc() end -- should be highlighted as a global. (scheme of 'hey this is global are you sure you intended it?')
functions = {} -- highlighted as global.
function functions.myFunc() end -- myFunc is scoped under functions table, not highlighted as global
function functions:myFunc() end -- also scoped, not highlighted as global

Basically expected for me would be that dot or colon in function 'name' prevents it from being highlighted as a global.
  Reply With Quote
06-26-13, 12:16 PM   #12
fRodzet
A Flamescale Wyrmkin
Join Date: Mar 2013
Posts: 114
Originally Posted by Dridzt View Post
I'm not sure I understand the - edited in - question

User global like
function myFunc() end -- should be highlighted as a global. (scheme of 'hey this is global are you sure you intended it?')
functions = {} -- highlighted as global.
function functions.myFunc() end -- myFunc is scoped under functions table, not highlighted as global
function functions:myFunc() end -- also scoped, not highlighted as global

Basically expected for me would be that dot or colon in function 'name' prevents it from being highlighted as a global.
Fixed soon, ty

As you might know, i'm not that good at programming, and i don't understand all Lua/WoW functions etc. So i'm glad that you are here to point out what would be wrong and what is right

Last edited by fRodzet : 06-26-13 at 12:24 PM.
  Reply With Quote
06-26-13, 04:27 PM   #13
watchout
A Fallenroot Satyr
Join Date: Mar 2008
Posts: 20
Just saw this thread here... Great work, again!


Not sure how the highlighting works exactly though, for example, why are some function arguments, like "self" tealish while others are not? (see attachment)


ps: after seeing the contents of the package, I'm happy the packages folder is on my SSD.
Attached Thumbnails
Click image for larger version

Name:	slt01.png
Views:	637
Size:	19.0 KB
ID:	7786  
  Reply With Quote
06-26-13, 05:36 PM   #14
fRodzet
A Flamescale Wyrmkin
Join Date: Mar 2013
Posts: 114
Originally Posted by watchout View Post
Just saw this thread here... Great work, again!


Not sure how the highlighting works exactly though, for example, why are some function arguments, like "self" tealish while others are not? (see attachment)


ps: after seeing the contents of the package, I'm happy the packages folder is on my SSD.
This is because its a BETA version and uses the standard lua highlighting for self. The updated version will include the highlighting texture inside parameters, using the variable.parameter.lua scope. I will have a fixed version anytime soon

Also tested the program @ my laptop using a 5400rpm with 16mb cache HDD, its not working as efficient as on my 840 Pro Series in RAID 0, however its working with no major latency. This was the reason for switching from std .sublime-completions files to .sublime-snippet files, as completion files accepts any case of letters and brings up all 5000 api's at once, while snippets only trigger those matching the first letter and recognizes the difference between capital letters and lower letters.

Last edited by fRodzet : 06-27-13 at 05:18 AM.
  Reply With Quote
06-26-13, 06:20 PM   #15
watchout
A Fallenroot Satyr
Join Date: Mar 2008
Posts: 20
Of course, and I was just confused, not criticizing. Also I just realised that the default Lua style does it the same way - still not sure why though
  Reply With Quote
06-27-13, 05:37 AM   #16
fRodzet
A Flamescale Wyrmkin
Join Date: Mar 2013
Posts: 114
Originally Posted by watchout View Post
Of course, and I was just confused, not criticizing. Also I just realised that the default Lua style does it the same way - still not sure why though
I think its because self is a basic expression whether you work with basic lua, wow, or w.e
  Reply With Quote
06-30-13, 01:08 PM   #17
fRodzet
A Flamescale Wyrmkin
Join Date: Mar 2013
Posts: 114
Updated!

Not fully working Global Detection, but functions should detect global and local properly.
Improved Parameters Highlighting - should work properly.

Screenshot Twilight ColorScheme:
(RainRiders Example)


Screenshot WoWBeauty ColorScheme:
(RainRiders Example)

Last edited by fRodzet : 06-30-13 at 01:11 PM.
  Reply With Quote
06-30-13, 01:18 PM   #18
fRodzet
A Flamescale Wyrmkin
Join Date: Mar 2013
Posts: 114
I also got this when cloning the repository:
###@### ~/AppData/Roaming/Sublime Text 2/Packages
$ git clone https://github.com/frodzet/WoWDevelopment.git
Cloning into WoWDevelopment...
remote: Counting objects: 5337, done.
remote: Compressing objects: 100% (73/73), done.
remote: Total 5337 (delta 5274), reused 5318 (delta 5264)Receiving objects: 92%
Receiving objects: 93% (4964/5337), 460.00 KiB | 166 KiB/s
Receiving objects: 100% (5337/5337), 517.26 KiB | 166 KiB/s, done.
Resolving deltas: 100% (5274/5274), done.
error: unable to create file Reference/Widget Reference/Widget API/Model-SetLigh
t(enabled, omni, dirX, dirY, dirZ, ambIntensity [, ambR [, ambG [, ambB [, dirIn
tensity [, dirR [, dirG [, dirB]]]]]]]).sublime-snippet (No such file or directo
ry)
Try again now and report back to me if you still have the same problem.. I tried to clone the rep to my laptop aswell as my iMac, seems to work just fine.. if the error still occours i'll remove the file and re-upload it

EDIT: It was a bug with the name..

Last edited by fRodzet : 06-30-13 at 01:31 PM.
  Reply With Quote
06-30-13, 04:08 PM   #19
Dridzt
A Pyroguard Emberseer
 
Dridzt's Avatar
AddOn Author - Click to view addons
Join Date: Nov 2005
Posts: 1,359
Last commit is a little broken for me

Some screenshots to illustrate.
Left side is Sublime3 with latest package, Right side is LDT 1.0 (Koneki Lua Development Tools)
First side by side is my targetAssist addon, second one my TalentSwap addon (here are more obvious issues, a special characters escape pattern I have near the top breaks highlighting for the rest of the file)
But you can also see on the first comparison how LDT does local vs global (local is normal grey, global is bold black)
Off-topic, LDT doesn't have a Wow API highlight package but it does Lua highlighting, code folding, formatting etc better than any editor I've used.

Last edited by Dridzt : 06-30-13 at 04:18 PM.
  Reply With Quote
06-30-13, 05:13 PM   #20
fRodzet
A Flamescale Wyrmkin
Join Date: Mar 2013
Posts: 114
Originally Posted by Dridzt View Post
Last commit is a little broken for me

Some screenshots to illustrate.
Left side is Sublime3 with latest package, Right side is LDT 1.0 (Koneki Lua Development Tools)
First side by side is my targetAssist addon, second one my TalentSwap addon (here are more obvious issues, a special characters escape pattern I have near the top breaks highlighting for the rest of the file)
But you can also see on the first comparison how LDT does local vs global (local is normal grey, global is bold black)
Ty for sharing, i'll take a look into how it operates.. However as mentioned, mine only works for functions atm, like: function some_func_name(some_arg) <- Global. function something:something(arg) <- Local. local function some_func_name(some_arg) <- local... This is also only supported for the Chocolate scheme. I however like the idea of bolding and making globals black. In order to make the program detect every kind of global/local is a longer task, working on it already.

I see the problem on the second picture, i might have forgotten an escape character or forgot to put in or remove a boundary or something. Imma take a look into it tomorrow.

Last edited by fRodzet : 06-30-13 at 05:45 PM.
  Reply With Quote

WoWInterface » Developer Discussions » Dev Tools » BETA - WoW Development Package ready for download.

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