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:
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. |
Woo! :D
|
Testing it on Sublime3, great job :) :banana:
|
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. |
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. |
Quote:
For the readme file i'd like to ask if someone could help me translate my English to real English? :) |
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. |
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:
|
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 = {} 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. |
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 :) |
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. |
Quote:
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 :) |
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 |
Quote:
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. |
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 :)
|
Quote:
|
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) |
Quote:
EDIT: It was a bug with the name.. :) |
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. |
Quote:
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. |
All times are GMT -6. The time now is 01:26 PM. |
vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI