Skip to content

Commit

Permalink
Fix casing
Browse files Browse the repository at this point in the history
  • Loading branch information
nezuo committed Nov 24, 2024
1 parent 050727b commit 141f17f
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions zap/src/output/luau/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -806,9 +806,10 @@ impl<'a> ServerOutput<'a> {

let set_callback = self.config.casing.with("SetCallback", "setCallback", "set_callback");
let callback = self.config.casing.with("Callback", "callback", "callback");
let player = self.config.casing.with("Player", "player", "player");

self.push_indent();
self.push(&format!("{set_callback} = function({callback}: (player: Player"));
self.push(&format!("{set_callback} = function({callback}: ({player}: Player"));

if let Some(types) = &ev.data {
self.push(", ");
Expand Down Expand Up @@ -837,9 +838,10 @@ impl<'a> ServerOutput<'a> {

let on = self.config.casing.with("On", "on", "on");
let callback = self.config.casing.with("Callback", "callback", "callback");
let player = self.config.casing.with("Player", "player", "player");

self.push_indent();
self.push(&format!("{on} = function({callback}: (player: Player"));
self.push(&format!("{on} = function({callback}: ({player}: Player"));

if let Some(types) = &ev.data {
self.push(", ");
Expand Down Expand Up @@ -870,9 +872,10 @@ impl<'a> ServerOutput<'a> {

let set_callback = self.config.casing.with("SetCallback", "setCallback", "set_callback");
let callback = self.config.casing.with("Callback", "callback", "callback");
let player = self.config.casing.with("Player", "player", "player");

self.push_indent();
self.push(&format!("{set_callback} = function({callback}: (player: Player"));
self.push(&format!("{set_callback} = function({callback}: ({player}: Player"));

if let Some(types) = &fndecl.args {
self.push(", ");
Expand Down

0 comments on commit 141f17f

Please sign in to comment.