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

Ignoring dir doesn't work when checking diagnostics

Open wojciech-kulik opened this issue 1 year ago • 5 comments

How are you using the lua-language-server?

NeoVim

Which OS are you using?

MacOS

What is the issue affecting?

Diagnostics/Syntax Checking

Expected Behaviour

When I set workspace.ignoreDir in .luarc.json it should exclude these folders from check when calling:

lua-language-server --check="some/path" --configpath="some/path/.luarc.json"

Actual Behaviour

The tool still prints errors in 3rd party dir.

Reproduction steps

  1. Create .luarc.json and put:
{
  "workspace.library": ["${3rd}/luassert/library"],
  "workspace.ignoreDir": ["${3rd}/luassert/library"],
  "diagnostics.globals": ["vim", "require", "describe", "it", "P"],
  "diagnostics.disable": ["different-requires"]
}
  1. Run:
lua-language-server --check="${DIR_SRC}" --configpath="${PWD}/.luarc.json" --checklevel=Information --logpath="${DIR_OUT}" --loglevel=error

Additional Notes

No response

Log File

No response

wojciech-kulik avatar Feb 27 '24 08:02 wojciech-kulik

I believe https://github.com/LuaLS/lua-language-server/pull/2546 probably solves your problem (but ignoreDir not working is still a bug)

emmericp avatar Feb 27 '24 21:02 emmericp

@emmericp thank you! Any advice on how can I quickly verify it? I see that there is no new release yet and I can't find any information how to build it.

./make.sh

This command requires some dependency:

./make.sh: line 7: ./3rd/luamake/luamake: No such file or directory

wojciech-kulik avatar Feb 28 '24 00:02 wojciech-kulik

that indicates the previous step failed, it compiles luamake first, so you are missing part of the error. likely dependencies, which are only gcc and ninja-build

but since my patch is lua only you can just apply it to your existing installation

emmericp avatar Feb 29 '24 21:02 emmericp

but since my patch is lua only you can just apply it to your existing installation

what did you mean by that? I installed LuaLS from Homebrew, so I've got only the binary file. I'm not sure how could I apply it?

wojciech-kulik avatar Mar 03 '24 14:03 wojciech-kulik

I think I solved the problem by setting in .luarc.json:

{
  "workspace.library": ["${3rd}/luassert/library"],
  "workspace.checkThirdParty": false,
  "diagnostics.libraryFiles": "Disable",
}

Specifically:

"diagnostics.libraryFiles": "Disable",

wojciech-kulik avatar Mar 03 '24 19:03 wojciech-kulik