Jump to content

Recommended Posts

image.thumb.png.d1a91539f1c44aa3d6ee5b0704e01200.png

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.

  • Like 6

Share this post


Link to post
  On 3/18/2025 at 4:37 AM, 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
  On 3/18/2025 at 7:58 AM, 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

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?

  • Thanks 1

Share this post


Link to post
  On 3/18/2025 at 10:54 AM, 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.

 

  On 3/18/2025 at 10:54 AM, 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.

 

  On 3/18/2025 at 10:54 AM, 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.

  • Like 1

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×