StyLua-Roblox: Roblox Plugin For StyLua Formatter

StyLua Roblox


Introduction

StyLua is a formatter for lua/luau, StyLua-Roblox is a plugin to use StyLua in Roblox Studio.

Features

Compared to roblox’s format document feature, StyLua offers lot of different formatting configuration.

more information about the details of each option can be found here

Installation

Usage

Once installed, you can run the program and use the plugin on Studio, You need to run the program at background while using the plugin.

(program runs at your system tray)

To Format, click the StyLua button or bind a shortcut from shortcut settings.

format_final

Formatting with a script editor open will format the current script.

To format multiple scripts, close the script editor and select the scripts you want to format from Explorer and format.

To Change the Configuration of StyLua, Click the Open Settings Button.

These settings are user only and will be used when there is no place-only setting.

To Create Place-only Settings, Add a module named StyLua (case-sensitive) to ServerStorage.

Copy the Settings from Open Settings menu and paste it in, plugin will use these settings.

Place-only settings are useful for keeping the settings consistent for users in the teamcreate.

17 Likes

This is pretty nice, I’m definitely gonna use this

6 Likes

in your examples you do something weird methods to achieve your “long string.”

You can do multiple lines using [[ ]]

for example:

local longString = [[ hello world
I love pizza
Yay]]

print(longString)

All of the other stuff you do is done by roblox automatically when you copy and paste a script. I feel like you wasted your time making this.

4 Likes

I personally dont use studio editor that much but seems like this plugin is gonna improve studio editor experience a lot

5 Likes

The code in the example demonstrates line breaking on concat, not multiline strings.
Studio’s default formatting does not have opiniated features since it is made to be used without any setting.

Also, the examples are using default settings which is suppose to be as default as possible, while giving you option to config as you like.

you might want to check out before giving your “feedback”

5 Likes

I still cant see a purpose. I think it should instead organize the code, convert names to camelCase, and other formatting things roblox doesn’t do automatically.

4 Likes

My god. I’ve been using JohnyMorganz’ stylua (on VSCode). But now on studio? Now this is 2024!

6 Likes

V1.2.0

Changelog

Bumped StyLua to 0.20.0

1 Like

I was wondering if there was a code formatter for Roblox Studio, after a fast google search i found this amazing plugin.

1 Like