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

[D] newline after constructor name before open parentheses produces unexpected results #3716

Open
ernest-bruce opened this issue Apr 28, 2023 · 1 comment
Labels
C: Syntax T: enhancement Improvement of existing language features

Comments

@ernest-bruce
Copy link

What happened?

i like to style my D code so that the open parentheses after a functionname goes on a separate line, which works in most cases:
Screen Shot 2023-04-28 at 14 06 34

however, as shown here, this doesnt work as expected in class constructors:
Screen Shot 2023-04-28 at 14 01 29
Screen Shot 2023-04-28 at 14 02 28
Screen Shot 2023-04-28 at 14 02 47

im using Sublime Text 4143

@deathaxe
Copy link
Collaborator

A this token on its own doesn't denote a constructor. The pattern the syntax definition uses (simplified test\s*\() however matches only if all required tokens are on the same line, because ST doesn't include the linefeed into \s and does lexing line-per-line only. That's what is called line-blindness.

A workaround may be to use ST's branching feature, but this would theoretically need to be implemented for more such situations and adds a lot of complexity to the syntax definition.

@deathaxe deathaxe added T: enhancement Improvement of existing language features C: Syntax labels Apr 29, 2023
@deathaxe deathaxe changed the title [dlang] newline after constructor name before open parentheses produces unexpected results [D] newline after constructor name before open parentheses produces unexpected results May 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C: Syntax T: enhancement Improvement of existing language features
Projects
None yet
Development

No branches or pull requests

2 participants