lua-language-server icon indicating copy to clipboard operation
lua-language-server copied to clipboard

`runtime.version` isn't applied from `.luarc.json`

Open itaranto opened this issue 1 year ago • 1 comments

How are you using the lua-language-server?

NeoVim

Which OS are you using?

Linux

What is the issue affecting?

Completion

Expected Behaviour

It should look up definitions for LuaJIT (Lua 5.1).

Actual Behaviour

It looks up definitions for Lua 5.4.

Reproduction steps

  1. Having the following .luarc.json in a project:
{
  "$schema": "https://raw.githubusercontent.com/sumneko/vscode-lua/master/setting/schema.json",
  "diagnostics": {
    "globals": [ "after_each", "before_each", "describe", "it", "vim" ],
    "disable": [ "redefined-local" ]
  },
  "runtime": {
    "version": "LuaJIT"
  },
  "workspace": {
    "library": [
      "$VIMRUNTIME"
    ],
    "checkThirdParty": false
  }
}
  1. Open Neovim and edit a .lua file
  2. Go to definition for any standard library function
  3. Notice the version of the standard library used

Additional Notes

I'm using Neovim v0.10.1 with the native LSP.

I can reproduce this with a very simple config (no settings):

    lspconfig.lua_ls.setup({})

One important thing to mention is that other settings like diagnostics are properly applied.

Log File

file_home_ignacio_devel_projects_plantuml.nvim.log

itaranto avatar Sep 14 '24 18:09 itaranto