Skip to content

feat: autocomplete using inferred type instead of declared type in a function #1353

@Octogonapus

Description

@Octogonapus

A function parameter's declared type is used to autocomplete that parameter throughout the function, even when a more precise inferred type is known. For example:

abstract type Parent end

struct Child1 <: Parent
    field1::Int
end

struct Child2 <: Parent
    field2::String
end

function foo(x::Parent)
    if x isa Child1
        # can't autocomplete x.field1
        x::Child1
        # still can't autocomplete x.field1
        x = x::Child1
        # still can't autocomplete x.field1, even though the language server knows x is of type Child1
        (x::Child1) # still can't autocomplete x.field1
    end
end

This issue is a feature request to use the inferred type for autocompletion, instead of always using the declared type from the function signature.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions