repo
stringclasses
350 values
file_path
stringlengths
29
200
language
stringclasses
2 values
file_type
stringclasses
4 values
code
stringlengths
2
1.01M
tokens
int64
2
598k
ryanlua/roblox-studio-vscode-theme
ryanlua-roblox-studio-vscode-theme-3690651/tests/full-moon-luau-named_function_arg_types.luau
luau
.luau
type MyCallbackType = (cost: number, name: string) -> string local cb: (amount: number) -> number local function foo(cb: (name: string) -> ()) end local function bar(x: (number)?): (baz: string) -> string end local function bar(x: (number)?): (baz: string) -> ((names: Array<string>) -> ...any) end
87
ryanlua/roblox-studio-vscode-theme
ryanlua-roblox-studio-vscode-theme-3690651/tests/full-moon-luau-shorthand_array_type.luau
luau
.luau
type Array<T> = { T } type Array<T> = { [number]: T }
19
ryanlua/roblox-studio-vscode-theme
ryanlua-roblox-studio-vscode-theme-3690651/tests/full-moon-luau-string_interpolation_base.luau
luau
.luau
x(`simple`) x(`hello {"world"}`) x(`1{2}3{"4"}5`) x(`1{`2{"3"}`}`)
34
ryanlua/roblox-studio-vscode-theme
ryanlua-roblox-studio-vscode-theme-3690651/tests/full-moon-luau-string_interpolation_conformance.luau
luau
.luau
local function assertEq(left, right) assert(typeof(left) == "string", "left is a " .. typeof(left)) assert(typeof(right) == "string", "right is a " .. typeof(right)) if left ~= right then error(string.format("%q ~= %q", left, right)) end end assertEq(`hello {"world"}`, "hello world") assertEq(`Welcome {"to"} {"...
568
ryanlua/roblox-studio-vscode-theme
ryanlua-roblox-studio-vscode-theme-3690651/tests/full-moon-luau-types.luau
luau
.luau
--!strict local _fn3 type Identity<T> = T type Array<T> = { [number]: T } type Map<K, V> = { [K]: V } type Function<T> = (...any) -> ...T type Object = { x: number, y: number } type Typeof = typeof(2 + 2 + _fn3()) type FetchResult = "alice" | "mallet" type Element = { ["$$typeof"]: number } type Callback1 = (string) -...
401
ryanlua/roblox-studio-vscode-theme
ryanlua-roblox-studio-vscode-theme-3690651/tests/full-moon-luau-types_chained_optionals.luau
luau
.luau
type Config = { option1: string??, -- you probably need it once in a while option2: string???, -- once a year option3: string?????? -- once in your life! }
47
ryanlua/roblox-studio-vscode-theme
ryanlua-roblox-studio-vscode-theme-3690651/tests/full-moon-luau-types_exported.luau
luau
.luau
type Foo = { bar: any } export type Baz = { foo: any }
17
ryanlua/roblox-studio-vscode-theme
ryanlua-roblox-studio-vscode-theme-3690651/tests/full-moon-luau-types_generic.luau
luau
.luau
type Array<T> = { T } local x: Array<Array<number>>
15
ryanlua/roblox-studio-vscode-theme
ryanlua-roblox-studio-vscode-theme-3690651/tests/full-moon-luau-types_generic_declaration.luau
luau
.luau
--!strict type Foo<T..., U...> = (U...) -> T... type Bar<U, T...> = nil type Function<Args... = ...any, Return... = ()> = (Args...) -> Return... type Baz<U = string, T... = (string, number)> = nil type Indexed<T...> = module.Indexed<T...>
78
ryanlua/roblox-studio-vscode-theme
ryanlua-roblox-studio-vscode-theme-3690651/tests/full-moon-luau-types_generic_no_parameters.luau
luau
.luau
type Bar = Foo<> type Baz = module.Foo<>
12
ryanlua/roblox-studio-vscode-theme
ryanlua-roblox-studio-vscode-theme-3690651/tests/full-moon-luau-types_indexable.luau
luau
.luau
local x: module.Foo = nil local x: module.Array<string> = { "bar" } local x: module.Foo | string = "bar" local x: module.Foo? = nil local x: module.Foo<...string> = nil
56
ryanlua/roblox-studio-vscode-theme
ryanlua-roblox-studio-vscode-theme-3690651/tests/full-moon-luau-types_loops.luau
luau
.luau
for i, v: string in pairs() do end for i: number = 1, 10, 2 do end
29
ryanlua/roblox-studio-vscode-theme
ryanlua-roblox-studio-vscode-theme-3690651/tests/full-moon-luau-types_nested_array.luau
luau
.luau
type Foo = { { string } } type Foo = { {Name: string, Foo: number} }
22
ryanlua/roblox-studio-vscode-theme
ryanlua-roblox-studio-vscode-theme-3690651/tests/full-moon-luau-types_packs.luau
luau
.luau
--!strict function _foo<T...>(param: () -> T...) end type Foo<T...> = () -> T... function _bar<T...>(...: T...) end type A<Z, P...> = {} type C<S...> = A<number, S...> -- with a generic type pack type B = A<number, ...string> -- with a variadic type pack type D = A<number, ()> -- with an empty type pack type Functi...
149
ryanlua/roblox-studio-vscode-theme
ryanlua-roblox-studio-vscode-theme-3690651/tests/full-moon-luau-types_parentheses.luau
luau
.luau
--!strict type GField<_crack, __fuzzing> = {} local TypeInfo = {} function TypeInfo.new( getFieldDefFn: (() -> GField<any, any>?)? ) end export type Thunk<T> = (() -> T) | T export type PromiseLike<T> = { andThen: ( ((T) -> T)? | (PromiseLike<T>)?, -- resolve ((any) -> () | Promis...
206
ryanlua/roblox-studio-vscode-theme
ryanlua-roblox-studio-vscode-theme-3690651/tests/full-moon-luau-types_semicolon_delimeter.luau
luau
.luau
type Foo = { bar: number; baz: number; }
14
ryanlua/roblox-studio-vscode-theme
ryanlua-roblox-studio-vscode-theme-3690651/tests/full-moon-luau-types_variadic.luau
luau
.luau
--!strict type Foo = (...number) -> () type Baz = (string, ...Foo) -> ...Foo type Bar = (...number) -> (string, ...number) -> ...any type Boom = (..."hit" | "miss") -> (string, ...("critical" | "weak" | "normal")) -> ...("dead" | "alive") function _bar(...: number): ...number | string end local f: Boom = function(......
181
ryanlua/roblox-studio-vscode-theme
ryanlua-roblox-studio-vscode-theme-3690651/tests/full-moon-luau-z-escape-string.luau
luau
.luau
print("testing \z twelve") print("Hello \ World")
16
ryanlua/roblox-studio-vscode-theme
ryanlua-roblox-studio-vscode-theme-3690651/tests/issue-1.luau
luau
.luau
local function returnsComplexType() return {} :: { [string]: { number } } end -- Key and [1] both have incorrect highlighting type Inner = typeof(returnsComplexType().Key[1]) -- This has correct highlighting local inner = returnsComplexType().Key[1]
60
ryanlua/roblox-studio-vscode-theme
ryanlua-roblox-studio-vscode-theme-3690651/tests/issue-10.luau
luau
.luau
if test.type ~= "value" then end
10
ryanlua/roblox-studio-vscode-theme
ryanlua-roblox-studio-vscode-theme-3690651/tests/issue-11-multiline-type-declaration.luau
luau
.luau
type Foo = | string | number export type Bar = string | number | boolean type WithComments = -- leading comment | string -- middle comment | number type SingleLine = string | number type Qualified = Foo.Bar | Baz.Qux type WithTable = | { field: string } | number ...
177
ryanlua/roblox-studio-vscode-theme
ryanlua-roblox-studio-vscode-theme-3690651/tests/issue-13-comment-code-block-syntax-error.luau
luau
.luau
local function before() return true end --[[ ```lua pcall(function() end ``` ]] local function after() return true end
34
ryanlua/roblox-studio-vscode-theme
ryanlua-roblox-studio-vscode-theme-3690651/tests/issue-2.luau
luau
.luau
export type A = { LOL: "yes", } local a: xd.Something<{ transparency: typeof(React.createBinding(0)) }> = function() end local c: xd.Something<{ transparency: typeof(React.createBinding(0)), -- this comma is the reason why it diess!! }> = function() -- it dies local a = "hello world" end
82
ryanlua/roblox-studio-vscode-theme
ryanlua-roblox-studio-vscode-theme-3690651/tests/issue-24.luau
luau
.luau
local a = tonumber("1")::number * 1000
14
ryanlua/roblox-studio-vscode-theme
ryanlua-roblox-studio-vscode-theme-3690651/tests/issue-3.luau
luau
.luau
local numbers = {} for k, v in numbers :: any do print(k, v) end
21
ryanlua/roblox-studio-vscode-theme
ryanlua-roblox-studio-vscode-theme-3690651/tests/issue-5.luau
luau
.luau
print(`{ {} }`) print(`{ foo({}).bar }`)
15
ryanlua/roblox-studio-vscode-theme
ryanlua-roblox-studio-vscode-theme-3690651/tests/issue-6.luau
luau
.luau
local x: any x.foo = 20 local function func(header: typeof(Instance.new("Humanoid"))) end local y: any y.foo = 10
36
ryanlua/roblox-studio-vscode-theme
ryanlua-roblox-studio-vscode-theme-3690651/tests/markdown-luau-language.luau
luau
.luau
--[[ ```luau local abc: number = 1 print(abc) ``` ]] --[[ ```lua local abc: number = 1 print(abc) ``` ]]
41
ryanlua/roblox-studio-vscode-theme
ryanlua-roblox-studio-vscode-theme-3690651/tests/metamethods.luau
luau
.luau
function Foo:__index() end function Foo:__iter() end
16
ryanlua/roblox-studio-vscode-theme
ryanlua-roblox-studio-vscode-theme-3690651/tests/multiline-type-cast.luau
luau
.luau
local x = y :: string | number local a = b :: Foo & Bar
22
ryanlua/roblox-studio-vscode-theme
ryanlua-roblox-studio-vscode-theme-3690651/tests/nested-type-declaration.luau
luau
.luau
-- Positive: nested type declarations if true then type Foo = string end do export type Bar = number end while true do type Callback = (string) -> number end -- Positive: top-level (must not regress) type TopLevel = boolean -- Positive: nested type function do export type function Identity(t) en...
131
ryanlua/roblox-studio-vscode-theme
ryanlua-roblox-studio-vscode-theme-3690651/tests/primitives.luau
luau
.luau
local test_nil: nil local test_string: string local test_number: number local test_boolean: boolean local test_thread: thread local test_vector: vector local test_buffer: buffer local test_unknown: unknown local test_never: never local test_any: any local function test( test_nil: nil, test_string: string, ...
198
ryanlua/roblox-studio-vscode-theme
ryanlua-roblox-studio-vscode-theme-3690651/tests/read-write-type-properties.luau
luau
.luau
type Test = { read readonly_property: string, write writeonly_property: string, property: string, }
25
ryanlua/roblox-studio-vscode-theme
ryanlua-roblox-studio-vscode-theme-3690651/tests/stylua-lua-ambiguous-syntax.lua.luau
luau
.luau
local baz = foo(bar); (foo and x or y)(bar) function foobar() local baz = foo(bar); (baz and x or y)(bar) end
36
ryanlua/roblox-studio-vscode-theme
ryanlua-roblox-studio-vscode-theme-3690651/tests/stylua-lua-anonymous-function.lua.luau
luau
.luau
local foo = function(bar, baz) print(foo) end call(function(x,y) local x = test end)
24
ryanlua/roblox-studio-vscode-theme
ryanlua-roblox-studio-vscode-theme-3690651/tests/stylua-lua-assignment.lua.luau
luau
.luau
local foo = 'bar' local bar , baz = 1 , 2
27
ryanlua/roblox-studio-vscode-theme
ryanlua-roblox-studio-vscode-theme-3690651/tests/stylua-lua-block-empty-lines.lua.luau
luau
.luau
function foo() local x = 1 return true end function bar() return end do -- comment local x = 1 local foo = bar -- comment end
43
ryanlua/roblox-studio-vscode-theme
ryanlua-roblox-studio-vscode-theme-3690651/tests/stylua-lua-comments-buffer.lua.luau
luau
.luau
local foo_result = foo( --a comment "oof" ) local expr_result = 1 + 2 + 3 + 4 + 5 --a comment + 6 + 6 + 8 print"text" --a comment foo{bar = baz} -- comment for foo, -- test bar in next, -- comment value do print("test", -- comment "foo" ) end if code == 9 -- \t or code == 32 -- <space> then print(code...
134
ryanlua/roblox-studio-vscode-theme
ryanlua-roblox-studio-vscode-theme-3690651/tests/stylua-lua-comments-function-args.lua.luau
luau
.luau
foo( -- comment baz ) foo( baz, -- comment bar ) foo ( baz, -- comment bar ) foo(baz, bar -- comment ) foo(baz, bar) -- comment foo( -- comment baz, bar )
61
ryanlua/roblox-studio-vscode-theme
ryanlua-roblox-studio-vscode-theme-3690651/tests/stylua-lua-comments-function-params.lua.luau
luau
.luau
function sayHello( name, -- YourName foo,--baz greeting -- Message ) return greeting .. ", " .. name end
32
ryanlua/roblox-studio-vscode-theme
ryanlua-roblox-studio-vscode-theme-3690651/tests/stylua-lua-comments-indented-block.lua.luau
luau
.luau
function foo() local x = 1 local y = 1 -- comment end if foo then local x = 1 -- comment end
39
ryanlua/roblox-studio-vscode-theme
ryanlua-roblox-studio-vscode-theme-3690651/tests/stylua-lua-comments-keep-multiline.lua.luau
luau
.luau
if this -- foobar then elseif foobar or code == 10 -- \n then pos = 1 lexer.line = 1 lexer.lineStart = pos - 1 end local function coerceToMap(mapLike) return instanceOf(mapLike, Map) and mapLike -- ROBLOX: order is preservered or Map.new(Object.entries(mapLike)) -- ROBLOX: order is not preserved end if -- com...
191
ryanlua/roblox-studio-vscode-theme
ryanlua-roblox-studio-vscode-theme-3690651/tests/stylua-lua-comments-multiline-expression.lua.luau
luau
.luau
local val = 1 + 2+ 1 -- add foo = bar or #baz -- test local foo = bar or (baz and foo) -- test -- Stop Movement if -- Moved for at least 0.1 seconds ((tick() - Player.PlayerDataLocal.IsRunningTimeStamp.Value) > 0.1) and -- Speed is less than threshold (Utility.Vec3XZLengthSquared(Player.Character.PrimaryPart.Ve...
124
ryanlua/roblox-studio-vscode-theme
ryanlua-roblox-studio-vscode-theme-3690651/tests/stylua-lua-comments.lua.luau
luau
.luau
--[[Testing this]] local function foo(bar, baz) print(bar,baz) end --this is a nice function local test = {}--this comment should stay local y = foo -- comment line 1 -- comment line 2, should not be split from above comment local x = test
63
ryanlua/roblox-studio-vscode-theme
ryanlua-roblox-studio-vscode-theme-3690651/tests/stylua-lua-complex-args.lua.luau
luau
.luau
React.createElement("span", { key = id }, React.createElement(Consumer, nil, function() return React.createElement("span", nil, "inner") end), React.createElement("span", nil, "outer"))
42
ryanlua/roblox-studio-vscode-theme
ryanlua-roblox-studio-vscode-theme-3690651/tests/stylua-lua-condition-operator-precedence.lua.luau
luau
.luau
local instance = someReallyLongConditionExtremelyLongSoLongYourMindWillMelt and someReallyLongCondition and someOtherReallyLongCondition or somethingElse
35
ryanlua/roblox-studio-vscode-theme
ryanlua-roblox-studio-vscode-theme-3690651/tests/stylua-lua-condition-parentheses.lua.luau
luau
.luau
if (foo) then print("true") elseif (bar) then print("false") end while (foo) do print("true") end repeat print("yes") until (foo)
44
ryanlua/roblox-studio-vscode-theme
ryanlua-roblox-studio-vscode-theme-3690651/tests/stylua-lua-context-long-lines.lua.luau
luau
.luau
do local region = Region3.new(part.Position - (0.5 * part.Size), part.Position + (0.5 * part.Size)) do do return function(...) callback(LOG_FORMAT:format(os.date("%H:%M:%S"), key, level, fmt.fmt(...))) end end end self.digits = math.ceil(math.log10(math.max(math.abs(self.props.maxValue), math.abs(se...
147
ryanlua/roblox-studio-vscode-theme
ryanlua-roblox-studio-vscode-theme-3690651/tests/stylua-lua-do-block.lua.luau
luau
.luau
do local x = 5 end
7
ryanlua/roblox-studio-vscode-theme
ryanlua-roblox-studio-vscode-theme-3690651/tests/stylua-lua-double-unary-minus.lua.luau
luau
.luau
local x = -(-foo) local y = - -foo local z1 = -(-foo) -- bar local z2 = - -foo -- baz
34
ryanlua/roblox-studio-vscode-theme
ryanlua-roblox-studio-vscode-theme-3690651/tests/stylua-lua-empty-function-2.lua.luau
luau
.luau
local function noop() -- comment end function noop() -- comment end call(function() -- comment end)
27
ryanlua/roblox-studio-vscode-theme
ryanlua-roblox-studio-vscode-theme-3690651/tests/stylua-lua-empty-function.lua.luau
luau
.luau
local function noop() end function noop() end call(function() end)
16
ryanlua/roblox-studio-vscode-theme
ryanlua-roblox-studio-vscode-theme-3690651/tests/stylua-lua-eof-1.lua.luau
luau
.luau
local x = 1
6
ryanlua/roblox-studio-vscode-theme
ryanlua-roblox-studio-vscode-theme-3690651/tests/stylua-lua-eof-2.lua.luau
luau
.luau
local x = 1 -- this is a comment
11
ryanlua/roblox-studio-vscode-theme
ryanlua-roblox-studio-vscode-theme-3690651/tests/stylua-lua-eof-3.lua.luau
luau
.luau
local x = 1 -- this is a comment
12
ryanlua/roblox-studio-vscode-theme
ryanlua-roblox-studio-vscode-theme-3690651/tests/stylua-lua-excess-parentheses.lua.luau
luau
.luau
local x something((x)) local x = (1 + 2) * 3 local y = ((1) * 3) local z = (...) == nil and foo or bar local foo = not (bar and baz) local bar = (#bar) and baz local cond = condition and (not object or object.Value == y) local baz = (-4 + 3) * 2 ({}):foo(); ("hello"):format() function x() return 1, 2 end print(x()...
174
ryanlua/roblox-studio-vscode-theme
ryanlua-roblox-studio-vscode-theme-3690651/tests/stylua-lua-function-call-2.lua.luau
luau
.luau
local App = Roact.createElement("Frame", { Size = UDim2.new(0,0,0,0), Position = UDim2.new(0,0,0,0) }, { Child1 = Roact.createElement("TextLabel", { Text = "foo", AnchorPoint = Vector2.new(0, 0), -- comment foo = bar }), Child2 = Roact.createElement("TextLabel", { Text = "foo", AnchorPoint = Vector2.new...
192
ryanlua/roblox-studio-vscode-theme
ryanlua-roblox-studio-vscode-theme-3690651/tests/stylua-lua-function-call-3.lua.luau
luau
.luau
setmetatable({ _words = words, _morewords = words, _evenmorewords = words, _words = words, _morewords = words, _evenmorewords = words, }, Class) foo({ foo = bar, }, baz, { bar = baz, }) Roact.createElement("Frame", { foo = bar, bar = baz, }, self.props[Roact.Children])
82
ryanlua/roblox-studio-vscode-theme
ryanlua-roblox-studio-vscode-theme-3690651/tests/stylua-lua-function-call-4.lua.luau
luau
.luau
Roact.createElement("ImageLabel", { Size = UDim2.new( 0, TextService:GetTextSize(self.props.PhysicalTool.Name, 16, Enum.Font.SourceSansBold, Vector2.new(100000, 100000)).X + 10, 0, 20 ), })
71
ryanlua/roblox-studio-vscode-theme
ryanlua-roblox-studio-vscode-theme-3690651/tests/stylua-lua-function-call-6.lua.luau
luau
.luau
-- hug table braces with parentheses print({ foo_variable = "some long value", foo_variable = "some long value", foo_variable = "some long value", foo_variable = "some long value", }) print({ foo_variable = "somenge", foo_variable = "malue", foo_variable = "alueeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee" }) -- but no...
109
ryanlua/roblox-studio-vscode-theme
ryanlua-roblox-studio-vscode-theme-3690651/tests/stylua-lua-function-call-8.lua.luau
luau
.luau
function_call(("hello" .. "darkness" .. "my" .. "old" .. "friend" .. "hello" .. "darkness" .. "my" .. "old" .. "friend" .. "!!!!!!!!!!!!"):call())
50
ryanlua/roblox-studio-vscode-theme
ryanlua-roblox-studio-vscode-theme-3690651/tests/stylua-lua-function-call-comments.lua.luau
luau
.luau
local AppRodux = RoactRodux.connect( function(state, props) return { } end -- function(dispatch) -- return { -- setCrossSize = function(crossSize) -- dispatch({ -- type = "SetCrossSize", -- crossSize = crossSize -- }) -- end -- } -- end )(AppComponent)
91
ryanlua/roblox-studio-vscode-theme
ryanlua-roblox-studio-vscode-theme-3690651/tests/stylua-lua-function-call.lua.luau
luau
.luau
call "string" call {foo='bar',baz=1} call (x,y, z)
25
ryanlua/roblox-studio-vscode-theme
ryanlua-roblox-studio-vscode-theme-3690651/tests/stylua-lua-function-def-comments.lua.luau
luau
.luau
function func( param_a -- description of a , param_b -- description of b ) end
22
ryanlua/roblox-studio-vscode-theme
ryanlua-roblox-studio-vscode-theme-3690651/tests/stylua-lua-function-def-multiline.lua.luau
luau
.luau
function foo(foooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo, barrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr) end function foo(foooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo, barrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr) end function foobar(fooooo, barrrrrrrrrr, bazzzzzzzzzzzzzzz, fooooooooooo, ba...
215
ryanlua/roblox-studio-vscode-theme
ryanlua-roblox-studio-vscode-theme-3690651/tests/stylua-lua-generic-for-multiline.lua.luau
luau
.luau
local function system(world) for id, model, lasering, transform in world:query(Components.Model, Components.Lasering, Components.Transform, Components.Mothership) do end end local function system(world) for id, model, lasering, transform, id, model, lasering, transform, id, model, lasering, transform, id, model, la...
182
ryanlua/roblox-studio-vscode-theme
ryanlua-roblox-studio-vscode-theme-3690651/tests/stylua-lua-generic-for.lua.luau
luau
.luau
for i,v in pairs(table) do print(i,v) end
15
ryanlua/roblox-studio-vscode-theme
ryanlua-roblox-studio-vscode-theme-3690651/tests/stylua-lua-hang-binop-comments-2.lua.luau
luau
.luau
local function logTiger(tiger, depth) log( string.rep(" ", depth) .. "- " .. -- need to explicitly coerce to a string tiger.type and (tiger.type.name or tostring(tiger.type)) or "[r00t]", "[" .. tiger.commonExtraTentacles .. (tiger.pendingPartyHats and "*" or "") .. "]" ) end local function logTiger(tiger...
173
ryanlua/roblox-studio-vscode-theme
ryanlua-roblox-studio-vscode-theme-3690651/tests/stylua-lua-hang-binop-comments.lua.luau
luau
.luau
function foo(defaultExport) if defaultExport == nil then print( "lazy: Expected the result of a dynamic import() call. " .. "Instead received: %s\n\nYour code should look like: \n " -- Break up imports to avoid accidentally parsing them as dependencies. -- ROBLOX deviation: Lua syntax in message ...
234
ryanlua/roblox-studio-vscode-theme
ryanlua-roblox-studio-vscode-theme-3690651/tests/stylua-lua-hang-binop-rhs-precendence.lua.luau
luau
.luau
local function findMoney() for _, existingObject in pairs(workspace:GetChildren()) do if existingObject:GetAttribute("MoneyID") == targetCash.id and existingObject.Name == targetName .. ".money" then break end end end do do do do do do do function Venue:inspectElectrics(ins...
293
ryanlua/roblox-studio-vscode-theme
ryanlua-roblox-studio-vscode-theme-3690651/tests/stylua-lua-hang-binop.lua.luau
luau
.luau
local foo = x ^ -- comment y % -- comment z - -- comment a <= -- comment b < -- comment c >= -- comment d
35
ryanlua/roblox-studio-vscode-theme
ryanlua-roblox-studio-vscode-theme-3690651/tests/stylua-lua-hang-call-chain-comments.lua.luau
luau
.luau
-- A a = A() -- B .B() -- C .C()
17
ryanlua/roblox-studio-vscode-theme
ryanlua-roblox-studio-vscode-theme-3690651/tests/stylua-lua-hang-call-chains-2.lua.luau
luau
.luau
local output = Job :new({ command = "stylua", args = { "-" }, writer = api.nvim_buf_get_lines(bufnr, 0, -1, false), }) :sync()
48
ryanlua/roblox-studio-vscode-theme
ryanlua-roblox-studio-vscode-theme-3690651/tests/stylua-lua-hang-call-chains.lua.luau
luau
.luau
Promise.new():andThen(callThis):andThen(function() print("test") end):andThen() Promise.new():andThen(callThis):andThen({ true }):andThen() this.is.a.large.start:andThen():andThen(function() print("test") end):andThen() local f = this:andThen(callThis):andThen({ true }).X.Y.Z this:andThen(callThis):andThen(...
161
ryanlua/roblox-studio-vscode-theme
ryanlua-roblox-studio-vscode-theme-3690651/tests/stylua-lua-hang-equality-op.lua.luau
luau
.luau
assert(StringToHex(HexToString("05 e0 81 91 24 cb b2 2c 49 e2 0f 2e 8b 9a" .. " 47 56 9f fb fe ec d2 ff 1f")) == "05 e0 81 91 24 cb b2 2c 49 e2 0f 2e 8b 9a 47 56 9f fb fe ec d2 ff 1f")
109
ryanlua/roblox-studio-vscode-theme
ryanlua-roblox-studio-vscode-theme-3690651/tests/stylua-lua-hang-prefix-2.lua.luau
luau
.luau
do do local CreatedDirection = ( DirectionalCF * CFrame.fromOrientation(0, 0, RNG:NextNumber(0, TAU)) * CFrame.fromOrientation( math.rad(RNG:NextNumber( GunMainConfiguration.BulletMinSpreadAngle or GlobalConfiguration.DEFAULT_MIN_SPREAD_ANGLE, GunMainConfiguration.BulletMaxSpreadAngle or GlobalConfi...
115
ryanlua/roblox-studio-vscode-theme
ryanlua-roblox-studio-vscode-theme-3690651/tests/stylua-lua-hang-prefix.lua.luau
luau
.luau
("foooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo" .. "barrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr"):format() do ("foooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo" .. "barrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr"):format() end print(("fooooooooooooooooooooooooooooooooo...
129
ryanlua/roblox-studio-vscode-theme
ryanlua-roblox-studio-vscode-theme-3690651/tests/stylua-lua-if-1.lua.luau
luau
.luau
if x == true then return end
9
ryanlua/roblox-studio-vscode-theme
ryanlua-roblox-studio-vscode-theme-3690651/tests/stylua-lua-if-comments-3.lua.luau
luau
.luau
if true then else end if true then -- this is a comment -- but this is another comment -- and another one - we should hence indent the comments overall else end
44
ryanlua/roblox-studio-vscode-theme
ryanlua-roblox-studio-vscode-theme-3690651/tests/stylua-lua-if-comments.lua.luau
luau
.luau
if true then -- foo elseif bar then -- bar else -- baz end
23
ryanlua/roblox-studio-vscode-theme
ryanlua-roblox-studio-vscode-theme-3690651/tests/stylua-lua-indented-multiline-comments.lua.luau
luau
.luau
function foo() function bar() function baz() --[[ comment ]] local x = 1 end end end
34
ryanlua/roblox-studio-vscode-theme
ryanlua-roblox-studio-vscode-theme-3690651/tests/stylua-lua-index-comments.lua.luau
luau
.luau
local x = foo[ index -- test ] foo[ var -- string ] = baz local x = foo[ x -- string ][y][z][p -- string ] local x = foo[index --[[comment]]]
50
ryanlua/roblox-studio-vscode-theme
ryanlua-roblox-studio-vscode-theme-3690651/tests/stylua-lua-long-assignment-2.lua.luau
luau
.luau
do local HitPart, HitPoint, HitNormal, HitMaterial = nil, Ray.Origin + Ray.Direction, Vector3.new(0, 1, 0), Enum.Material.Air end
42
ryanlua/roblox-studio-vscode-theme
ryanlua-roblox-studio-vscode-theme-3690651/tests/stylua-lua-long-assignment-3.lua.luau
luau
.luau
local something = fooooooooooooooo == barrrrrrrrrrrr and func(arggggggggggggggggggggggggggggggggggggggggg1, argggggggggg2) or somethingeeeeeeeeeeee
54
ryanlua/roblox-studio-vscode-theme
ryanlua-roblox-studio-vscode-theme-3690651/tests/stylua-lua-long-assignment-4.lua.luau
luau
.luau
do do local FrontDistanceX, FrontDistanceY = self.settings.FWsBoneLen * math.cos(math.rad(self.settings.FWsBoneAngle)), self.settings.FWsBoneLen * math.sin(math.rad(self.settings.FWsBoneAngle)) end end
56
ryanlua/roblox-studio-vscode-theme
ryanlua-roblox-studio-vscode-theme-3690651/tests/stylua-lua-long-assignment.lua.luau
luau
.luau
local LoadAddOn, UnitName, GetRealmName, UnitRace, UnitFactionGroup, IsInRaid = LoadAddOn, UnitName, GetRealmName, UnitRace, UnitFactionGroup, IsInRaid LoadAddOn, UnitName, GetRealmName, UnitRace, UnitFactionGroup, IsInRaid = LoadAddOn, UnitName, GetRealmName, UnitRace, UnitFactionGroup, IsInRaid do local LoadAddOn,...
214
ryanlua/roblox-studio-vscode-theme
ryanlua-roblox-studio-vscode-theme-3690651/tests/stylua-lua-multiline-comments.lua.luau
luau
.luau
checkVisitorFnArgs( expect, ast, { ... }, true --[[ isEdited ]] ) local test --[[foo]] = true --[[test]] local x = true
39
ryanlua/roblox-studio-vscode-theme
ryanlua-roblox-studio-vscode-theme-3690651/tests/stylua-lua-multiline-expressions-2.lua.luau
luau
.luau
if not (one and two and three and not (four and five) and six and not (seven and eight and nine and ten and eleven and twelve and thirteen and fourteen and fifteen and sixteen and seventeen)) then print("foo") end local longString = foo( "We are wrapping this %s " .. "onto multiple lines " .. "for ease of editing an...
184
ryanlua/roblox-studio-vscode-theme
ryanlua-roblox-studio-vscode-theme-3690651/tests/stylua-lua-multiline-expressions-3.lua.luau
luau
.luau
do do do do local text = "Players: " .. #Server_Container.ARandomVariableWhichIsVeryLongSoThatThisGetsOverTheColumnLimit.Players_F:GetChildren() - 1 .. "/20" local ratio = (minAxis - minAxisSize) / delta * (self.props.maxScaleRatio - self.props.minScaleRatio) + self.props.minScaleRatio local ratio2 = ...
138
ryanlua/roblox-studio-vscode-theme
ryanlua-roblox-studio-vscode-theme-3690651/tests/stylua-lua-multiline-expressions-4.lua.luau
luau
.luau
function SetCallsign(Player, Callsign) if Settings.PolicingSetup.Radio or (table.find(Settings.PolicingSetup.CallsignPrefix, string.sub(Callsign, 1, 2)) and tonumber(string.sub(Callsign, 3, 4))) then Player:SetAttribute("Callsign", Callsign) end end
73
ryanlua/roblox-studio-vscode-theme
ryanlua-roblox-studio-vscode-theme-3690651/tests/stylua-lua-multiline-expressions-indent-block.lua.luau
luau
.luau
local expr = first_______________________________________________________________________________________________________ and function() foo() end
16
ryanlua/roblox-studio-vscode-theme
ryanlua-roblox-studio-vscode-theme-3690651/tests/stylua-lua-multiline-expressions.lua.luau
luau
.luau
if someReallyLongCondition and someOtherReallyLongCondition and somethingElse and someReallyLongCondition and someOtherReallyLongCondition and somethingElse then print("foo") end foo = someReallyLongCondition * someOtherReallyLongCondition * somethingElse * someReallyLongCondition * someOtherReallyLongCondition * ...
322
ryanlua/roblox-studio-vscode-theme
ryanlua-roblox-studio-vscode-theme-3690651/tests/stylua-lua-multiple-lines-betwen-statements.lua.luau
luau
.luau
local x = 1 local y = 2 local z = 3
17
ryanlua/roblox-studio-vscode-theme
ryanlua-roblox-studio-vscode-theme-3690651/tests/stylua-lua-number.lua.luau
luau
.luau
local a = 0.5 local b = .5 local c = 100 local d = 5e-5 local e = -.5 local f = .2e-5 local g = -.1e+5 local h = 0x12
60
ryanlua/roblox-studio-vscode-theme
ryanlua-roblox-studio-vscode-theme-3690651/tests/stylua-lua-repeat-block-2.lua.luau
luau
.luau
local function foo(bar) local count = 0 repeat count = count + 1 until count == 10 end
30
ryanlua/roblox-studio-vscode-theme
ryanlua-roblox-studio-vscode-theme-3690651/tests/stylua-lua-repeat-block.lua.luau
luau
.luau
repeat x = x + 1 until true
9
ryanlua/roblox-studio-vscode-theme
ryanlua-roblox-studio-vscode-theme-3690651/tests/stylua-lua-return-hanging-expression-2.lua.luau
luau
.luau
return cframe -- Clamp & transform into world space * Vector3.new( math.clamp(transform.X, -halfSize.X, halfSize.X), math.clamp(transform.Y, -halfSize.Y, halfSize.Y), math.clamp(transform.Z, -halfSize.Z, halfSize.Z) ), cframe.Position
76
ryanlua/roblox-studio-vscode-theme
ryanlua-roblox-studio-vscode-theme-3690651/tests/stylua-lua-return-hanging-expression-3.lua.luau
luau
.luau
function foo() return ( long_variable_name + long_variable_name + long_variable_name + long_variable_name + long_variable_name + long_variable_name + long_variable_name + long_variable_name + long_variable_name + long_variable_name ), ( long_variable_name + long_variable_name + long_variable...
309
ryanlua/roblox-studio-vscode-theme
ryanlua-roblox-studio-vscode-theme-3690651/tests/stylua-lua-return-hanging-expression.lua.luau
luau
.luau
function foo() return fooooooooooooooooooo(barrr) or foooooooooooooooooooooooooooooooooooooooooooooooooooooopppo(barrrrrrrrrrrrrr)(hello) or bazzzzzzzzzzzzzzzzzz end
48
ryanlua/roblox-studio-vscode-theme
ryanlua-roblox-studio-vscode-theme-3690651/tests/stylua-lua-semicolon-1.lua.luau
luau
.luau
local x = 1; -- comment do return; -- bad end; -- comment local y; -- comment z = 5; -- comment repeat x = x + 1 until x > 5; -- comment for x,y in pairs(z) do break; -- comment end; -- comment if x then end; -- comment function foo() end; -- comment local function bar() end; -- comment for i = 1, 10 do end; -...
148