Joshua Gardner 18 Posted March 18 Thank you to everyone who suggested improvements to our pre-release versions. We have now officially released pasfmt v0.4.0! For this release, we have made the following improvements: Case statements can now be formatted inline - example Simple conditionally compiled code can now be formatted inline - example Formatting of package conditional directives in the style of RAD Studio - example Various bug fixes (for more information, see the changelog) Alongside this, we have also released pasfmt-rad v0.2.0. Now featuring bookmark and breakpoint relocation across formats. 6 Share this post Link to post
dummzeuch 1608 Posted March 18 3 hours ago, Joshua Gardner said: Alongside this, we have also released pasfmt-rad v0.2.0. Now featuring bookmark and breakpoint relocation across formats. I was just looking at the source code of the plugin and could not figure out where and how it preserves the bookmarks and breakpoints. Could you please give me a hint? Share this post Link to post
Zane 3 Posted March 18 11 minutes ago, dummzeuch said: I was just looking at the source code of the plugin and could not figure out where and how it preserves the bookmarks and breakpoints. Could you please give me a hint? The logic for the tracking of locations is implemented in the formatter itself. It's accessed via the `--cursor` CLI option, and the implementation is in this file. As for the plugin, you probably already found it, but the code that interfaces with the IDE to effect the relocations is here (and GExperts was a good reference for implementing this). Share this post Link to post
zed 17 Posted March 18 I see that there are no formatting settings, and the code is written in Rust. I’m wondering who else might find this useful besides your internal team? What made you choose Rust for a Delphi code formatter? Just wanted to try out Rust, or was there more to it? 1 Share this post Link to post
Zane 3 Posted March 18 10 hours ago, zed said: I see that there are no formatting settings There is configuration for the formatting style, but it is intentionally limited. The lack of (extensive) configuration is in line with the first goal of the project: Quote Enforce a sensible, opinionated, and consistent formatting style. 10 hours ago, zed said: I’m wondering who else might find this useful besides your internal team? Anyone who wants a formatter that can properly wrap and unwrap long lines in a style that makes sense, while supporting all modern Delphi features. As far as we know, there are no other Delphi formatters that come close in this regard. 10 hours ago, zed said: What made you choose Rust for a Delphi code formatter? Just wanted to try out Rust, or was there more to it? This was covered quite extensively in the last thread, and in this issue. 1 Share this post Link to post