Skip to content

AutocompleteEntry deprecated not set if a function is marked with @deprecated attribute #2158

@JohnnyMorganz

Description

@JohnnyMorganz

Here's some test cases:

TEST_CASE_FIXTURE(ACFixture, "autocomplete_entry_marked_as_deprecated_if_attribute_defined_on_function")
{
    check(R"(
        \@deprecated
        function foo()
        end

        @1
    )");

    auto ac = autocomplete('1');
    REQUIRE_EQ(ac.entryMap.count("foo"), 1);

    auto entry = ac.entryMap["foo"];
    CHECK(entry.deprecated);
}

TEST_CASE_FIXTURE(ACFixture, "autocomplete_entry_marked_as_deprecated_if_attribute_defined_on_function_in_table")
{
    check(R"(
        local t = {}

        \@deprecated
        function t.foo()
        end

        t.@1
    )");

    auto ac = autocomplete('1');
    REQUIRE_EQ(ac.entryMap.count("foo"), 1);

    auto entry = ac.entryMap["foo"];
    CHECK(entry.deprecated);
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions