LuaLS / LuaLS/lua-language-server

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

Đang mở
#2,035 11 bình luận 6 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

question
Ngôn ngữ chính
Lua
Star
4.4k
Fork
442
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

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

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Hướng nghiên cứu

Tái hiện cảnh báo bằng main.lua, dòng playdate.update() và thiết lập Lua.diagnostics.libraryFiles được đặt thành Disable; so sánh chẩn đoán với CoreLibs/__stub.lua. Truy vết cách các chẩn đoán duplicate-set-field xử lý các tệp thư viện và xác minh hành vi được ghi trong tài liệu của thiết lập. Được xem là hoàn tất khi hành vi cảnh báo quan sát được nhất quán với cấu hình dự kiến.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
lua
Lĩnh vực
devtools
Loại issue
Lỗi
Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức độ hoạt động
Đình trệ
Độ rõ ràng
Khá rõ ràng
Mức phù hợp với người mới
35/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.