mirror of
https://github.com/lune-org/lune.git
synced 2025-04-10 21:40:54 +01:00
merge: main->chore/rokit-migration
This commit is contained in:
commit
8597a48710
7 changed files with 410 additions and 308 deletions
21
CHANGELOG.md
21
CHANGELOG.md
|
@ -8,6 +8,27 @@ All notable changes to this project will be documented in this file.
|
||||||
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
||||||
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
||||||
|
|
||||||
|
## Unreleased
|
||||||
|
|
||||||
|
### Added
|
||||||
|
|
||||||
|
- Added a compression level option to `serde.compress` ([#224])
|
||||||
|
- Added missing vector methods to the `roblox` library ([#228])
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
|
||||||
|
- Updated to Luau version `0.635`
|
||||||
|
- Updated to rbx-dom database version `0.634`
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
|
||||||
|
- Fixed `fs.readDir` with trailing forward-slash on Windows ([#220])
|
||||||
|
- Fixed `__type` and `__tostring` metamethods not always being respected when formatting tables
|
||||||
|
|
||||||
|
[#220]: https://github.com/lune-org/lune/pull/220
|
||||||
|
[#224]: https://github.com/lune-org/lune/pull/224
|
||||||
|
[#228]: https://github.com/lune-org/lune/pull/228
|
||||||
|
|
||||||
## `0.8.6` - June 23rd, 2024
|
## `0.8.6` - June 23rd, 2024
|
||||||
|
|
||||||
### Added
|
### Added
|
||||||
|
|
667
Cargo.lock
generated
667
Cargo.lock
generated
File diff suppressed because it is too large
Load diff
|
@ -23,7 +23,7 @@ async-compression = { version = "0.4", features = [
|
||||||
"zlib",
|
"zlib",
|
||||||
] }
|
] }
|
||||||
bstr = "1.9"
|
bstr = "1.9"
|
||||||
lz4 = "1.24"
|
lz4 = "1.26"
|
||||||
serde = { version = "1.0", features = ["derive"] }
|
serde = { version = "1.0", features = ["derive"] }
|
||||||
serde_json = { version = "1.0", features = ["preserve_order"] }
|
serde_json = { version = "1.0", features = ["preserve_order"] }
|
||||||
serde_yaml = "0.9"
|
serde_yaml = "0.9"
|
||||||
|
|
|
@ -4,6 +4,7 @@ use std::fmt::{self, Write as _};
|
||||||
|
|
||||||
use mlua::prelude::*;
|
use mlua::prelude::*;
|
||||||
|
|
||||||
|
use super::metamethods::{call_table_tostring_metamethod, get_table_type_metavalue};
|
||||||
use super::{
|
use super::{
|
||||||
basic::{format_value_styled, lua_value_as_plain_string_key},
|
basic::{format_value_styled, lua_value_as_plain_string_key},
|
||||||
config::ValueFormatConfig,
|
config::ValueFormatConfig,
|
||||||
|
@ -46,7 +47,12 @@ pub(crate) fn format_value_recursive(
|
||||||
let mut buffer = String::new();
|
let mut buffer = String::new();
|
||||||
|
|
||||||
if let LuaValue::Table(ref t) = value {
|
if let LuaValue::Table(ref t) = value {
|
||||||
if depth >= config.max_depth {
|
if let Some(formatted) = format_typename_and_tostringed(
|
||||||
|
get_table_type_metavalue(t),
|
||||||
|
call_table_tostring_metamethod(t),
|
||||||
|
) {
|
||||||
|
write!(buffer, "{formatted}")?;
|
||||||
|
} else if depth >= config.max_depth {
|
||||||
write!(buffer, "{}", STYLE_DIM.apply_to("{ ... }"))?;
|
write!(buffer, "{}", STYLE_DIM.apply_to("{ ... }"))?;
|
||||||
} else if !visited.insert(LuaValueId::from(t)) {
|
} else if !visited.insert(LuaValueId::from(t)) {
|
||||||
write!(buffer, "{}", STYLE_DIM.apply_to("{ recursive }"))?;
|
write!(buffer, "{}", STYLE_DIM.apply_to("{ recursive }"))?;
|
||||||
|
@ -164,3 +170,15 @@ fn format_table(
|
||||||
})
|
})
|
||||||
.collect()
|
.collect()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn format_typename_and_tostringed(
|
||||||
|
typename: Option<String>,
|
||||||
|
tostringed: Option<String>,
|
||||||
|
) -> Option<String> {
|
||||||
|
match (typename, tostringed) {
|
||||||
|
(Some(typename), Some(tostringed)) => Some(format!("<{typename}({tostringed})>")),
|
||||||
|
(Some(typename), None) => Some(format!("<{typename}>")),
|
||||||
|
(None, Some(tostringed)) => Some(tostringed),
|
||||||
|
(None, None) => None,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
[tools]
|
[tools]
|
||||||
luau-lsp = "JohnnyMorganz/luau-lsp@1.29.1"
|
luau-lsp = "JohnnyMorganz/luau-lsp@1.32.1"
|
||||||
stylua = "JohnnyMorganz/StyLua@0.20.0"
|
stylua = "JohnnyMorganz/StyLua@0.20.0"
|
||||||
just = "casey/just@1.34.0"
|
just = "casey/just@1.34.0"
|
||||||
|
|
|
@ -1,6 +0,0 @@
|
||||||
std = "luau+lune"
|
|
||||||
|
|
||||||
exclude = ["luneTypes.d.luau"]
|
|
||||||
|
|
||||||
[lints]
|
|
||||||
high_cyclomatic_complexity = "warn"
|
|
Binary file not shown.
Loading…
Add table
Reference in a new issue