Skip to content

autocompleted static symbols in objects only complete the class name, giving an invalid output #62400

@sadan4

Description

@sadan4

🔎 Search Terms

static symbol

🕗 Version & Regression Information

I could not get symbol intellisense working at all on ts playground

using every-ts:
I can reproduce this in 4.4 (the first version to support symbol indices according to stackoverflow.com/a/649435420) and 7956c00 (main at the time of writing)

⏯ Playground Link

No response

💻 Code

class Thing {
    static readonly SYM_FOO = Symbol('Thing.foo');

    public method() {
        const foo: { [Thing.SYM_FOO]: string[]; } = { [Thing.SYM_FOO]: ['bar'] };
        // Try autocompleting Thing.SYM_FOO on foo
        foo.
    }
}

🙁 Actual behavior

class Thing {
    static readonly SYM_FOO = Symbol('Thing.foo');

    public method() {
        const foo: { [Thing.SYM_FOO]: string[]; } = { [Thing.SYM_FOO]: ['bar'] };
        // Try autocompleting Thing.SYM_FOO on foo
        foo[Thing]
    }
}

🙂 Expected behavior

class Thing {
    static readonly SYM_FOO = Symbol('Thing.foo');

    public method() {
        const foo: { [Thing.SYM_FOO]: string[]; } = { [Thing.SYM_FOO]: ['bar'] };
        // Try autocompleting Thing.SYM_FOO on foo
        foo[Thing.SYM_FOO]
    }
}

Additional information about the issue

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions