WoWDevelopment Sublime Package
I updated the auto completion and syntax highlighting for WoW API Sublime package created by fRodzet, original forum here.
So whats new?
The syntax highlighing is a lot smarter and it does not depends on the default lua syntax at all. The XML one still reuses everything from the default XML syntax. The Syntax have:
You install it and use it the same way as before. (Sublime Package support coming soon™) After i dump the snippet files into one big sublime-completions file, it would be nice if you guys could help me parametering the remaining API functions. Because there are a lot of them! (16k files) Please report back any weirdness. Download |
I LOVE IT!!
The reason that I moved to Visual Studio Code was because there was an up-to-date WoW bundle created by a user. But now I can stick to ST3 :banana:!! btw, could I cautiously ask you to add a simple syntax highlight for TOC files if you some spare time? Such as:
|
Quote:
But i can put that into the package so it'll be complete. |
Open a lua file, go to: Tool -> Build System -> select: WoW Global Finder Every time you run the build (ctrl+b) it will list every global variables lines in the Sublime console window from that file. |
- Updated for 7.2.5.
- Remove every files, since there was a lot of changes in the file dir tree. |
Okay team, the package is ready for your help.
Most work lies in the API Reference folder: 1. Pick an API from API Reference (parameterless). 2. Parameter it with arguments then move the snippet to API Reference, and delete it from API Reference (parameterless). (Would be nice to keep stuff alphabetically.) 4. If you find a function which should not be on the autocomplete list, Global Blizzard FrameXML/AddOn/GlueXML or any other Interface files, then move it to API Reference (blizzard) and delete it from API Reference (parameterless) (This file will be reviewed, saved and removed later.) 5. (If you would like to add stuff to the Widget References, just add them into the files directly. (Widget API, Widget Handlers)) How to parameter an API? This is how a raw API will look like: Code:
{ The contents is what the autocomplete will print out $1 is where the cursor will land first, $2 for second, $3 for third...$0 is the last cursor position. If you want to highlight a whole words then it should looks like this: ${1:unit}, ${2:value}, \"${3:stringWithNoQuotationMark}\", ${4:\"stringWithQuotationMark\"}, ${5:[\"stringWithQuotationMarkInsideBrackets\"]} So after we search for AbbreviateLargeNumbers in the Blizzard Interface code, we will see it accepts a single string value, and returns a formatted string. So we modify the code like this: Code:
{ 1. " needs to be escaped to \". 2. Tabs and new lines needs to be escaped like \t and \n. 3. Space, (, ), [, ], and , does not need escaping. Since AbbreviateLargeNumbers has a return value that means we also want to make another snippet with _ added in front of it, which autocompletes it with the return value like this: Code:
{ It's very-very important to keep in mind if you make any typo in the .sublime-completions file than the whole file will not get loaded! Also you have to reopen Sublime sometimes after you made some changes in the completions files else you won't see the effect of the changes you made. I plan to do 10-20 API functions per day myself. Would be nice to have some other volunteers too. The best would be if everyone could take care a whole letter of APIs, then there wouln't be any collisions. You can fork/pull request, upload files, post here, send me a mail, send me a mail ingame, send me a pidgeon, i don't care as long as it's copyable/accessible. |
I'm not sure if I'd be helpful, but I'll try to give it a shot.
Btw, would there be any style guide that you are expecting from us to follow? |
I tried this out for a bit and it's quite nifty.
That said, your global functions scope will tag a block such as this: Lua Code:
With that having been noted, why even include local/global as a highlighted scope in the syntax? Isn't that the purpose of the global finder? |
Quote:
The better solution would a script which reads the whole file, collect all functions, and marks the global ones somehow if thats even possible. |
Quote:
|
Quote:
|
Quote:
Maybe we can just combine p3lims method which highlight stuff on the view, and the global finder itself. However this probably means that we need to rewrite the global finder to python and parse that through the current file. And my python knowledge is not that good. At least i don't think we can pass the global finder tables to another python script directly, i could be wrong tho. |
Here's what I've got so far :p
https://pastebin.com/UqzfiqzQ (I'm not yet confident with GitHub, so................) Referred from: |
Quote:
SublimeLinter handles the indicators, and luacheck tells it what to indicate and where via the package in my previous post. It's on the user to install and set up the pieces, which imo is well worth it. |
Quote:
|
Quote:
The goal would be to get rid of some functions so the autocompete could be more efficient and faster. And removing those blizzard functions would be the best solution, since authors don't really use those. |
Quote:
|
Quote:
|
Resike asked me on IRC to make something for highlighting globals, could look like this:
(Yes, io and arg should be highlighted, this was just an example while I work out the kinks) The only downside is that you'd have to have Lua installed (it don't run Lua scripts, but it requires the Lua compilator to find the globals properly). |
Quote:
The actual luacheck binary can be installed in a few ways, all of which are in the GitHub README. Two of these methods will require you to install a lua interpreter, but they also have a windows .exe that bundles everything needed. That said, my original main point was that how locals and globals are highlighted should be determined by the user and not a static part of the syntax. |
All times are GMT -6. The time now is 12:46 AM. |
vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI