CppCXY / EmmyLuaCodeStyle

fast, powerful, and feature-rich Lua formatting and checking tool.
MIT License
138 stars 26 forks source link

add option to add `call_arg_parenthesis` when they are missing #179

Open NobbZ opened 2 months ago

NobbZ commented 2 months ago

currently call_arg_parentheses seems only to be able to remove parenthesis when they are there. Though it can not add them if they are missing.

As I consider constructs like require"ext".setup{} confusing, I'd prefer if emmy would normalize to always have parenthesis.

CppCXY commented 2 months ago

What plugin do you currently use to access EmmyLuaCodeStyle formatting

CppCXY commented 2 months ago

I've added the option call_arg_parentheses=always before, but it's not release

NobbZ commented 2 months ago

I currently use the CLI (latest release https://github.com/CppCXY/EmmyLuaCodeStyle/tree/1.5.4) as well as lua-ls.

Using a CLI built from source (latest master or certain commit) would be rather trivial for me, though I had no clue how to ensure that lua-ls uses it.

CppCXY commented 2 months ago

lua-ls is not used through CLI; it is compiled from source and used as a lua-lib.

NobbZ commented 2 months ago

I expected that much, though it seems as if they even vendor it, as I was unable to find a replaceable reference to this project in my package management.


I checked, they do, I am happy to try to patch it locally.

Can you please confirm that the latest master should have this feature, or is it in some development branch?

CppCXY commented 2 months ago

Can you please confirm that the latest master should have this feature, or is it in some development branch?

I don't branch unless it's an important update

CppCXY commented 2 months ago

I have been updating my own language server, so I have been somewhat neglecting updates for this project. If you are interested, you can follow my own language server.

NobbZ commented 2 months ago

Thanks for pointing that out, though I heavily rely on autogenerated .luarc.jsons to set up the load path correctly. And I do not have the time to spare currently to replace that generator with a generator for another format.

Maybe if your alternative implementation would support loading a .luarc.json I'd be eager to give it a try.

CppCXY commented 2 months ago

Thanks for pointing that out, though I heavily rely on autogenerated .luarc.jsons to set up the load path correctly. And I do not have the time to spare currently to replace that generator with a generator for another format.

Maybe if your alternative implementation would support loading a .luarc.json I'd be eager to give it a try.

We implement according to the same standards. We will discuss the implementation of many features, but he(sumneko) doesn't have time to update his ls, while I will implement these features. However, I do not directly support reading .luarc.json. Initially, that's what I did, but I found that many settings were unnecessary. Usually, directly copying the .luarc.json configuration to my configuration works just fine.