GithubHelp home page GithubHelp logo

septh / vscode-wow-bundle Goto Github PK

View Code? Open in Web Editor NEW
75.0 11.0 21.0 4.77 MB

World of Warcraft addon developper tools for VS Code

Home Page: https://marketplace.visualstudio.com/items?itemName=Septh.wow-bundle

vscode lua-language wow world-of-warcraft addon

vscode-wow-bundle's Introduction

wow-bundle for VS Code

The MIT License GitHub

This World of Warcraft addon developer toolset for VS Code includes an improved Lua language grammar with WoW API knowledge, a .toc file grammar, colorization for both .lua source and .toc files, and more.

Notice

  • wow-bundle is NOT a generic Lua colorizer, it is closely bound to WoW specificities and is not adapted to other Lua environments. Therefore, you may want to disable this extension when working on non-WoW Lua projects.

Warning

  • With WoW 7.3, Blizzard removed the 3 files I used to maintain wow-bundle (namely GlobalAPI.lua, WidgetAPI.lua and Events.lua from the Helix directory). Therefore, I cannot guarantee any longer that the bundle is 100% accurate with respect to the lastest WoW API.

Features

  • Full (I hope...) WoW 8.0.1 (Build 28153) API
  • Includes a bunch of useful code snippets, thanks to m4xc4v413r4
  • Improved Lua 5.1 grammar with World of Warcraft's built-in Lua interpreter specificities
  • Extensive FrameXML widgets and Lua library support
  • .toc file colorization
  • Four dedicated color themes based on VS Code's default themes: Light+, Dark+, Monokai and Monokai Dimmed

Grammars

> Lua 5.1 language

wow-bundle replaces VS Code's built-in Lua language grammar. Changes worth noticing are:

  • OO-style string functions support, ie. string.upper(mystring), mystring:upper() and even ("somestring"):upper() are supported!
  • Full metamethods support
  • Quoted string constants as consumed or returned by the collectgarbage(), date() and type() functions and the __mode() metamethod
  • Better character escapes inside strings: Unicode entities, decimal and hexadecimal values and control chars

> World of Warcraft API

wow-bundle's Lua grammar also tags a bunch of WoW-related stuff:

  • Blizzard's extensions to the Lua language like [table.]wipe(), strjoin(), etc.
  • World of Warcraft API functions, with (poor, honestly) support for functions that can't be called while in combat and functions that can be called only from secure code
  • WoW Library functions written in Lua (mostly used by UI code)
  • Global objects like UIParent, GameFontNormal and such
  • Global variables like HIGHLIGHT_FONT_COLOR_CODE, UIDROPDOWNMENU_INIT_MENU and such
  • Widgets methods like :AddLine(), :SetTexture() and such
  • Common function parameters like 'CheckButton', 'BOTTOMLEFT', 'OVERLAY', 'player' and such
  • Widgets event handler names like 'OnEnter', 'OnShow' and such
  • Game events like 'PLAYER_ENTERING_WORLD', 'VARIABLES_LOADED' and such
  • Removed and/or deprecated stuff in the API

lua

> Toc files

Also included is a simple grammar for .toc files with support for keywords (like ## Interface, ## Author and such) and X-keywords (like ## X-Date, ## X-Website and such)

toc

Colorization

All VS Code themes should word fine with wow-bundle as long as they follow the standard scope naming convention.

However, for further colorization granularity, wow-bundle also includes four specific theme based on VS Code's default themes and called Light+ (WoW), Dark+ (WoW), Monokai (WoW) and Monokai Dimmed (WoW). To choose one of these themes, open the Color Theme picker with File > Preferences > Color Theme (or Code > Preferences > Color Theme on Mac).

themes

wow-bundle's themes do not interfere with VS Code default colors for Lua or any other language you may use.

New since 1.0.1: I do however add italics to ALL comments and underline to invalid/deprecated keywords. Should you whish to disable this feature, set the following setting into VS Code settings:

"editor.tokenColorCustomizations": {
    "comments": {
        "fontStyle": ""
    }
}

New since 1.0.7: No more underline for invalids, not everybody likes it.

Known Issues

These are the currently known issues with wow-bundle. Should you whish to collaborate to the projet and help resolve these issues, you're welcome to submit a PR on Github.

  • Because Blizzard's FrameXML code exposes hundreds of global functions, objects and variables, it is impossible to support them all. Therefore, only a selection of the most frequently used identifiers is supported. Please open an issue on Github if you need to add more.
  • Game events and widgets script handlers are still shown as regular strings. I'm looking for a way to make them stand appart. - Fixed in 1.0.4

Found an issue not listed here? Head up to Github and open an issue!

TODOs (and mayhaps)

  1. Fix above issues
  2. Add code snippets
  3. Support XML declarations too (low on my priority list, though)
  4. Support VS Code light themes? Support all standard VS Code themes I'm done with themes - If you need more, just ask, I'll consider it
  5. Linting anyone?
  6. Or maybe code formating?
  7. IntelliSense support would be great too (I have no idea where to start, though)
  8. Add support for popular libraries like LibStub, Ace3, LibDataBroker...?

Release notes

See Changelog.md.

vscode-wow-bundle's People

Contributors

m4xc4v413r4 avatar septh avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

vscode-wow-bundle's Issues

Change lineHighlight color

Is it possible to add changing the lineHighlight color for any of the color themes? I'mnot a fan of the box outline and would prefer a solid color. Thank you.

3.3.5 support

does it support 3.3.5? its a pretty popular version ( I mean the original one, not the new classic one).

Question about coloring inside tables

code_2017-04-07_04-51-26

so this table here, I don't quite understand the coloring here. sort is probably just different because it's a keyword but the different string colors? Please enlighten me :)

Project Health Query

Hello @Septh! First of all, great repo!

I'd love to have a current, working version of this extension, and I noticed that the 2.0 branch has seen no activity in almost a year. I'd love to help if I could, even maintaining a classic branch for us folks who do play in the 1.13 client.

Can I do anything to help? Or have you abandoned the project at this point? In that case I'd fork and maintain my own copy

Function completion?

Got this installed. I don't see what it does though. It says it has the full WoW API, but when I attempt to type function names and stuff that are in the WoW API I don't see any sort of autocomplete or anything like that.

Also I don't see any sort of code hints. For example when I type SendChatMessage( I would expect to see a hint that tells me the parameters that are to be used, etc.

So what am I misunderstanding here?

Problem with invalid API

It seems like the detection of invalid ignores the fact that I have reassigned them and still colors them as invalid, is there any way to disable invalid coloring?

For example I use local tinsert = table.insert all the time because I'm so used to the shorter version and it works fine but it is always flagged as invalid with your extension.

Any hope that you will upgrade to 8.0.1

Noticed this on the information page. While the files were removed the data was moved into the Blizzard_APIDocumentation folder..
https://www.townlong-yak.com/framexml/live
Warning

With WoW 7.3, Blizzard removed the 3 files I used to maintain wow-bundle (namely GlobalAPI.lua, WidgetAPI.lua and Events.lua from the Helix directory). Therefore, I cannot guarantee any longer that the bundle is 100% accurate with respect to the lastest WoW API.

Some if the info in there is the following..

local AreaPoiInfo =
{
Name = "AreaPoiInfo",
Type = "System",
Namespace = "C_AreaPoiInfo",

Functions =
{
{
Name = "GetAreaPOIForMap",
Type = "Function",

  Arguments =
  {
    { Name = "uiMapID", Type = "number", Nilable = false },
  },

  Returns =
  {
    { Name = "areaPoiIDs", Type = "table", InnerType = "number", Nilable = false },
  },
},
{
  Name = "GetAreaPOIInfo",
  Type = "Function",

  Arguments =
  {
    { Name = "uiMapID", Type = "number", Nilable = false },
    { Name = "areaPoiID", Type = "number", Nilable = false },
  },

  Returns =
  {
    { Name = "poiInfo", Type = "AreaPOIInfo", Nilable = false },
  },
},
{
  Name = "GetAreaPOITimeLeft",
  Type = "Function",

  Arguments =
  {
    { Name = "areaPoiID", Type = "number", Nilable = false },
  },

  Returns =
  {
    { Name = "minutesLeft", Type = "number", Nilable = false },
  },
},
{
  Name = "IsAreaPOITimed",
  Type = "Function",
  Documentation = { "This statically determines if the POI is timed, GetAreaPOITimeLeft retrieves the value from the server and may return nothing for long intervals" },

  Arguments =
  {
    { Name = "areaPoiID", Type = "number", Nilable = false },
  },

  Returns =
  {
    { Name = "isTimed", Type = "bool", Nilable = false },
  },
},

},

Events =
{
{
Name = "AreaPoisUpdated",
Type = "Event",
LiteralName = "AREA_POIS_UPDATED",
},
},

Tables =
{
{
Name = "AreaPOIInfo",
Type = "Structure",
Fields =
{
{ Name = "areaPoiID", Type = "number", Nilable = false },
{ Name = "position", Type = "table", Mixin = "Vector2DMixin", Nilable = false },
{ Name = "name", Type = "string", Nilable = false },
{ Name = "description", Type = "string", Nilable = true },
{ Name = "textureIndex", Type = "number", Nilable = true },
{ Name = "widgetSetID", Type = "number", Nilable = true },
{ Name = "atlasName", Type = "string", Nilable = true },
},
},
},
};

APIDocumentation:AddDocumentationTable(AreaPoiInfo);

Support for 8.0+?

So, 8.0 just came out and I was wondering if there were plans on updating this extension anytime soon.

I'd love to help work on it, but I'm not very familiar with extension development.
If there is anything I can do to help, I'd love to.... but with my lack of knowledge I'd need at least a starting point.

Thanks again for this great extension!

Been using this for a while, but really would like some improvments

The progress on this extension seem to be somewhat lacking as of late for whatever reason. I know life gets busy and people get bored etc... but I've been using it exlusivly (althought probably not in the best ways) for developing my own addon.

If help is wanted I would be more than willing to give it a shot. Although I don't have my extension experience I do learn pretty quck, especially if I'm pushed in the right direction with decent doumention and by setting up some goals.

I'f you need any help getting a few more of those lacking feaures being working on I'd be happy to look into them as I would make my life easier in the long run.

Hit me up if you're interested. Maybe I could start somewhere small just t get an idea how everything is working and use other extensions to bring in some of the features you'll looking for by using them as a reference.

Thanks and keep up the good work!

Wrong color on Dark+ (WoW) theme

I'm having a problem with the Dark+ (WoW) theme.

code_2017-02-04_01-47-43

On your example, the black text is actually white, which makes sense because black on dark background is strange xD
I went to check if I could find the reason and fix it/commit before I came here but I honestly don't see anything with the code for black or very dark.

btw, i'm making some snippets for personal use (some general lua and some more for addons), if you want i can send them after for you to include on the extension.

Thank you for your work.

Folding and multi-line strings

Currently folding is broken by multi-line strings, i.e. strings of the form:

[[My
Multiline
String]]

This is exacerbated by the fact that many of my multiline strings contain Lua code to be run in-game.

An example from code that is broken:

            ["102"] = {
                name = "Vehicle",
                priority = 1000,
                condition = "return UnitUsingVehicle(\"player\");",
                events = {"UNIT_ENTERED_VEHICLE", "UNIT_EXITED_VEHICLE"},
            },
            ["200"] = {
                name = "Hearth/Teleport",
                priority = 20,
                condition = [[for k,v in pairs(this.spells) do
    if (UnitCastingInfo("player") == GetSpellInfo(v)) then
        return true;
    end
end
return false;]],
                executeOnInit = "this.spells = {227334, 136508, 189838, 54406, 94719, 556, 168487, 168499, 171253, 50977, 8690, 222695, 171253, 224869, 53140, 3565, 32271, 193759, 3562, 3567, 33690, 35715, 32272, 49358, 176248, 3561, 49359, 3566, 88342, 88344, 3563, 132627, 132621, 176242, 192085, 192084, 216016};",
                executeOnEnter = "local _, _, _, _, startTime, endTime = UnitCastingInfo(\"player\");\nthis.transitionTime = ((endTime - startTime)/1000) - .25;",
                events = {"UNIT_SPELLCAST_START", "UNIT_SPELLCAST_STOP", "UNIT_SPELLCAST_SUCCEEDED", "UNIT_SPELLCAST_CHANNEL_START", "UNIT_SPELLCAST_CHANNEL_STOP", "UNIT_SPELLCAST_CHANNEL_UPDATE", "UNIT_SPELLCAST_INTERRUPTED"},
            },

I think the best solution is just to have the multi-line string be foldable. though I'm not 100% on the implementation.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.