EmmyLua / IntelliJ-EmmyLua

Lua IDE/Debugger Plugin for IntelliJ IDEA
https://emmylua.github.io
Apache License 2.0
1.74k stars 293 forks source link

Added additional code style settings #379

Closed pouwelsjochem closed 3 years ago

pouwelsjochem commented 3 years ago

"Around concat operators" configures wether you'd like to have a space around the Lua '..' concatenations. (previously spaces were always added)

"Inside inline table" configures wether you'd like to have a space between the curly brackets and a table field, e.g. { field = 1 } vs {field = 1} (previously spaces were always added)

pouwelsjochem commented 3 years ago

Thanks for including these changes! It seems like the "Inside inline table" works perfectly fine, but the "Around concat operator" does not.

I'm not sure why though, the changes look very alike. And reading the code, it looks like it should work. Could you have a quick look at this? I'm not able to build the plugin myself to test the changes.

tangzx commented 3 years ago

@pouwelsjochem see this commit. But I changed "space around concat operators" to "space around binary operators". Build: https://ci.appveyor.com/project/EmmyLua/intellij-emmylua/build/artifacts

pouwelsjochem commented 3 years ago

Ah I didn't notice CONCAT is also in the BINARY_OPS group. Was that why it wasn't working? Was it perhaps being overridden by the BINARY_OPS settings?

Isn't it even better to include all three options? The "Around assignment operators", the "Around concat operators" and the "Around binary operators"

Personally I couldn't use the new solution, since our team coding guideline is to use space around assignments like local a = 1 + 2 * 3 but not use space around concatenations local a = userName.."_someSuffix"