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

hover is not working as intended #244

Closed
qyte opened this issue Nov 9, 2020 · 7 comments
Closed

hover is not working as intended #244

qyte opened this issue Nov 9, 2020 · 7 comments
Labels
bug Something isn't working

Comments

@qyte
Copy link

qyte commented Nov 9, 2020

example follows

--a.lua
local t = GlobalTable

t.settings = {
test = 1
}

--b.lua

local b = GlobalTable.settings

print(b.test)

when hovering over settings i can see test = 1

when i type b. i get NO autocomplete and hovering over b says local b: any {}
settings hover
b hover

b shows test:any only because i hard coded it inside print.
new b hover

Reverting to 0.21.12 for now

@sumneko
Copy link
Collaborator

sumneko commented Nov 12, 2020

Should be fixed in 1.0.2

@sumneko sumneko closed this as completed Nov 12, 2020
@sumneko sumneko added the bug Something isn't working label Nov 12, 2020
@qyte
Copy link
Author

qyte commented Aug 9, 2021

After version 2.0 this issue has again made it through of sorts

version 2.3.4 hover but the same exists for all version 2.x onwards
image

version 1.21.3 (latest 1.x)
image

a much cleaner hover that actually shows the values

@sumneko sumneko reopened this Aug 9, 2021
@sumneko
Copy link
Collaborator

sumneko commented Aug 9, 2021

For performance reasons, I currently do not track the assignment of global variables to a local variable.
It is recommended that you directly use global variables to define fields.

@qyte
Copy link
Author

qyte commented Aug 9, 2021

I use lua for a WoW addon i maintain and since require is not supported there is literally no other way to share tables between files besides the namespace table provided by wow lua or using globals
And i need to rely on/use subtables of subtables all the time

i use locals for shorthand access for easy auto-completion and hover for checking if i misstyped something somewhere.

@sumneko
Copy link
Collaborator

sumneko commented Aug 9, 2021

I am currently sacrificing some accuracy in exchange for performance optimization, but I continue to focus on this matter and explore better solutions that take into account accuracy and performance.
In the worst case, I intend to provide options for you to customize whether to enable certain optimizations.

I will try some methods tomorrow to restore the search method mentioned in this issue.

@qyte
Copy link
Author

qyte commented Dec 10, 2021

ok version 2.4.8 was working the best way possible but after the 2.4.9 onwards hover is broken again.

@sumneko
Copy link
Collaborator

sumneko commented Dec 10, 2021

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants