From 048b444859a4957343ab0eaded7f35966381e870 Mon Sep 17 00:00:00 2001 From: Filip Tibell Date: Wed, 24 May 2023 11:21:48 +0200 Subject: [PATCH] Remove printinfo global --- .lune/hello_lune.luau | 2 +- CHANGELOG.md | 1 + docs/pages/home/Writing-Scripts.md | 2 +- packages/lib/src/builtins/top_level.rs | 10 ---------- packages/lib/src/importer/mod.rs | 1 - 5 files changed, 3 insertions(+), 13 deletions(-) diff --git a/.lune/hello_lune.luau b/.lune/hello_lune.luau index 04d860c..4c9afec 100644 --- a/.lune/hello_lune.luau +++ b/.lune/hello_lune.luau @@ -207,7 +207,7 @@ print("Printing with pretty colors and auto-formatting 🎨") print(stdio.color("blue") .. string.rep("—", 22) .. stdio.color("reset")) -printinfo("API response:", apiResponse) +print("API response:", apiResponse) warn({ Oh = { No = { diff --git a/CHANGELOG.md b/CHANGELOG.md index 40008e2..da0b5a5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -24,6 +24,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Removed `CollectionService` and its methods from the `roblox` builtin library - new instance methods have been added as replacements. - Removed [`Instance:FindFirstDescendant`](https://create.roblox.com/docs/reference/engine/classes/Instance#FindFirstDescendant) which was a method that was never enabled in the official Roblox API and will soon be removed.
Use the second argument of the already existing find methods instead to find descendants. +- Removed the global `printinfo` function - it was generally not used, and did not work as intended. Use the `stdio` builtin for formatting and logging instead. ### Added diff --git a/docs/pages/home/Writing-Scripts.md b/docs/pages/home/Writing-Scripts.md index c987936..2367abc 100644 --- a/docs/pages/home/Writing-Scripts.md +++ b/docs/pages/home/Writing-Scripts.md @@ -261,7 +261,7 @@ print("Printing with pretty colors and auto-formatting 🎨") print(stdio.color("blue") .. string.rep("—", 22) .. stdio.color("reset")) -printinfo("API response:", apiResponse) +print("API response:", apiResponse) warn({ Oh = { No = { diff --git a/packages/lib/src/builtins/top_level.rs b/packages/lib/src/builtins/top_level.rs index b015593..cb3fc97 100644 --- a/packages/lib/src/builtins/top_level.rs +++ b/packages/lib/src/builtins/top_level.rs @@ -14,16 +14,6 @@ pub fn print(lua: &Lua, args: LuaMultiValue) -> LuaResult<()> { Ok(()) } -pub fn printinfo(lua: &Lua, args: LuaMultiValue) -> LuaResult<()> { - let print: LuaFunction = lua.named_registry_value("print")?; - print.call(format!( - "{}\n{}", - format_label("info"), - pretty_format_multi_value(&args)? - ))?; - Ok(()) -} - pub fn warn(lua: &Lua, args: LuaMultiValue) -> LuaResult<()> { let print: LuaFunction = lua.named_registry_value("print")?; print.call(format!( diff --git a/packages/lib/src/importer/mod.rs b/packages/lib/src/importer/mod.rs index 50802f1..d4811b9 100644 --- a/packages/lib/src/importer/mod.rs +++ b/packages/lib/src/importer/mod.rs @@ -37,7 +37,6 @@ pub fn create(lua: &'static Lua, args: Vec) -> LuaResult<()> { ("print", lua.create_function(top_level::print)?), ("warn", lua.create_function(top_level::warn)?), ("error", lua.create_function(top_level::error)?), - ("printinfo", lua.create_function(top_level::printinfo)?), ]; // Set top-level globals