Skip to content

Should provide object member completions when missing commas; also should insert missing commas #52604

Closed
@DanielRosenwasser

Description

@DanielRosenwasser

Today, if you try to request completions after an object literal element that has no comma, you'll get no useful contextual completions.

interface ColorPalette {
    primary?: string;
    secondary?: string;
}

let colors: ColorPalette = {
    primary: "red"
    /*$*/
};

image

interface ColorPalette {
    primary?: string;
    secondary?: string;
}

let colors: ColorPalette = {
    primary: "red"
    seconda/*$*/
};

image

My proposal is that we do something similar to what we do in class elements, but maybe a little smarter.

We should continue to provide contextual completions, and also, those completions should automatically insert the , on the previous line.

Metadata

Metadata

Assignees

Labels

BugA bug in TypeScriptDomain: Completion ListsThe issue relates to showing completion lists in an editorEffort: CasualGood issue if you're already used to contributing to the codebase. Harder than "good first issue".Fix AvailableA PR has been opened for this issueHelp WantedYou can do this

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions