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

Ignoring dir doesn't work when checking diagnostics #2548

Open
wojciech-kulik opened this issue Feb 27, 2024 · 7 comments
Open

Ignoring dir doesn't work when checking diagnostics #2548

wojciech-kulik opened this issue Feb 27, 2024 · 7 comments

Comments

@wojciech-kulik
Copy link

wojciech-kulik commented Feb 27, 2024

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

@emmericp
Copy link
Contributor

emmericp commented Feb 27, 2024

I believe #2546 probably solves your problem (but ignoreDir not working is still a bug)

@wojciech-kulik
Copy link
Author

@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

@emmericp
Copy link
Contributor

emmericp commented Feb 29, 2024

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

@wojciech-kulik
Copy link
Author

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
Copy link
Author

wojciech-kulik commented Mar 3, 2024

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",

@TOMO-CAT
Copy link

workspace.library

Excuse me, I tried your method but it didn't work.

I want to disable Lua diagnostics for the whole folder ./xmake/templates
image

here is my .luarc.json:

"workspace.library": [
        "xmake/templates"
    ],
"diagnostics.libraryFiles": "Disable"

For now, I can only disable the diagnosis of the entire project to workaround:

"diagnostics.disable": [
        "unknown-symbol",
        "exp-in-action"
    ]

thankyou so much!

@tomlau10
Copy link
Contributor

Hi @TOMO-CAT, there seems to be some problems related to workspace.library and "diagnostics.libraryFiles": "Disable" when the library path is relative to the workspace root, as discussed here: #2905

Unfortunately the cause of this issue is not identified yet 😕

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

4 participants