1. Sign up for news, events and more!

    You're currently visiting the official DarkRP Forums as a guest. Sign up now to participate in our community and we'll let you know when we have news.

Fix jobs/shipments/etc. online with glualint-web!

Discussion in 'DarkRP Features and Code Design' started by (FPtje) Atheos, Oct 30, 2016.

  1. (FPtje) Atheos

    (FPtje) Atheos Main Developer Staff Member

    GLualint-Web

    Have you started your server only to find errors in your jobs.lua?
    Are you helping tons of people on the forums who can't fix their shipments?

    Here's a tool to help you:

    https://fptje.github.io/glualint-web/

    How to use:
    1. Paste/write Lua code in it
    2. Observe errors and warnings
    3. Fix errors and warnings
    4. Optional: Pretty print
    5. Use code somewhere

    FAQ

    Where will my code be sent to when I enter it here?

    Nowhere! It stays on your computer. Glualint-web does everything in your browser. You can literally open the page, turn off your internet connection, enter code and still have it checked.

    Why is it slow?
    Because it's doing very complicated stuff. It's already doing it in another thread, but it's still slow sometimes. Also, there's an explicit 250ms delay between you typing a letter and the thing linting. That actually makes it feel less sluggish, as it doesn't update the errors while you're typing.

    Can I send this link to people?
    Yes! Please do! Send it to everyone! Spread the word! This should be super useful for server owners!

    Can I pretty print code that has errors?
    Yes, but you probably shouldn't want to. The pretty printer will always try to pretty print. If your code doesn't make sense, it will make sense of it, one way or the other. It will literally try to fix syntax errors. 99% of the time it won't know what you want and do something weird. It'll probably get rid of the syntax errors, but it probably won't work in game.

    The web page says the code is good, but it still errors in game!
    The web page can only see syntax errors. It's actually not specific to DarkRP stuff (except the pretty printer secretly has a DarkRP old syntax to new syntax converter). The web page won't know it when you make a shipment that lacks a name, has a "string" for the price field or any of that stuff. It just checks whether the code is valid Lua.

    Can I download this for my text editor?
    Yes! Glualint was a thing long before glualint-web was. There are plugins for Atom and Sublime:
    Atom: https://atom.io/packages/linter-glualint
    Sublime: https://packagecontrol.io/packages/SublimeLinter-contrib-glualint
    Notepad++: No support. Notepad++ is old. Get a different editor.

    NOTE: glualint (the program) must be installed for those plugins to work! Always get the latest version from here:
    https://github.com/FPtje/GLuaFixer/releases

    Checkout the installation instructions here:
    https://github.com/FPtje/GLuaFixer#installing
     
    Last edited: Nov 5, 2016
    Yogosh, Matryan and Reverse like this.
  2. Sir Klutch

    Sir Klutch Member

    Well done!
     
  3. Reverse

    Reverse Member

    [​IMG]

    Hopefully people actually see this post before they post.
     
  4. Matryan

    Matryan Well-Known Member

    Good stuff - Now I don't have to wait 20 seconds for Atom to load up to answer people on here.
     
  5. Pab14567

    Pab14567 Well-Known Member

    Hey @(FPtje) Atheos what are the differences between sublime text and Atom ?
     
  6. (FPtje) Atheos

    (FPtje) Atheos Main Developer Staff Member

    Try them both and find out. Sublime is faster, atom doesn't have a popup message every now and then.
    --- Double Post Merged, Dec 17, 2016 ---
    Try them both and find out. Sublime is faster, atom doesn't have a popup message every now and then.
     
  7. BlueOrange

    BlueOrange New Member

    Could you look into creating a plugin for Visual Studio Code?
     

Share This Page