Skip to content

添加对 EmmyLua table type 的支持#340

Merged
sumneko merged 7 commits into
LuaLS:masterfrom
uhziel:doc-type-table
Jan 20, 2021
Merged

添加对 EmmyLua table type 的支持#340
sumneko merged 7 commits into
LuaLS:masterfrom
uhziel:doc-type-table

Conversation

@uhziel

@uhziel uhziel commented Jan 4, 2021

Copy link
Copy Markdown
Contributor

相关讨论见 #331

还有个用例需要扩充 simple 信息才能放开

--TODO 得扩展 simple 的信息才能识别这种情况了
TEST [[
---@class Foo
local Foo = {}
function Foo:bar1() end

---@class Foo2
local Foo2 = {}
function Foo2:<!bar1!>() end

---@type Foo2<number, Foo>
local v1
print(v1.<?bar1?>)
]]

Comment thread script/parser/guide.lua Outdated
Comment thread script/parser/guide.lua Outdated
@uhziel

uhziel commented Jan 4, 2021

Copy link
Copy Markdown
Contributor Author

嗯嗯好,我处理下

Comment thread script/vm/getDocs.lua
or src.type == 'doc.class.name'
or src.type == 'doc.extends.name'
or src.type == 'doc.alias.name' then
if src.type == 'doc.type.name' then

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里我限制了下,通过类型名,比如 ‘table’,不会它找到---@type table<k, v> 里的 table。进而导致我这里新加的用例失败。

@sumneko

sumneko commented Jan 20, 2021

Copy link
Copy Markdown
Collaborator

先合了,有问题以后再说

@sumneko sumneko merged commit 924aa35 into LuaLS:master Jan 20, 2021
@uhziel uhziel deleted the doc-type-table branch January 25, 2021 07:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants