Closed raptorxcz closed 1 month ago
Hey @raptorxcz! Thanks for reaching out and for using xcbeautify. In version 2.0.0, I internalized Parser
due to numerous breaking and structural changes. As part of this rewrite, I introduced a new type, XCBeautifier. It's the type you should use in a Swift package. It more properly encapsulates many internal implementation details, specifically parsing and formatting.
Currently, there are some differences between it and Parser
. For example, XCBeautifier
returns an optional, formatted String
if possible. Unlike Parser
, XCBeautifier
doesn't provide context around the recognized CaptureGroup
instance or the OutputType
. Based on your example, I believe XCBeautifier
's current implementation offers what you're looking for. Let me know if you have any questions or suggestions!
Awesome, that is exactly what I needed. Thank you.
Hello, great work!
I wanted to use this Swift package in my custom Swift Package, but I ran into issue with
Parser
access level. The current access level ofParser
ispackage
. If I wanted to useParser
in my custom Swift package I had to change it topublic
.Parser: https://github.com/cpisciotta/xcbeautify/blob/main/Sources/XcbeautifyLib/Parser.swift
Here is change: https://github.com/raptorxcz/xcbeautify/commit/1bd38b6a64bb447c264fbdfc1b453bf8065b8ec6
I can make a pull request If you allow this change?
My usage is something like this: