Skip to content

Unknown references through addon namespaces #31

Closed
@Arxareon

Description

@Arxareon

Hey!

I'm communicating between different files of my addons through the provided addon namespaces. Previously, annotations and references were pulled through the namespace so I could Ctrl+click to jump to a function shared in the namespace from one file to another or I could see the EmmyLua annotation on a function defined in another file for instance.

More specifically, I use a global table shared between addons, which contains subtables with version keys. A specific key is shared in the addon namespace so all files of the addon can access the specific subtable of that global table with that key (if multiple addons are on the same version, they can access the same subtable with the identical key - that's the idea in a nutshell).

Now, this functionality is broken. I'm not sure if it was broken by the main Lua extension of sumneko or WoW API specifically.

Example:

Code in file 1:

--Addon identifier name, namespace table
local addonNameSpace, ns = ...

--This is a hello
ns.Hello = function() end

--This is a global hello
Hello = function() end

Code in file 2:

--Addon identifier name, namespace table
local addonNameSpace, ns = ...

ns.Hello()

Hello()

Annotation and jump to definition doesn't work when it's through the namespace table:
image

Annotation and jump to definition does work when it's global (as it did previously with the namespace as well):
image

It might be related to this issue, I'm not sure: #28 (comment)

Metadata

Metadata

Assignees

No one assigned

    Labels

    annotationsLuaLS annotationsbugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions