Skip to content

duplicate-set-field is reading from CoreLibs even though diagnostics.libraryFiles is set to 'Disable' #2035

Description

@edzillion

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

  1. Install Lua language server plugin
  2. Set "Lua.diagnostics.libraryFiles": "Disable",
  3. Create main.lua
  4. Add the line function playdate.update() to main.lua
  5. 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionUser has a question

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions