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

Сomment incorrectly influences formation #777

Open
d-enk opened this issue Sep 19, 2023 · 1 comment
Open

Сomment incorrectly influences formation #777

d-enk opened this issue Sep 19, 2023 · 1 comment
Labels
bug Something isn't working hard Issue is difficult to solve

Comments

@d-enk
Copy link

d-enk commented Sep 19, 2023

local arg_with_long_name, function_with_long_name

--- 1
function_with_long_name(function_with_long_name(
	arg_with_long_name, -- comment
	arg_with_long_name,
	arg_with_long_name,
	arg_with_long_name,
	arg_with_long_name,
	arg_with_long_name
))

--- 2
function_with_long_name(function_with_long_name(
	arg_with_long_name, --[[comment]]
	arg_with_long_name,
	arg_with_long_name,
	arg_with_long_name,
	arg_with_long_name,
	arg_with_long_name
))

--- 3
function_with_long_name(function_with_long_name(
	arg_with_long_name,
	arg_with_long_name,
	arg_with_long_name,
	arg_with_long_name,
	arg_with_long_name,
	arg_with_long_name
))

For 1 case formatting does not work and does not look like expected behavior.

@JohnnyMorganz JohnnyMorganz added the bug Something isn't working label Oct 14, 2023
@JohnnyMorganz JohnnyMorganz added the hard Issue is difficult to solve label Nov 12, 2023
@JohnnyMorganz
Copy link
Owner

The problem here is we eagerly select a different codepath because of the singleline comment in the first example.
It is difficult to detect this comment without being too expensive since it is nested inside another function call.
Will see if there is a way to solve this without a major performance penalty.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working hard Issue is difficult to solve
Projects
None yet
Development

No branches or pull requests

2 participants