Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Format inside of directives #197

Open
zaneduffield opened this issue Mar 13, 2025 · 0 comments
Open

Format inside of directives #197

zaneduffield opened this issue Mar 13, 2025 · 0 comments
Labels
enhancement New feature or request

Comments

@zaneduffield
Copy link
Collaborator

A suggestion from #193 was to remove trailing spaces in conditional directives.

I think this is a good idea, and could be extended to a more general rule for formatting directives.
They can get pretty complicated so we should be careful in implementing this, but there are at least some simple cases that would be nice to cover.

For example

  1. {$ifdef NAME}
    • normalise casing of the directive (unclear whether lower or upper case is preferable)
    • one space between identifier and directive
    • no trailing space
  2. {$COMPILERDIRECTIVE}
    • no spaces after directive
  3. {$if DEFINED(Foo) and (CONSTANT > 3)}
    • a real stretch goal would be to format the {$if} directive expressions like a regular Delphi expression
@jgardn3r jgardn3r added the enhancement New feature or request label Mar 14, 2025
@zaneduffield zaneduffield added this to the Format token contents milestone Apr 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants