LuaLS / LuaLS/lua-language-server
`duplicate-set-field` is reading from CoreLibs even though `diagnostics.libraryFiles` is set to 'Disable'
Nobody has claimed this yet.
- 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?
Visual Studio Code Extension (sumneko.lua)
Which OS are you using?
Windows
What is the issue affecting?
Formatting
Expected Behaviour
I do not see a warning for duplicate-set-field in my project.
Actual Behaviour
Hi
Thanks for this plugin. I am getting warning for duplicate-set-field on this line:
function playdate.update()
and the duplicate is in the CoreLibs folder here:
...\PlaydateSDK\CoreLibs\__stub.lua
I have set the CoreLibs folder to be ignored by the code checker:
"Lua.diagnostics.libraryFiles": "Disable",
Is this the expected behaviour?
Reproduction steps
- Install Lua language server plugin
- Set
"Lua.diagnostics.libraryFiles": "Disable", - Create
main.lua - Add the line
function playdate.update()tomain.lua - Observe warning:
"resource": "/e:/dev/miner/Source/main.lua",
"owner": "_generated_diagnostic_collection_name_#0",
"code": "duplicate-set-field",
"severity": 4,
"message": "Duplicate field `update`.",
"source": "Lua Diagnostics.",
"startLineNumber": 72,
"startColumn": 10,
"endLineNumber": 72,
"endColumn": 25,
"relatedInformation": [
{
"startLineNumber": 5,
"startColumn": 10,
"endLineNumber": 5,
"endColumn": 25,
"message": ".twopolefilter.s",
"resource": "/e:/devtools/PlaydateSDK/CoreLibs/__stub.lua"
}
]
}]
Additional Notes
No response
Log File
No response
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the warning using main.lua, the playdate.update() line, and the Lua.diagnostics.libraryFiles setting set to Disable; compare the diagnostic with CoreLibs/__stub.lua. Trace how duplicate-set-field diagnostics handle library files and verify the setting’s documented behavior. Done means the observed warning behavior is consistent with the intended configuration.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- lua
- Domain
- devtools
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100