Skip to content

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

@Gerark

Description

@Gerark

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions