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

Odd indenting that goes away once ran twice #290

Closed
Kampfkarren opened this issue Nov 8, 2021 · 3 comments · Fixed by #295
Closed

Odd indenting that goes away once ran twice #290

Kampfkarren opened this issue Nov 8, 2021 · 3 comments · Fixed by #295
Labels
bug Something isn't working

Comments

@Kampfkarren
Copy link

return function()
	call(function()
		local abortSelfPromise = abortSelf(
			function()
				return Promise.resolve(true)
			end,

			function()
				return Promise.new(function(newResolve)
					resolve = newResolve
				end)
			end
		)
	end)
end

...gets formatted the first time to:

return function()
	call(function()
		local abortSelfPromise = abortSelf(function()
			return Promise.resolve(true)
		end, 
function()
			return Promise.new(function(newResolve)
				resolve = newResolve
			end)
		end)
	end)
end

...until being replaced with the best result:

return function()
	call(function()
		local abortSelfPromise = abortSelf(function()
			return Promise.resolve(true)
		end, function()
			return Promise.new(function(newResolve)
				resolve = newResolve
			end)
		end)
	end)
end
@Kampfkarren
Copy link
Author

Kampfkarren commented Nov 8, 2021

Another odd style change with multiple functions:

return function()
	if overrides == nil then
		setupOverrides()
	end

	if overrides[key] == nil then
		return value
	end

	return overrides[key]
end, function(callback)
	overrideWatchers[key] = callback
end

...gets formatted into

return function()
	if overrides == nil then
		setupOverrides()
	end

	if overrides[key] == nil then
		return value
	end

	return overrides[key]
end,
	function(callback)
		overrideWatchers[key] = callback
	end

@JohnnyMorganz JohnnyMorganz added the bug Something isn't working label Nov 8, 2021
@JohnnyMorganz
Copy link
Owner

JohnnyMorganz commented Nov 9, 2021

First example can be narrowed down further into something unrelated to functions:

local foo = foo(
	foo,

	bar
)

local bar = foo(
        
        foo,
        bar
)

seems to be caused by the extra newline in between the arguments, possibly related to #169

@JohnnyMorganz
Copy link
Owner

#290 (comment) going to open another issue for this - as its unrelated to the current issue, and theres a bit more to it

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

Successfully merging a pull request may close this issue.

2 participants