Garry’s Mod Lua (GLua) requires specialized lexer tools to break down its unique syntax and highlight code accurately. Unlike standard Lua, GLua includes C-style comments (//), special keywords, and custom functions from the Facepunch Wiki.
Using the wrong lexer can cause syntax errors and lead to frustrating bugs. This article highlights the top five tools to read and parse your code cleanly. 1. GLua Enhanced for Visual Studio Code
GLua Enhanced is the absolute best choice for VS Code users who want deep code analysis. It acts as a supercharged parser that reads your files and connects directly to the Facepunch Wiki API.
Visual Wiki Popups: Hover over a function to read its official documentation.
Realm Identifiers: It clearly marks if a snippet runs on the Server, Client, or Shared realm.
Deep Autocomplete: It predicts complex network messages and hook signatures while you type.
Get It Here: Download the extension via the Visual Studio Marketplace. 2. GmodLua Lexer Plugin for Notepad++
GmodLua Lexer is a dedicated C++ plugin built specifically for the Scintilla engine inside Notepad++. It completely replaces the generic Lua parsing rules with custom rules built just for Garry’s Mod.
Custom Comments: It correctly parses C-style double slashes (//) without breaking.
Color Schemes: It uses distinct colors for game functions, libraries, and vectors.
Lightweight Performance: It handles massive codebases smoothly without freezing your editor.
Get It Here: Check out the source code and installation steps on the GmodLua GitHub Repository. 3. LibGMOD & Lua Language Server (LuaLS)
LibGMOD uses the modern Lua Language Server (LuaLS) to bring robust type checking to your workflow. It utilizes LuaCATS annotations to map out the entire Garry’s Mod API.
Early Error Detection: It catches mistyped variables and missing nil values before you launch the game.
Cross-Editor Support: It works seamlessly across Visual Studio Code, Neovim, and Sublime Text.
Smart Autocomplete: It treats the Facepunch Wiki text as a living dictionary for your environment.
Get It Here: Set up your bindings by grabbing the files from the LibGMOD GitHub Page. 4. Sublime-GLua-Highlight Coding / Lua Basics [Beginner Guide] – Steam Community
Leave a Reply