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

Chained reference autocomplete broken from 1.21.3 to 2.0.3 #578

Closed
muppet9010 opened this issue Jun 25, 2021 · 6 comments
Closed

Chained reference autocomplete broken from 1.21.3 to 2.0.3 #578

muppet9010 opened this issue Jun 25, 2021 · 6 comments
Labels
bug Something isn't working duplicate This issue or pull request already exists

Comments

@muppet9010
Copy link

Using the below sample code in 1.21.3 I could get auto complete on first. at the end of the function. It offered autocomplete for the LuaEntity class. In 2.0.3 the auto complete is blank or will only populate with other attributes if accessed within the function.
local process = function() local refEntity = {} ---@type LuaEntity local list = refEntity.get_train_stop_trains() -- returns LuaEntity[] local first = list[1] local test = first. end

This requires the below class file (remove .txt from name) to be loaded in to Lua.workspace.library setting.
runtime-api.lua.txt
This is a class file someone else has generated for the Factorio pc game's API.

@sumneko sumneko added the bug Something isn't working label Jun 25, 2021
@sumneko
Copy link
Collaborator

sumneko commented Jun 25, 2021

You should use ---@type LuaEntity[] above local list = ...

@muppet9010
Copy link
Author

muppet9010 commented Jun 25, 2021

Even though get_train_stop_trains() has a return of type LuaEntity[] defined against it?
As the onhover over the function shows it.

@sumneko
Copy link
Collaborator

sumneko commented Jun 25, 2021

image

Is this what you mean?

EDIT: It should be fixed by b68f95c

@muppet9010
Copy link
Author

muppet9010 commented Jun 25, 2021 via email

@sumneko sumneko added the duplicate This issue or pull request already exists label Jun 25, 2021
@sumneko
Copy link
Collaborator

sumneko commented Jun 25, 2021

see #574

@sumneko sumneko closed this as completed Jun 25, 2021
@muppet9010
Copy link
Author

nice, thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

2 participants