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

Version 3.x -> Undefined fields #1059

Closed
Rusenec opened this issue Apr 15, 2022 · 4 comments
Closed

Version 3.x -> Undefined fields #1059

Rusenec opened this issue Apr 15, 2022 · 4 comments
Labels
duplicate This issue or pull request already exists

Comments

@Rusenec
Copy link

Rusenec commented Apr 15, 2022

Describe the bug
Getting Undefined field "field_name".
Last working version: 2.6.8
Current version: 3.0.2

To Reproduce
Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior

Screenshots

Environment (please complete the following information):

  • OS: Windows
  • Client: VSCode

Additional context
The classes are big and this is a fragment of them but illustrates the issue.
The fields were properly recognized using version 2.6.8
For example, the field wep1 and xp are not recognized when using 3.x (including 3.0.2), neither when typing to give suggestions, nor after being fully typed.
There are classes that inherit from this one and they have the same behavior for the fields, either theirs or parent's, undefined with version 3.0.2

`
---@Class Cl_char
Cl_char = {}
Cl_char.__index = Cl_char

setmetatable(Cl_char,
{
__call = function(cls, init_t)
local self = setmetatable({}, cls)
self:init(init_t)
return self
end,
})

function Cl_char:init(init_t)
self.wep1 = nil
self.xp = 0
end

function Cl_char:free()
if self.wep1 then self.wep1:free() end
end
`

Provide logs
Find the log at https://github.com/sumneko/lua-language-server/wiki/Default-log-path

@sumneko
Copy link
Collaborator

sumneko commented Apr 16, 2022

see #980

@sumneko sumneko closed this as completed Apr 16, 2022
@sumneko sumneko added the duplicate This issue or pull request already exists label Apr 16, 2022
@Rusenec
Copy link
Author

Rusenec commented Apr 16, 2022

Hi sumneko, I looked at 980 before creating this issue, probably I'm missing something, but could you point me towards what? Do i need to change/add a lot of annotations now, to make it work like 2.6.8, what am I missing?
Or the case is not yet supported and I just need to wait?

@sumneko
Copy link
Collaborator

sumneko commented Apr 16, 2022

You can refer to: #980 (comment)

@Rusenec
Copy link
Author

Rusenec commented Apr 16, 2022

I'll have it in mind. Thank you sumneko. Thank you for the great work you are doing!

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

No branches or pull requests

2 participants