Skip to content
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

添加对 EmmyLua table type 的支持 #340

Merged
merged 7 commits into from
Jan 20, 2021
Merged

Conversation

uhziel
Copy link
Contributor

@uhziel uhziel commented Jan 4, 2021

相关讨论见 #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?>)
]]

script/parser/guide.lua Outdated Show resolved Hide resolved
script/parser/guide.lua Outdated Show resolved Hide resolved
@uhziel
Copy link
Contributor Author

uhziel commented Jan 4, 2021

嗯嗯好,我处理下

@@ -16,6 +16,11 @@ local function getTypesOfFile(uri)
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
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
Copy link
Collaborator

sumneko commented Jan 20, 2021

先合了,有问题以后再说

@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.

None yet

2 participants