Skip to content

Fields and Functions with the same name are not distinct #549

Description

@johnfking

Describe the bug
When creating a field and a function of the same name (they have different return types), the code completion popup only shows the Function and not the Field.

Sample Code:

`---@Class car @parent class
---@field public body body Retreive the nested body object
local car = {}
---get the body object
---@return string body
function car.body() end

---@Class body : car
local body = {}

--- Number of doors
---@return number
function body.doors() end

--- Style of car
---@return string
function body.style() end`

Expected behavior
I would expect when typing car.b - that the typeahead would show two options distinguished by the symbol for a function and field.

Screenshots
image

Environment (please complete the following information):

  • OS: Windows
  • No
  • Client: VSCode

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions