Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/sonnguyen9800/luau-mode-setter
The Luau Mode Setter extension for Visual Studio Code allows you to easily toggle different mode directives in .luau files used in Roblox development.
https://github.com/sonnguyen9800/luau-mode-setter
Last synced: 1 day ago
JSON representation
The Luau Mode Setter extension for Visual Studio Code allows you to easily toggle different mode directives in .luau files used in Roblox development.
- Host: GitHub
- URL: https://github.com/sonnguyen9800/luau-mode-setter
- Owner: sonnguyen9800
- Created: 2024-11-14T09:14:55.000Z (2 months ago)
- Default Branch: master
- Last Pushed: 2024-11-14T10:09:49.000Z (2 months ago)
- Last Synced: 2024-11-14T10:26:02.751Z (2 months ago)
- Language: TypeScript
- Size: 46.9 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
Awesome Lists containing this project
README
# Luau Mode Setter
![alt text](luau-icon.png)
The Luau Mode Setter extension for Visual Studio Code allows you to easily toggle different mode directives in `.luau` files used in **Roblox development**. You are recommended to read the [motivation section](#motivation) first.
## Features and How To Use
- The plugin auto activates when `.luau` file is found in the workspace. This will also deactivate if all `.luau` files get deleted.#### Mode Setting for Single File
![tut1](https://github.com/user-attachments/assets/8ed3bf94-ff3c-4b03-b774-a71f0a35bbd1)#### Mode Setting for Multiple Files
![tut2](https://github.com/user-attachments/assets/133383d7-a499-44ea-b708-fcfd40359fc9)#### Mode Setting for Whole Folder
![tut3](https://github.com/user-attachments/assets/dd6635da-202f-4868-bdd3-c9c0c13ba790)## Installing
https://marketplace.visualstudio.com/items?itemName=sonnguyen9800.luau-mode-setter
You can also grab the package vsix file and install manually.## Motivation
- In `.luau`, there are *Type inference modes*, three of them are "nocheck", "nonstrict", "strict". You can refer to them through this link: https://luau.org/typecheckBelow, I quoted from the original site (14 Nov 2024)
>There are three modes currently available. They must be annotated on the top few lines among the comments.
>--!nocheck,
--!nonstrict (default), and
--!strict
>nocheck mode will simply not start the type inference engine whatsoever.- In modern Roblox, Luau practice, we code on **VScode**, Then sync the code to *Roblox Editor* through **rojo**
- When coding, most of the time the project use a mix of `.luau` and `.lua` file (mostly from third party library). These large `.lua` files often cause unwanted error/warning for the **Luau LSP** (e.g *JohnnyMorganz.luau-lsp*).
- Thus, this extension helps developers to mass-update strict mode on these files (and all .luau script)
- This also brings more quality-of-life features to the development and ease a bit of pain when coding in `.luau`## Known Issues
- The extension will be activated automatically when .luau file existed in workspace. This also disabled automatically if no .luau files found (e.g when you delete all .luau file from the project)
- However, after you delete all files, the extension cannot re-activated. You must restart vscode to activate it again.## Acknowledgement
- https://code.visualstudio.com/api
- ChatGPT**Enjoy!**