-
-
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
Breaking changes in 3.X #980
Comments
I think |
Maybe I can continue to call it |
I have merged a |
The CPU usage of the latest plugin version (
|
多个文件声明类的方法该怎么写呢 |
请单独开个issue并提供日志 |
你可以多次使用 |
Thanks for the great server/extension! With the latest version of the VS Code extension (3.0.0) I get a lot of undefined field errors in classes. e.g. I actually use middleclass for classes, but that used to work fine in previous versions. Is this the same unsupported case as "find definition in methods"? As I use classes heavily, this is raising a lot of warnings. Is there a workaround or do you recommend that I revert to a previous 2.X version? |
You can choose:
|
function mt:init()
self.xxx = 1
end Supported finding definition of |
I think this issue we found all links to here: #1158 I'd very much like to have the old functionality from 2.6.8 back. There are fringe cases in WoW addon development (addon namespace tables as an example) where field references being pulled through tables and subtables are very much needed. I tried adding See the above mentioned issue and further quoted issue from Ketho's WoW API extension repo (also mentioned within the above mentioned issue). Thank you for working on this! :) |
Hello!
in some cases we have more about 100 variables in self, and it is not comfortable to declare all as ---@field |
@SalavatR |
You can use ---@param self my_window
function init(self)
---@class my_window
self = self
self.variable = true
lcf1(self)
end This is to prevent fields from being declared unexpectedly. |
Thanks! |
@SalavatR LLS only analize fields in |
I was able to make references across namespaces work in the latest version by simply using the following syntax in every file: ---@class ns
local ns = select(2, ...) Does this work for you? Edit -- Never mind, this only seems to work for a depth of one level. |
it would be really nice to have a |
Introduce
I'm working on the 3.X version, the purpose is to add a more complete type system, and use this to implement features such as type checking.
In previous versions I tried to keep the type system compatible with
EmmyLua
, but I will make some breaking changes after version 3.X, so the type system may not be suitable to continue to be calledEmmyLua
in the future, but I haven't thought about it yet,I will call it.LuaDoc
for nowBreaking changes
Always trace local set
Dose not trace field inject
use
---@class
insteadFinding definition does not recurse
Find definition of
t.y
will not find outt.x
Find definition of
o
will not find outmt
Type
unknown
Types can be used in doc-table keys
boolean type
true
andfalse
You can use
---@type { [string]: true }
now.class
andalias
support generic inheritancetable<integer, string>
can not convert tostring[]
Default value of
unrary
andbinary
unknown
can form union types with other typesInteger type
doc-enum
must be a stringThis means you can no longer use
---@param x '1024'|'true'|'function () end'
to represent a specific number, boolean or function. Use---@param x 1024|true|fun()
instead.For compatibility, I will continue to recognize
'"xxx"'
as the stringxxx
instead of"xxx"
.integer
is a class inLua 5.1
andLua 5.2
Although
Lua 5.1
andLua 5.2
runtimes do not have integer, many API parameters require a number that can be converted to an integer, so adding integer to the type system can help you handle this part.Not supported for now
search metatable in this case
This turns the reference into a definition, and checking the reference in order to search for a definition is too expensive.
Please use
---@class
or use this:The text was updated successfully, but these errors were encountered: