WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   Dev Tools (https://www.wowinterface.com/forums/forumdisplay.php?f=41)
-   -   WoWDevelopment Sublime Package (https://www.wowinterface.com/forums/showthread.php?t=55457)

Resike 06-09-17 12:04 PM

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?
  • Added every global functions from the global namespace.
  • Added every event name.
  • Added every global constants.
  • Added every misc functions for widets (frameType, Anchors, Buttons, Strata levels, Layers, Blend modes).
  • Added Lua Enumeration globals.
  • XML support for Lua code in the script type tags.
  • Some helper snippets.
  • A new scheme. (Yep thats my scheme)

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:
  • Support for inline anonymus functions, with proper argument coloring.
  • Highlight for: self and this.
  • Things like local string or frame.string will not color string as a global lua function.

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

Layback_ 06-09-17 06:45 PM

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:
  • Tag
  • Comment

Resike 06-10-17 01:47 AM

Quote:

Originally Posted by Layback_ (Post 323717)
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:
  • Tag
  • Comment

There is already a pacakge for that, search for: World of Warcraft TOC file Syntax

But i can put that into the package so it'll be complete.

Resike 06-10-17 12:36 PM

  • Added TOC Syntax Highlighting
  • Added WoW Global Finder

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.

Resike 06-14-17 05:58 AM

- Updated for 7.2.5.
- Remove every files, since there was a lot of changes in the file dir tree.

Resike 06-15-17 06:18 AM

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:

{
        "trigger": "AbbreviateLargeNumbers\t(...)",
        "contents": "AbbreviateLargeNumbers($1)$0",
},

The trigger thats triggering the autocomplete while you typing it then there is a \t in between anything after that is the description.

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:

{
        "trigger": "AbbreviateLargeNumbers\t(\"value\")",
        "contents": "AbbreviateLargeNumbers(\"${1:value}\")$0",
},

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

{
        "trigger": "_AbbreviateLargeNumbers\t(\"value\")",
        "contents": "${1:formattedValue} = AbbreviateLargeNumbers(\"${2:value}\")$0",
},

Notice that we had to change ${1:value} to: ${2:value}

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.

Layback_ 06-15-17 04:37 PM

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?

Gethe 06-16-17 12:21 AM

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:
  1. local foo do
  2.   function foo()
  3.     -- stuff
  4.   end
  5. end

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?

Resike 06-16-17 04:00 AM

Quote:

Originally Posted by Gethe (Post 323829)
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:
  1. local foo do
  2.   function foo()
  3.     -- stuff
  4.   end
  5. end

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?

Actually fRodzet wrote the global highlight for functions it's only for making the globals even more visible. However it's not as accurate as the global finder. The question is that should i keep it or not? Because i don't think you can code it perfectly with only a syntax file, at least i don't know how to.

The better solution would a script which reads the whole file, collect all functions, and marks the global ones somehow if thats even possible.

Resike 06-16-17 04:08 AM

Quote:

Originally Posted by Layback_ (Post 323822)
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?

Noting fancy, tab indents with size 4, and keep the current indenting for readability.

Gethe 06-16-17 08:38 AM

Quote:

Originally Posted by Resike (Post 323834)
The better solution would a script which reads the whole file, collect all functions, and marks the global ones somehow if thats even possible.

It is possible with SublimeLinter-luacheck. I should note that in order for this syntax to work with SublimeLinter you have to add to the syntax map.

Resike 06-16-17 12:01 PM

Quote:

Originally Posted by Gethe (Post 323839)
It is possible with SublimeLinter-luacheck. I should note that in order for this syntax to work with SublimeLinter you have to add to the syntax map.

That looks complicated as hell, at least for me.

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.

Layback_ 06-16-17 05:08 PM

Here's what I've got so far :p

https://pastebin.com/UqzfiqzQ
(I'm not yet confident with GitHub, so................)

Referred from:

Gethe 06-16-17 09:25 PM

Quote:

Originally Posted by Resike (Post 323842)
That looks complicated as hell, at least for me.

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.

There really isn't anything you would need to do regarding the WoW syntax.

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.

Resike 06-17-17 03:11 AM

Quote:

Originally Posted by Gethe (Post 323852)
There really isn't anything you would need to do regarding the WoW syntax.

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.

But then how do you set it up then? I'm really not familiar with either of the packages.

Resike 06-17-17 04:17 AM

Quote:

Originally Posted by Layback_ (Post 323847)
Here's what I've got so far :p

https://pastebin.com/UqzfiqzQ
(I'm not yet confident with GitHub, so................)

Referred from:

Looks good, i'll add em. However you really don't have to parameter the functions that belongs to frames created by Blizzard. Unless you really want to. :)

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.

Layback_ 06-17-17 06:02 AM

Quote:

Originally Posted by Resike (Post 323860)
Looks good, i'll add em. However you really don't have to parameter the functions that belongs to frames created by Blizzard. Unless you really want to. :)

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.

I'll keep that in mind :)!

Resike 06-17-17 07:36 AM

Quote:

Originally Posted by Layback_ (Post 323863)
I'll keep that in mind :)!

Also always use the latest live blizzard code, you can use mine or the townlong-yak one or extract it yourself. These are the ones that usually up to date.

p3lim 06-17-17 11:33 AM

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

Gethe 06-17-17 05:24 PM

Quote:

Originally Posted by Resike (Post 323859)
But then how do you set it up then? I'm really not familiar with either of the packages.

SublimeLinter and associated plugins are installed via the Sublime Text package manager, like most other ST packages.

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.

myrroddin 06-17-17 05:57 PM

Are there any plans to include major libraries written by the community, such as Ace3, LibStub, CBH, LDB, etc?

Resike 06-18-17 02:42 AM

Quote:

Originally Posted by myrroddin (Post 323874)
Are there any plans to include major libraries written by the community, such as Ace3, LibStub, CBH, LDB, etc?

Sure, the Ace3 would take more time tho.

Layback_ 06-18-17 03:10 AM

Completed functions starting with 'E'!

https://pastebin.com/JCwH55hn

As you've said, I've ignored those functions belong to Blizzard frame.

I've tested them all, but will need some review :)

Resike 06-18-17 03:30 AM

Quote:

Originally Posted by Gethe (Post 323872)
SublimeLinter and associated plugins are installed via the Sublime Text package manager, like most other ST packages.

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.

I've managed to make this work (partly).

One question tho, how the hell do i filter what to highlight, since it cries for every little stuff like line length, upvalue and whatever. If you can filter this for only (accessing undefinied variable) that would probably cover the globals, however you still don't know if it's a fucntion or not.

Resike 06-18-17 03:31 AM

Quote:

Originally Posted by Layback_ (Post 323881)
Completed functions starting with 'E'!

https://pastebin.com/JCwH55hn

As you've said, I've ignored those functions that belongs to Blizzard frame.

I've tested them all, but will need some review :)

Nice i'll look into it. I'm soon to finish the "A" myself.

Resike 06-18-17 04:48 AM

Quote:

Originally Posted by Resike (Post 323883)
Nice i'll look into it. I'm soon to finish the "A" myself.

Looks good, you only missed one function (EJ_GetTierInfo), gonna add em.

Layback_ 06-18-17 05:16 AM

Quote:

Originally Posted by Resike (Post 323885)
Looks good, you only missed one function (EJ_GetTierInfo), gonna add em.

Sweet :)!!

Resike 06-18-17 10:55 AM

Quote:

Originally Posted by Resike (Post 323882)
I've managed to make this work (partly).

One question tho, how the hell do i filter what to highlight, since it cries for every little stuff like line length, upvalue and whatever. If you can filter this for only (accessing undefinied variable) that would probably cover the globals, however you still don't know if it's a fucntion or not.

Okay i managed to make it work:

Code:

cmd = 'luacheck - --formatter=plain --no-unused --no-redefined --no-unused-args --no-unused-secondaries --no-self --no-max-line-length --no-max-code-line-length --no-max-string-line-length --no-max-comment-line-length --codes --ranges --filename @'


However things that i don't like:

- It's sooo slow, i'm not sure why, but it doesn't fit into the Sublime "policy" where everything is lightning fast.
- You can't change colors, you have 1 color for errors and 1 for warnings and thats it. Would be nice to have a separate color for global functions.

But besides that it's nice. I still think a standalone python script would be better or at least faster, also we could have more control over everything of course.

p3lim 06-18-17 11:09 AM

Quote:

Originally Posted by p3lim (Post 323867)
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).

Here's the source code for that plugin, I'm discontinuing it for two reasons.

Reason 1: It has a tendency to slow/crash sublime because the Lua compiler can be slow or return errors.
It could be handled, but it's not preferred.

Reason 2: The current method can't match the same global multiple times on one line, which could of course be improved.

Just dumping the code here in public domain in case anyone wants to use it.

Python Code:
  1. import sublime
  2. import sublime_plugin
  3.  
  4. import re
  5. from subprocess import Popen, PIPE
  6.  
  7. def get_luac(contents):
  8.     try:
  9.         process = Popen('luac -p -l -- -', stdin=PIPE, stderr=PIPE, stdout=PIPE, shell=True)
  10.         return process.communicate(input=contents.encode())[0].decode()
  11.     except BrokenPipeError as e:
  12.         return None
  13.  
  14. def get_regions(view):
  15.     regions = []
  16.  
  17.     # get view as a region
  18.     viewContents = sublime.Region(0, view.size())
  19.     # get every line region from the region
  20.     lineRegions = view.lines(viewContents)
  21.     # get every line content from the regions
  22.     lineContents = view.substr(viewContents).split('\n')
  23.  
  24.     # get globals from the current content
  25.     output = get_luac(view.substr(viewContents))
  26.     if not output:
  27.         return regions
  28.  
  29.     # parse each line from luac
  30.     for line in output.split('\n'):
  31.         # clean up the line
  32.         line = ' '.join(line.split())
  33.  
  34.         # match global references
  35.         match = re.match(r'\d+ \[(\d+)\] GETGLOBAL -?\d+ -?\d+ ; (.*)', line)
  36.         if match:
  37.             lineNumber, globalValue = match.groups()
  38.             lineNumber = int(lineNumber) - 1
  39.  
  40.             # sadly, luac doesn't tell us the character
  41.             # positions, so we'll have to grab that ourselves
  42.             region = lineRegions[lineNumber]
  43.             contents = view.substr(region)
  44.             print(contents, '---', globalValue)
  45.  
  46.             # grab the start character point
  47.             start = contents.find(globalValue)
  48.  
  49.             if start != -1:
  50.                 # grab the end character point
  51.                 end = start + len(globalValue)
  52.  
  53.                 # create a new region for the value
  54.                 valueRegion = sublime.Region(region.a + start, region.a + end)
  55.  
  56.                 # add the region to the output
  57.                 regions.append(valueRegion)
  58.  
  59.                 # TODO: now we have to remove the value so we don't
  60.                 # match it again (multiple of same globals on one line)
  61.  
  62.     return regions
  63.  
  64. def highlight_globals(view):
  65.     if view.settings().get('syntax').encode() == 'Packages/Lua/Lua.sublime-syntax'.encode():
  66.         # only execute in Lua files
  67.  
  68.         view.add_regions('HighlightLuaGlobals', get_regions(view),
  69.             'comment', '', sublime.DRAW_NO_FILL | sublime.DRAW_NO_OUTLINE | sublime.DRAW_SOLID_UNDERLINE | sublime.HIDE_ON_MINIMAP)
  70.  
  71. class HighlightLuaGlobals(sublime_plugin.EventListener):
  72.     def on_modified_async(self, view):
  73.         highlight_globals(view)
  74.  
  75.     def on_activated_async(self, view):
  76.         highlight_globals(view)
  77.  
  78.     def on_load_async(self, view):
  79.         highlight_globals(view)
  80.  
  81. def plugin_loaded():
  82.     for window in sublime.windows():
  83.         for view in window.views():
  84.             view.settings().add_on_change('HighlightLuaGlobals', lambda: highlight_globals(view))

Gethe 06-18-17 12:32 PM

Quote:

Originally Posted by Resike (Post 323887)
Okay i managed to make it work:

Code:

cmd = 'luacheck - --formatter=plain --no-unused --no-redefined --no-unused-args --no-unused-secondaries --no-self --no-max-line-length --no-max-code-line-length --no-max-string-line-length --no-max-comment-line-length --codes --ranges --filename @'
<snip img>

However things that i don't like:

- It's sooo slow, i'm not sure why, but it doesn't fit into the Sublime "policy" where everything is lightning fast.
- You can't change colors, you have 1 color for errors and 1 for warnings and thats it. Would be nice to have a separate color for global functions.

But besides that it's nice. I still think a standalone python script would be better or at least faster, also we could have more control over everything of course.

You can actually change the error and warning colors. They are in the settings for SublimeLinter

Serious question though, why do you want a separate indicator for global functions? If a variable is global, it has the same implications regardless of it's type.

Resike 06-18-17 01:24 PM

Quote:

Originally Posted by Gethe (Post 323890)
You can actually change the error and warning colors. They are in the settings for SublimeLinter

Serious question though, why do you want a separate indicator for global functions? If a variable is global, it has the same implications regardless of it's type.

I guess it would be nice for the rookie authors (and Blizzard employees) to stop population the global namespace with swarms of global functions.

Resike 06-19-17 06:31 PM

Added the highlighing with Sublime Linter and luacheck:
  • Install the package Sublime Linter.
  • Add the path to luacheck.exe to your system PATH table, or to the paths/windows setting in the Sublime Linter settings:
    "c:\Users\UserName\AppData\Roaming\Sublime Text 3\Packages\WoWDevelopment\WoW Global Finder\"
  • Add "wow lua": "lua", to the syntax_map in the Sublime Linter settings.
  • Restart Sublime.

The globals found by the global finder should match the errors found by luachecker now:


Layback_ 06-21-17 03:15 AM

Done for "J" to "L" :)

https://pastebin.com/1ZGqGtz8

Please review them!

Resike 07-26-17 07:45 AM

Quote:

Originally Posted by Layback_ (Post 323927)
Done for "J" to "L" :)

https://pastebin.com/1ZGqGtz8

Please review them!

Added it. 10char

Resike 07-26-17 07:49 AM

I still need more volunteers guys, i'm not gonna go through 40 KLOC by myself, and i also have a lot more other stuff to do in the proejct. Any yet only Layback helped.

Currently i'm adding the complete widget API, i have a cool feature where you select lets say the _Texture help autocomplete it prints out every info from that widget type handlers/scripts/inherits in a formatted lua table.

Ketho 07-26-17 08:20 AM

Would adding the console variables be useful for the package?
They are just strings so I'm not sure if it would be bloat rather than helpful

Resike 07-26-17 08:30 AM

Quote:

Originally Posted by Ketho (Post 324363)
Would adding the console variables be useful for the package?
They are just strings so I'm not sure if it would be bloat rather than helpful

Hmm i guess, however i can write a script to automate that based on the page you linked.

Layback_ 07-26-17 06:46 PM

It's been a while since the last commit(?)

Here's an API list for "F"

https://pastebin.com/mZajXEBr

Please review them.

Thank you!

Resike 07-29-17 03:42 AM

Quote:

Originally Posted by Layback_ (Post 324373)
It's been a while since the last commit(?)

Here's an API list for "F"

https://pastebin.com/mZajXEBr

Please review them.

Thank you!

Added them.

Kkthnx 08-02-17 02:27 AM

I am not sure if this has been discussed before though I read through the 2 pages here and didn't see anything about it. Is it at all possible to set this so when we run something like this it will quit highlighting/reporting a global?

For example

Lua Code:
  1. if (not KkthnxUIConfig) then
  2.     print(L["KkthnxUI config not found!"])
  3.     return
  4. end

Obviously, it is going to call KkthnxUIConfig and print

Now want I am wanting to happen is if I were to call this up at the top of my file like so it will quit highlighting/reporting them so in theory s I know I have covered them.

Lua Code:
  1. local print = print

of even in that case as I handle it

Lua Code:
  1. local _G = _G
  2.  
  3. local print = _G.print

Code:

-- Global variables that we don't need to cache, list them here
-- GLOBALS: KkthnxUIConfig

Once we declare them here it will stop reporting them to us. If my post makes no sense I apologize as it is 4:26 am as of writing this.

Resike 08-02-17 04:03 AM

Quote:

Originally Posted by Kkthnx (Post 324466)
I am not sure if this has been discussed before though I read through the 2 pages here and didn't see anything about it. Is it at all possible to set this so when we run something like this it will quit highlighting/reporting a global?

For example

Lua Code:
  1. if (not KkthnxUIConfig) then
  2.     print(L["KkthnxUI config not found!"])
  3.     return
  4. end

Obviously, it is going to call KkthnxUIConfig and print

Now want I am wanting to happen is if I were to call this up at the top of my file like so it will quit highlighting/reporting them so in theory s I know I have covered them.

Lua Code:
  1. local print = print

of even in that case as I handle it

Lua Code:
  1. local _G = _G
  2.  
  3. local print = _G.print

Code:

-- Global variables that we don't need to cache, list them here
-- GLOBALS: KkthnxUIConfig

Once we declare them here it will stop reporting them to us. If my post makes no sense I apologize as it is 4:26 am as of writing this.

It should work the way that you described, if you upvalue something than it should no longer report it as a global, that's the whole point of the global finder. Did you set up your SublimeLinter properly?

I think you might have the default luacheker set as a linter for SublimeLinter instead of my special globalfinder linter script:

Go to Tools -> SublimeLinter -> Toggle Linter then enable globalfinder and disable luacheck.

I might forgot to include this step from the how to set up the linter. :P

Kkthnx 08-02-17 04:22 AM

Quote:

Originally Posted by Resike (Post 324467)
It should work the way that you described, if you upvalue something than it should no longer report it as a global, that's the whole point of the global finder. Did you set up your SublimeLinter properly?

As far as I am aware I did. Stil new at it as I switched directly from Atom. I'll post some screenshots and see if you notice something that is off.

Okay, guess it works. Reset everything to default.

Now, how do we handle it if we do not wanna cache a global? In Atom with "mikk's FindGlobals script" linter we could just run -- GLOBALS: GLOBANAME and it would stop reporting it.

Resike 08-02-17 06:05 AM

Quote:

Originally Posted by Kkthnx (Post 324468)
As far as I am aware I did. Stil new at it as I switched directly from Atom. I'll post some screenshots and see if you notice something that is off.

Okay, guess it works. Reset everything to default.

Now, how do we handle it if we do not wanna cache a global? In Atom with "mikk's FindGlobals script" linter we could just run -- GLOBALS: GLOBANAME and it would stop reporting it.

Currently you can't ignore globals. I'll look into that how can you do this, with lua-check with my script and SublimeLinter.

Kkthnx 08-02-17 06:14 AM

Quote:

Originally Posted by Resike (Post 324469)
Currently you can't ignore globals. I'll look into that how can you do this, with lua-check with my script and SublimeLinter.

Thank you!

Resike 08-02-17 07:13 AM

Quote:

Originally Posted by Kkthnx (Post 324470)
Thank you!

Add this line just like with the mik's script with no commas:

Lua Code:
  1. -- luacheck: globals math string

This will ignore math and string globals.

Resike 09-02-17 06:53 AM

Pushed a full update for 7.3.0.

Resike 11-03-17 01:30 PM

Pushed full update for 7.3.2.

In development:
https://www.youtube.com/watch?v=5rpsGn-L960

Gethe 11-05-17 01:48 PM

Any chance this could be added to package control? I believe it was previously included, so you may just need to update the repo url.

Also, by including luacheck in the package, this causes anyone who already had lua and luacheck installed to get two notifications per error.


It may be better to have that feature split into a separate package. It would be good for those like myself who already have luacheck installed on a system level, and just want the wow specific stuff. It's also good for those who don't want the syntax stuff, but are looking global checker without having to install lua, etc.

Resike 11-05-17 05:13 PM

Quote:

Originally Posted by Gethe (Post 325722)
Any chance this could be added to package control? I believe it was previously included, so you may just need to update the repo url.

Also, by including luacheck in the package, this causes anyone who already had lua and luacheck installed to get two notifications per error.


It may be better to have that feature split into a separate package. It would be good for those like myself who already have luacheck installed on a system level, and just want the wow specific stuff. It's also good for those who don't want the syntax stuff, but are looking global checker without having to install lua, etc.

Will look into the package, the problem is that the package does still exists and i'm not sure how can i take it over or update it:
https://packagecontrol.io/packages/WoW%20Development

You can toggle SublimeLinter by linters, if you disable the global finder linter, then you should only get the luacheck results. (aka only one global errors per line)
Open the command panel (cltr+shift+p) and search for toggle linter:


But moving the Linter/GlobalFinder/SyntaxHighlighter into a different projects are also could be better.

Gethe 11-06-17 03:19 AM

Quote:

Originally Posted by Resike (Post 325723)
Will look into the package, the problem is that the package does still exists and i'm not sure how can i take it over or update it:
https://packagecontrol.io/packages/WoW%20Development

It does already exist, but it links to frodzet's repo which no longer exists as it was transferred to you. It would seem to me that you would just need to go into the package manager repo (per the guide I linked), and find the entries with the "WoW Development" label and update the url.

Resike 11-06-17 08:47 AM

Quote:

Originally Posted by Gethe (Post 325726)
It does already exist, but it links to frodzet's repo which no longer exists as it was transferred to you. It would seem to me that you would just need to go into the package manager repo (per the guide I linked), and find the entries with the "WoW Development" label and update the url.

Alright i'll look into that. Did your linter issues got fixed?

Gethe 11-06-17 09:39 AM

Yeah that did it.

Resike 01-22-18 07:22 AM

Updated for 7.3.5.

Eungavi 04-16-18 12:51 AM

Not sure if Resike is still on this project, but any advice on how I should set path of WoW Global Finder for portable version of Sublime Text 3?

So, basically Sublime Text Build 3143 x64 is a top folder and WoW Global Finder is located in Sublime Text Build 3143 x64\Data\Packages\WoWDevelopment\WoW Global Finder.

I tried the following, but it doesn't seem to be a right syntax :(

Code:

// SublimeLinter Settings - User
{
        "paths": {
                "linux": [],
                "osx": [],
                "windows": [
                        "Data\\Packages\\WoWDevelopment\\WoW Global Finder\\"
                ]
        },
        "syntax_map": {
                "wow lua": "lua"
        }
}


Resike 04-16-18 04:09 AM

You need to use the full path with driver letters and everything which points to your packages folder, i'm not exactly sure what would that be on a portable version, but you should see the packages folder when you open Preferences -> Browse Packages in Sublime.

Eungavi 04-16-18 05:45 AM

Quote:

Originally Posted by Resike (Post 327564)
You need to use the full path with driver letters and everything which points to your packages folder, i'm not exactly sure what would that be on a portable version, but you should see the packages folder when you open Preferences -> Browse Packages in Sublime.

When I open Preferences -> Browse Packages, it reveals me the folder that I stated on my previous reply;

C:\Users\<UserName>\Desktop\Sublime Text Build 3143 x64\Data\Packages\WoWDevelopment\WoW Global Finder
(It's currently placed on Desktop as you can see)

and I guess that's the main problem here.

Since it's a portable version, the driver and its root folder would possibly change for each different PCs if I place it on my USB. Of course, I could change the path whenever it does not match, but I'm guessing that there must be a way to solve this issue either by SublimeLinter or Sublime Text 3, itself.

Resike 04-16-18 11:34 AM

You could just copy the luacheck.exe into one of your system PATH environment folders where you have write access, for example: "c:\windows\system32". Or if you can edit the system PATH variable adding any folder that contains luacheck.exe. Then Windows should find the exe with no issues.

Also since SublimeLinter 4 got updated the info about making the linter work at the GitHub page is outdated, gonna update it for SL4 too sometime.

Resike 03-24-19 04:05 AM

Did a major update for 8.1.5, almost everything is covered (Widget support is not full) using the proper Lua syntax based on this:
https://www.lua.org/manual/5.3/manual.html#9

The new system makes loading times around 10 times faster.

  • Removed deprecated global function/number highlights.
  • Deprecated events will only get highlighted with their corresponding API call.
  • Excluded GlueXML events from event highlighting, and auto-completion.
  • Proper coloring for inline function creation.
  • Highlight invalid string escapes and unfinished strings.
  • And many more.








Available:
Directly from Sublime's package control. (release versions only)

Or from GitHub:
https://github.com/Resike/WoWDevelopment

Aeriez 07-04-19 12:31 AM

I've done all of the steps and I've gotten it working... mostly. However, it seems to scream at every single variable as undefined. "globalfinder: W113 - accessing undefined variable 'table'". Is this expected to happen? The only part of the instructions I was unable to execute was "In Sublime Tools -> SublimeLinter -> Toggle Linter then enable globalfinder and disable any other installed linters.". I'm guessing it's for an older version of Sublime as I'm not finding Sublime Tools. Bringing up the overlay I only have "Toggle highlights" and no "Toggle Linter", nor globalfinder. Any insight?

Resike 07-05-19 03:33 PM

Quote:

Originally Posted by Aeriez (Post 332730)
I've done all of the steps and I've gotten it working... mostly. However, it seems to scream at every single variable as undefined. "globalfinder: W113 - accessing undefined variable 'table'". Is this expected to happen? The only part of the instructions I was unable to execute was "In Sublime Tools -> SublimeLinter -> Toggle Linter then enable globalfinder and disable any other installed linters.". I'm guessing it's for an older version of Sublime as I'm not finding Sublime Tools. Bringing up the overlay I only have "Toggle highlights" and no "Toggle Linter", nor globalfinder. Any insight?

The SublimeLinter got rewritten and there are no GUI menu anymore, you can access their linter settings at Preferences -> Package Settings -> SublimeLinter -> Settings

Then you can enable/disable linters there and call them with custom parameters:

If you would like to customize which warnings/errors you want to show/hide with the linter, then i suggest you to install SublimeLinter-luacheck, and you can enable that linter after you disable the globalfinder one and filter stuff for your needs.



You can read more about the command line arg options here:
https://luacheck.readthedocs.io/en/s...d-line-options

And exclude different warning codes with the `--only [XXX,YYY,ZZZ,...]` argument based on these codes:
https://luacheck.readthedocs.io/en/stable/warnings.html

You can also create a `.luacheckrc` file that you can put into your project folder, then the linter will always load those settings for that particular project:
https://luacheck.readthedocs.io/en/stable/config.html


All times are GMT -6. The time now is 06:39 PM.

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