Skip to content

VS Code: add quick fixes to auto-expand incomplete frontmatter #372

Description

@sethjuarez

Summary

When the VS Code extension shows yellow squiggles in .prompty YAML frontmatter, it should offer a quick fix/code action to auto-expand or fill the missing schema shape.

Scenario

While authoring frontmatter, it is common to start with a shorthand or partial object, for example:

model:
  id: gpt-4o-mini
  provider: foundry
  apiType: chat
  connection:
    kind: reference
    # name missing

or:

template:
  format: jinja2

If the language service can detect a missing or incomplete structured field, the yellow squiggle should include an action such as:

  • Add missing connection name
  • Expand model connection block
  • Expand template block
  • Add required input/output fields
  • Convert shorthand to full form

Expected behavior

For frontmatter diagnostics where the extension knows the expected schema, Ctrl+. / Quick Fix should offer an auto-expand action that inserts the missing fields or expands shorthand into the full supported shape.

For example, a reference connection diagnostic could become:

connection:
  kind: reference
  name: <choose-or-type-connection-name>

Ideally, if reference connection autocomplete is available, the quick fix can also offer known configured connection names.

Actual behavior

The squiggle identifies that something is incomplete or invalid, but the user has to know the exact frontmatter shape and fill it manually.

Why it matters

Prompty frontmatter is powerful but has several nested shapes (model, connection, inputs, outputs, tools, template). Quick fixes would make authoring much smoother, especially for new users and live demos where recovering from a frontmatter warning should be fast.

Metadata

Metadata

Assignees

No one assigned

    Labels

    extensionRelated to the Prompty VS Code Extension

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions