linguist icon indicating copy to clipboard operation
linguist copied to clipboard

Add Language: Luau

Open RBXTyler opened this issue 2 years ago • 4 comments

Language name

"Luau" https://luau-lang.org

URL of syntax highlighting grammar

https://luau-lang.org/syntax

Most popular extensions

.luau

RBXTyler avatar Aug 04 '22 04:08 RBXTyler

Should be able to use a slightly modified version of https://github.com/NightrainsRbx/RobloxLsp/blob/master/syntaxes/lua.tmLanguage.json for the grammar. The question is whether to use it slightly modified (removing Roblox globals to better match the outside-Roblox usage) or to keep them, considering usage on Roblox is more common.

checkraisefold avatar Apr 17 '23 02:04 checkraisefold

I’d like to keep pushing for this—Luau’s interpolated string feature has a tendency to break syntax highlighting:

local function verifyAcyclic(tree: Configuration, node: INode, _visited: { [INode]: true }?)
	local visited: { [INode]: true } = _visited or {}
	
	if visited[node] then
		error(`!! FATAL: BehaviorTree @ {tree:GetFullName()} isn't acyclic!`)
	end
	
	visited[node] = true
	
	if not node.Children then
		return
	end
	
	for i, child in node.Children do
		verifyAcyclic(tree, child, visited)
	end
end

Luau is effectively a superset of Lua, so people have been using *.lua to retain Lua’s subset of syntax highlighting. This makes usage of Luau difficult to track, as it comes down more to patterns that match the extended syntax. There have been pushes to use *.luau explicitly, but adoption has been slow because it isn’t defined presently.

MaximumADHD avatar May 14 '23 19:05 MaximumADHD

Bump! Very much needed as Luau grows with Roblox and Roblox is expanding rapidly! I think Luau has consolidated it's place as a language that's here to stay for a while. 😁

phoriah avatar Oct 27 '23 14:10 phoriah

Bumming won’t make it happen any faster… we need someone in the community to actually put the work in and submit a PR 😁

lildude avatar Oct 27 '23 16:10 lildude