-
-
Notifications
You must be signed in to change notification settings - Fork 331
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
关于诊断缺少继承的字段 #3023
Comments
Title: About diagnosing missing inherited fields |
目前這個繼承檢查效果,是在早前 #2970 引入的,因為當時認為沒有檢查繼承字段是 bug (好幾個 issues 回報這個問題)。
我個人的提議是對
---@class (partial) skill_config:skill,item
---餘下的完全相同 不過暫時來說未有人 implement 這個功能,並且作者應該是在忙 v4.0 重寫,似暫沒有空搞新功能了 |
The current inheritance checking effect was introduced earlier in #2970, because not checking inherited fields was considered a bug at the time (several issues reported this problem).
My personal suggestion is to add support for a
---@class (partial) skill_config:skill,item
---The rest are exactly the same However, no one has implemented this function for the time being, and the author is probably busy rewriting v4.0, so there seems to be no time for new functions. |
我写的新语言服务器就支持partial class, 以及我记得luals的enum是支持partial的, 我记得以前他把partial误拼为其他错误写法, 有可能是支持的 |
The new language server I wrote supports partial classes, and I remember that the enum of luals supports partial. I remember that he used to misspell partial with other incorrect spellings. It may be supported. |
最开始的时候sumneko, 想快速支持enum的partial最初的时候attribute名字叫merge, 后来我建议用partial, 再后来有次commit把拼写搞错了, 虽然我没有看过实现, 但是是有可能实现了的 |
At the beginning, Sumneko wanted to quickly support enum's partial. At first, the attribute name was merge. Later, I suggested using partial. Then there was a commit and the spelling was wrong. Although I have not seen the implementation, it is possible. of |
我再次看了下问题, 这里的partial和预想中的并不一样, 你们认为是类似typescript Partial, 而实际上我们计划实现的是C#中的partial class |
I read the question again. The partial here is different from what I expected. You think it is similar to typescript Partial, but in fact what we plan to implement is the partial class in C#. |
我不太熟悉 C#,查看了一下 manual 簡單來說就是分開 file 來寫1個 class (?) 你是說擔心如果這裡又叫 partial class,會跟 enum 那個 partial 屬性造成誤會嗎? |
I'm not very familiar with C#, so I checked the manual. In short, it means to separate the file and write a class (?) Are you worried that if it is called partial class here, it will cause misunderstanding with the partial attribute of enum? |
我看了下luals, 他确实支持了多个同名class定义, 而对enum又必须显式加上 partial, 给我有点的割裂的感觉 |
I took a look at luals, and it does support multiple class definitions with the same name, and partial must be explicitly added to enum, which gives me a bit of a sense of fragmentation. |
我剛開了個 PR 來支持 |
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?
Type Checking
Expected Behaviour
Actual Behaviour
我的skill_config继承自skill,在更新以后,在定义skill_config时缺少skill的所有定义参数,这个诊断可否增加一个设置,让我自己来选择是否判断缺少继承字段的检查
Reproduction steps
0
Additional Notes
No response
Log File
No response
The text was updated successfully, but these errors were encountered: