fix: Move variable definition to the end

This commit is contained in:
2025-09-20 02:33:17 +02:00
parent 326af7ea83
commit 21bc70cbcd
5 changed files with 25 additions and 7 deletions

View File

@@ -17,9 +17,9 @@ pub struct A {
fn flatten() {
insta::assert_snapshot!(<A as Typed>::generate_full().unwrap(), @r"
---@class A
local A
---@field hello string
---@field world boolean
---@field cool integer
local A
");
}

View File

@@ -14,10 +14,10 @@ pub enum ActionType {
fn action_type() {
insta::assert_snapshot!(<ActionType as Typed>::generate_full().unwrap(), @r#"
---@class ActionType
local ActionType
---@field action
---| "broadcast"
---@field extras table<string, string>?
local ActionType
"#);
}
@@ -56,12 +56,12 @@ pub struct Action {
fn action() {
insta::assert_snapshot!(<Action as Typed>::generate_full().unwrap(), @r#"
---@class Action
local Action
---@field action
---| "broadcast"
---@field extras table<string, string>?
---@field label string
---@field clear boolean?
local Action
"#);
}
@@ -80,11 +80,11 @@ pub struct Notification {
fn notification() {
insta::assert_snapshot!(<Notification as Typed>::generate_full().unwrap(), @r"
---@class Notification
local Notification
---@field title string
---@field message string?
---@field tags string[]?
---@field priority Priority?
---@field actions Action[]?
local Notification
");
}

View File

@@ -21,7 +21,7 @@ fn rename() {
fn rename_nested() {
insta::assert_snapshot!(<Other as Typed>::generate_full().unwrap(), @r"
---@class Other
local Other
---@field rust Lua
local Other
");
}