LuaLS / LuaLS/lua-language-server

Adding parent or higher directory to workspace.library of the .luarc.json of a subproject produces erroneous duplicate field/etc warnings

Open
#2,061 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

### How are you using the lua-language-server?

NeoVim

### Which OS are you using?

Linux

### What is the issue affecting?

Annotations, Type Checking, Diagnostics/Syntax Checking

### Expected Behaviour

No warnings issued for duplicate fields and similar.

### Actual Behaviour

Many warnings about duplicates are produced

### Reproduction steps

Create a subproject and add the parent directory to the subproject's .luarc.json, then create some annotated type and observe warnings about duplicates.

### Additional Notes

It is really a small issue but it would be great to be able to work on subprojects and get require() completions for both the true module name of the project, as well as my other projects within the path

### Log File

_No response_

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 reproducing the issue in NeoVim on Linux with a subproject whose .luarc.json adds its parent directory to workspace.library. Compare diagnostics for annotated types and duplicate fields, and verify require() completions across the project paths. Done means the configuration produces no erroneous duplicate warnings while retaining the expected completions.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.