Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
DanielRosenwasser opened this issue Feb 4, 2023 · 0 comments · Fixed by #52899
Assignees
Labels
Bug A bug in TypeScript Domain: Completion Lists The issue relates to showing completion lists in an editor Effort: Casual Good issue if you're already used to contributing to the codebase. Harder than "good first issue". Fix Available A PR has been opened for this issue Help Wanted You can do this

Comments

@DanielRosenwasser
Copy link
Member

DanielRosenwasser commented Feb 4, 2023

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.

@DanielRosenwasser DanielRosenwasser added Bug A bug in TypeScript Help Wanted You can do this Domain: Completion Lists The issue relates to showing completion lists in an editor Effort: Casual Good issue if you're already used to contributing to the codebase. Harder than "good first issue". labels Feb 4, 2023
@DanielRosenwasser DanielRosenwasser added this to the TypeScript 5.0.1 milestone Feb 4, 2023
@typescript-bot typescript-bot added the Fix Available A PR has been opened for this issue label Feb 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug A bug in TypeScript Domain: Completion Lists The issue relates to showing completion lists in an editor Effort: Casual Good issue if you're already used to contributing to the codebase. Harder than "good first issue". Fix Available A PR has been opened for this issue Help Wanted You can do this
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants