WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   Dev Tools (https://www.wowinterface.com/forums/forumdisplay.php?f=41)
-   -   BETA - WoW Development Package ready for download. (https://www.wowinterface.com/forums/showthread.php?t=46712)

fRodzet 06-23-13 02:38 PM

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:
Quote:

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

Nibelheim 06-23-13 03:33 PM

Woo! :D

Dridzt 06-23-13 04:26 PM

Testing it on Sublime3, great job :) :banana:

fRodzet 06-23-13 05:44 PM

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.

jaliborc 06-23-13 06:16 PM

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.

fRodzet 06-23-13 06:18 PM

Quote:

Originally Posted by jaliborc (Post 280242)
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? :)

fRodzet 06-25-13 09:07 AM

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.

Rainrider 06-25-13 07:41 PM

1 Attachment(s)
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:
Quote:

###@### ~/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!

Dridzt 06-26-13 02:06 AM

1 Attachment(s)
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.

fRodzet 06-26-13 10:32 AM

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

Dridzt 06-26-13 12:05 PM

I'm not sure I understand the - edited in - question :o

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.

fRodzet 06-26-13 12:16 PM

Quote:

Originally Posted by Dridzt (Post 280394)
I'm not sure I understand the - edited in - question :o

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

watchout 06-26-13 04:27 PM

1 Attachment(s)
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. :p

fRodzet 06-26-13 05:36 PM

Quote:

Originally Posted by watchout (Post 280419)
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. :p

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.

watchout 06-26-13 06:20 PM

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

fRodzet 06-27-13 05:37 AM

Quote:

Originally Posted by watchout (Post 280424)
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 :)

fRodzet 06-30-13 01:08 PM

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)

fRodzet 06-30-13 01:18 PM

Quote:

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

Dridzt 06-30-13 04:08 PM

Last commit is a little broken for me :o

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.

fRodzet 06-30-13 05:13 PM

Quote:

Originally Posted by Dridzt (Post 280620)
Last commit is a little broken for me :o

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.

Dridzt 06-30-13 06:25 PM

Sorry I wasn't clear, I only picked the iPlastic scheme to make comparison easier.
The same issues are present with the WoWBeauty one.

Take your time, I think we don't need to be repeating with every post how much your work is appreciated.
There's no pressure here. :)

fRodzet 07-01-13 07:30 AM

Just updated it Dridzt :)

vBirke 07-02-13 12:18 PM

fRodzet is on vacation with some mates and won't be back till the 16th(2 weeks from now).

Nischi 07-04-13 05:15 PM

Okay so this looks great, but I have no idea how to use it, it says that I Should "Copy/Paste the extracted .zip file to your packages." But how do I do that? I've just begun developing addons so I don't know things that most take for granted I suppose. I've extracted the zip and its a lot of files ,but none that I can start with.

Dridzt 07-04-13 06:01 PM

Quote:

Originally Posted by Nischi (Post 280807)
Okay so this looks great, but I have no idea how to use it, it says that I Should "Copy/Paste the extracted .zip file to your packages." But how do I do that? I've just begun developing addons so I don't know things that most take for granted I suppose. I've extracted the zip and its a lot of files ,but none that I can start with.

This package is not an addon for the game.
It is a package for a specific text editor (like notepad but more advanced) that's useful to addon developers.
As a gamer it will offer you nothing.


If I misunderstood and you're interested in developing addons for WoW and using Sublime as your text editor then you can find the place to extract this package by opening your Sublime Text editor and going through Preferences -> Browse Packages (from the editor menus).
At the folder that will open you'll probably see some existing folders like <Package Control> or <User>.
Create a folder along-side those, name it <WoWDevelopment> (no angle brackets) and extract the package files in there.
It should be
Code:

'path_to_user_profile'\Packages\WoWDevelopment\Reference
                                              \Scheme
                                              \(bunch of files)

Then when you edit a .lua addon file using Sublime you can Ctrl+Shift+P (or Tools -> Command Palette if using the menu) and type WoW.
The top entry should allow you to select and apply the syntax highlighting.

If on the other hand you're interested in AddOns for World of Warcraft then
(a) welcome to the site :)
(b) have a look through the various addon categories
(c) take a look here for a handy guide about installing AddOns for WoW as well as this thread for links to other helpful info.

Nischi 07-05-13 02:07 AM

Oh great...I just made a fool of myself... I thought what you had was a whole package including Sublime. I understand from your answer that I of course need it installed to begin with...I'm so sorry. Thanks tho for your answers :)

And yes I'm new here, but only as a "developer" if you can call me that, I've been updating an old abandoned favorite of mine. As an addon user, I've been here for a long time, love the site :)

pelf 07-07-13 09:18 AM

I saw it in the dropdown, but you didn't select it. What happens when you choose an event name? What gets printed?

Also, excuse me if this was mentioned; I didn't see it. I see you've got plans for types. What about parameters to functions that must be one of a set of values?

Examples:
chatType in SendChatMessage
filter in UnitAura (Though, this one acts like bitwise flags.)

You could even support...

frameType in CreateFrame

...if only for the base UI types.

vBirke 07-07-13 11:09 AM

Quote:

Originally Posted by pelf (Post 280912)
I saw it in the dropdown, but you didn't select it. What happens when you choose an event name? What gets printed?

Also, excuse me if this was mentioned; I didn't see it. I see you've got plans for types. What about parameters to functions that must be one of a set of values?

Examples:
chatType in SendChatMessage
filter in UnitAura (Though, this one acts like bitwise flags.)

You could even support...

frameType in CreateFrame

...if only for the base UI types.

I think fRodzet is planning on adding this aswell :) He will get back to you when his back home :)

dotorion 07-14-13 04:19 AM

Installed, put in the correct folder, and removed the -master from the folder name.

I get an error when starting up ST2:


This was on a fresh install of Sublime Text 2 x64 on Windows 7 Prof. x64 if that helps.

In any case, thanks for working on this :D

Dridzt 07-14-13 04:57 AM

Quote:

Originally Posted by dotorion (Post 281167)
Installed, put in the correct folder, and removed the -master from the folder name.

I get an error when starting up ST2:


This was on a fresh install of Sublime Text 2 x64 on Windows 7 Prof. x64 if that helps.

In any case, thanks for working on this :D

Shorten your path.
Rename <SublimeWoWDevelopment> in your packages to <WoWDev> for example.
It's probably you hitting the path limit on that amazing DOS core of Windows64bit.

Stanzilla 09-15-13 08:05 PM

Did he die?

Stanzilla 01-09-14 06:26 PM

Pretty sad that his not developed anymore :(

MoonWitch 01-09-14 07:09 PM

It's not too complex, just need to update to 5.4 and such. Make sure we've not missed events.

Also is the wow chocolate theme used often? (That's the one thing that annoys me)

Stanzilla 01-09-14 10:15 PM

I found some bugs, too. Like for example it does not detect it as a concat when you don't have a space between the dots and the string.

Code:

frame:RegisterUnitEvent("UNIT_PET", unit.."pet")

fgprodigal 11-04-14 08:57 AM

Quote:

Originally Posted by Stanzilla (Post 289479)
I found some bugs, too. Like for example it does not detect it as a concat when you don't have a space between the dots and the string.

Code:

frame:RegisterUnitEvent("UNIT_PET", unit.."pet")

in file 'WoW Lua.tmLanguage'
Code:

<dict>
        <key>match</key>
        <string>\b[^,\[\](){}\s]+\b</string>
        <key>name</key>
        <string>variable.parameter.lua</string>
</dict>

I added '\.' into regex, like
Code:

<dict>
        <key>match</key>
        <string>\b[^,\.\[\](){}\s]+\b</string>
        <key>name</key>
        <string>variable.parameter.lua</string>
</dict>


Resike 06-06-17 08:19 AM

Anyone has an older working version of this? Maybe we could pick it up or something, i can't find a good linter package.

Edit: I just noticed that i forked this, LUL:
https://github.com/Resike/WoWDevelopment

We have hope.

Aftermathhqt 06-06-17 04:45 PM

Damn this is awesome!

Layback_ 06-06-17 07:37 PM

Would this work on Sublime Text 3, not only 2?

Resike 06-07-17 12:45 AM

Quote:

Originally Posted by Layback_ (Post 323656)
Would this work on Sublime Text 3, not only 2?

Yep. 11char

Layback_ 06-07-17 02:35 AM

Quote:

Originally Posted by Resike (Post 323659)
Yep. 11char

Awesome :)!!

One more question.

Are you planning to maintain this project in fRodzet's stead?

Resike 06-07-17 04:47 AM

Quote:

Originally Posted by Layback_ (Post 323660)
Awesome :)!!

One more question.

Are you planning to maintain this project in fRodzet's stead?

Yep. I think it will be ready today. Except the parametering for the API calls and some newer widgets and their functions, that will be a pain in the ass.

Resike 06-07-17 04:53 AM

I'm not sure what should i do with the removed functions? Keep them, remove them, move them into another folder and rename them so they won't get loaded.

Also if anyone know a hack to sort lines by syntax color that would be really helpful.

Resike 06-07-17 01:47 PM

Added ~10.000 new API functions (no parameters), and every other global reference besides global strings. C_ functions are not handled properly yet, and there are still some missing widgets.


All times are GMT -6. The time now is 10:50 AM.

vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI