Update serializer defaults and add MemoryPack fetch scripts

Changed default WireMode to Compact and string interning to Attribute in AcBinarySerializerOptions. Added Bash commands in settings.local.json for fetching and processing Cysharp/MemoryPack files via GitHub API and curl/python scripts.
This commit is contained in:
Loretta 2026-03-07 20:50:32 +01:00
parent e0f546dde6
commit 11a15bfa64
2 changed files with 10 additions and 3 deletions

View File

@ -37,7 +37,14 @@
"Bash(sort:*)",
"WebFetch(domain:neuecc.medium.com)",
"WebFetch(domain:raw.githubusercontent.com)",
"Bash(xargs cat)"
"Bash(xargs cat)",
"Bash(curl -s -H \"Accept: application/vnd.github.v3+json\" \"https://api.github.com/repos/Cysharp/MemoryPack/git/trees/main?recursive=1\")",
"Bash(python3 -c \" import sys, json data = json.load\\(sys.stdin\\) for item in data.get\\(''tree'', []\\): path = item[''path''] if ''nion'' in path.lower\\(\\) or ''Emitter'' in path or ''Generator'' in path.split\\(''/''\\)[-1] if ''/'' in path else False: print\\(path\\) \")",
"Bash(python -c \" import sys, json data = json.load\\(sys.stdin\\) for item in data.get\\(''tree'', []\\): p = item[''path''] pl = p.lower\\(\\) if ''union'' in pl or ''emitter'' in pl or \\(p.startswith\\(''src/MemoryPack.Generator/''\\) and p.endswith\\(''.cs''\\)\\): print\\(p\\) \")",
"Bash(curl -s \"https://api.github.com/repos/Cysharp/MemoryPack/git/trees/main?recursive=1\")",
"Bash(curl -sL \"https://raw.githubusercontent.com/Cysharp/MemoryPack/main/src/MemoryPack.Generator/MemoryPackGenerator.Emitter.cs\")",
"Bash(curl -sL \"https://raw.githubusercontent.com/Cysharp/MemoryPack/main/src/MemoryPack.Core/MemoryPackCode.cs\")",
"Bash(curl -sL \"https://raw.githubusercontent.com/Cysharp/MemoryPack/main/src/MemoryPack.Generator/MemoryPackGenerator.Parser.cs\")"
]
}
}

View File

@ -90,7 +90,7 @@ public sealed class AcBinarySerializerOptions : AcSerializerOptions
/// Compact: VarInt + UTF-8 (default, smaller output).
/// Fast: Fixed-width integers + UTF-16 (larger output, faster encode/decode).
/// </summary>
public WireMode WireMode { get; set; } = WireMode.Fast;
public WireMode WireMode { get; set; } = WireMode.Compact;
/// <summary>
/// Controls how string interning is applied during serialization.
@ -99,7 +99,7 @@ public sealed class AcBinarySerializerOptions : AcSerializerOptions
/// All: All strings within length limits are interned (legacy behavior).
/// Default: All
/// </summary>
public StringInterningMode UseStringInterning { get; set; } = StringInterningMode.All;
public StringInterningMode UseStringInterning { get; set; } = StringInterningMode.Attribute;
/// <summary>
/// When true, checks for duplicate property name hashes during serialization (UseMetadata mode).