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 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 09:58 AM.

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