Skip to content

lua_ls treat end as a keyword #3096

@winkee01

Description

@winkee01

Information

  • Editor: NeoVim
  • OS: MacOS
  • Issue topic: Diagnostics/Syntax Checking

Sample config

formatters = {
  prettier = {
    range_args = function(ctx)
      return { "--stdin-filepath", "$FILENAME", "--range-start", ctx.range.start, "--range-end", ctx.range.end }
    end,
  }
}

Issue description

Above config should have no syntax issue, however, lua_ls recognize end in ctx.range.end as a Lua keyword which terminates the function, and it reported an error on this "<field> expected".

even if I change it to ctx.range.["end"], it still reported "<field> expected". after I removed ctx.range.end, no errors were reported.

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