Skip to content

Deal properly with comments in unusual places #307

@appgurueu

Description

@appgurueu

I like to comment my functions as follows:

function func(
	param_a -- description of a
	, param_b -- description of b
) end

StyLua turns this into the following:

function func(
	param_a -- description of a,
	param_b -- description of b
) end

Which is incorrect (a syntax error) as the comma is moved inside the comment. Lua 5.1 - 5.4 as well as LuaJIT all support such comments as they are filtered out in a tokenization step; poor syntax highlighters like GitHub's unfortunately don't.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions