Skip to content

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

Closed

Description

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.

Activity

  1. added
    Bug
    Domain: LS: Completion Lists
    Effort: Casual
    on Feb 4, 2023
  2. added
    Fix Available
    on Feb 21, 2023
  3. locked as resolved and limited conversation to collaborators on Oct 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

BugDomain: LS: Completion ListsEffort: CasualFix Available

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions