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

.luarc.json file doesn't apply the nameStyle.config #2643

Open
Gerark opened this issue Apr 29, 2024 · 0 comments
Open

.luarc.json file doesn't apply the nameStyle.config #2643

Gerark opened this issue Apr 29, 2024 · 0 comments

Comments

@Gerark
Copy link

Gerark commented Apr 29, 2024

How are you using the lua-language-server?

Visual Studio Code Extension (sumneko.lua)

Which OS are you using?

Windows

What is the issue affecting?

Diagnostics/Syntax Checking, Formatting

Expected Behaviour

When I start VS code the nameStyle.config should be the one configured in the .luarc.json file.

Actual Behaviour

The nameStyle.config seems to revert internally to the default values. In order for the nameStyle to be applied I have to change the .luarc.json file once more so that VS code re-run some sort of update.

Reproduction steps

  1. Create a lua file in your workspace with this content:
toNumberOr = function (amount, defaultValue)
   -- do something
end
  1. Create a .luarc.json file with at list this configuration:
    "nameStyle": {
        "config": {
            "local_name_style": "camel_case",
            "function_param_name_style": "camel_case",
            "function_name_style": "camel_case",
            "local_function_name_style": "camel_case",
            "table_field_name_style": "camel_case",
            "global_variable_name_style": "pascal_case",
            "module_name_style": "pascal_case",
            "require_module_name_style": "pascal_case",
            "class_name_style": "pascal_case",
            "const_variable_name_style": "pascal_case"
        }
    }
  1. Start VS code
  2. Look at the lua file. It will complain about the name style not being correct
  3. Open and Modify the .luarc.json file
  4. Re-run the check on the workspace
  5. Now the issue is gone

Additional Notes

I'm using .editorconfig as well. I'm not sure if they are interfering with each other.

Log File

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant