Open Nick-Mazuk opened 2 years ago
@rpatters1's reply:
I tend to agree with @ThistleSifter that I don't like the forced line splitting. In fact, I continue to do most of my editing in ZeroBrane because of the debugging. But it also allows me to fix lint issues found by VSCode without having to take the line splitting on board.
Yeah, this isn't the greatest formatter out there. I think having consistent, automatic formatting is more important than good formatting, but I'm totally open to improving the automated formatting.
Feel free to change the format config at https://github.com/finale-lua/lua-scripts/blob/master/luaconfig.config to something that looks better. Or if you find a better formatter that works with VS Code, we can switch to that.
Though any changes in that formatter should go in a separate PR so we can also reformat the entire repo in that PR. And if/when such a PR is created, we should merge it quickly to reduce merge conflicts with future PRs.
I'm going to piggyback this issue to mention that every time I launch Code it prompts me with some options about the "OpenResty" workspace, none of which is the one I want: to shut and go away for good. I have no idea what's going on, but if I allow it to modify my settings it switches me to LuaJIT, among other things.
Interesting. Is that every time you launch this repo, the /src
folder of the repo, or every time you launch VS Code in general?
It's only when I open /src
. Maybe it is something to do with the Lua Debugger extension (which I loaded again but still can't get to work.) I currently have
I'm thinking one of those last two may be detritus from trying to get the formatting working. One of them is also what needs the "lua.targetVersion": "5.2"
setting.
I don't have these extensions:
The other two I have.
I actually don't personally use debuggers at all, so I'm not sure if it is the debugger or how to help you get the debugger working.
I'd be okay with removing the limit on line length. Other than that, I don't have any major issues with the formatter.
I concur with removing the limit on line length. The other formatting preferences are fine.
I'm fine with that. I'm not sure if there's a way to disable the line length feature, but you can set it to 9999. I'll approve any PRs changing this.
Does anyone know how to turn off line formatting completely? I expanded the line length to a huge number, but now I can't break of the lines manually.
It looks like you potentially can't turn it off. The code ensures the value exists and that it's an integer. I also tried using -1
, but that seemed to disable formatting altogether, not just the line length.
That's unfortunate.
I guess all we can do is hope that respecting manual line breaks is added someday: https://github.com/Koihik/LuaFormatter/issues/240
Creating a new issue based on a conversation in #167. Here's the original message by @ThistleSifter:
I didn't run into any issues setting it up, but I have noticed that occasionally the style fixer does odd things.
Eg The comment in line 242 in
mixin/FCMCtrlListBox.lua
applies to theelse
below, so it should only be indented once, not twice.I'm not a fan of some of the line splitting, although I understand that these boil down to personal preference so I'm not going to quibble about it:
mixin/FCMCtrlListBox.lua
, which it won't let me split into multiple lines so it visually matches the following arguments.for...do
in line 216 inmixin/FCMCusomWindow.lua
be all on the same linemixin/FCXCustomLuaWindow.lua
isn't great.Originally posted by @ThistleSifter in https://github.com/finale-lua/lua-scripts/issues/167#issuecomment-1114501284