LuaLS / LuaLS/lua-language-server

[Feature-Request/Question] Hide diagnostics while keeping require definitions for project files

Open
#1,646 6 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

question
Dominant language
Lua
Stars
4.4k
Forks
442
PR merge metrics
No merged PRs in 30d

Description

I have a project, where I use luarocks with modules directly installed in the projects folder (similar to how npm does it), which is handy for adding require paths, however what should I do, if they raise warnings?

I tried the following:

{
	"Lua.runtime.version": "LuaJIT",
	"Lua.workspace.library": [
		"${3rd}/love2d/library",
		"${3rd}/lfs/library",
		"${workspaceFolder}/lua_modules"
	],
	"Lua.runtime.path": [
		"src/?.lua",
		"src/?/init.lua",
		"doc/?.lua",
		"${workspaceFolder}/share/lua/5.1/?.lua",
		"${workspaceFolder}/share/lua/5.1/?/init.lua"
	],
	"Lua.workspace.ignoreDir": [
		"extern",
		"lua_modules" // Need option to ignore diagnostics, but keep definitions
	],
	"Lua.diagnostics.libraryFiles": "Disable",
}

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by inspecting how Lua.workspace.ignoreDir and Lua.diagnostics.libraryFiles are handled, using the configuration shown in the issue as the entry point. Trace how lua_modules is excluded from diagnostics and how its definitions are still discovered for require paths. Done means project-local modules remain available for definitions while their warnings are suppressed; no files or tests are named in the issue.

Written by the indexing model from the issue text.

Assessment

Tech stack
lua
Domain
devtools
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.