Skip to content

Conversation

@ericsciple
Copy link
Collaborator

Follow-up to PR:

Bug

When completing an empty value (e.g., permissions: |), mapping keys were incorrectly shown alongside scalar values. This made completions confusing:

Before:

  • permissions: | showed read-all, write-all, AND actions, contents, etc.
  • on: | showed check_run AND check_run (full syntax), etc.

After:

  • permissions: | shows only read-all and write-all
  • on: | shows only event names like push, check_run
  • concurrency: | shows no completions (user types their own group name)

Users who want the mapping form choose (full syntax) completions at the parent level (e.g., permissions (full syntax)).

@ericsciple ericsciple force-pushed the users/ericsciple/25-12-options branch from 6d803ff to 9ca0859 Compare December 24, 2025 01:23
@ericsciple ericsciple marked this pull request as ready for review December 24, 2025 01:28
@ericsciple ericsciple requested a review from a team as a code owner December 24, 2025 01:28
Copilot AI review requested due to automatic review settings December 24, 2025 01:28
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes autocomplete behavior to prevent mapping keys from appearing when completing inline values (Key mode). When a user types key: | (cursor after colon), the completion should only suggest inline scalar values, not mapping keys that would require a newline and indentation.

Key Changes:

  • Modified oneOfValues to filter out mapping variants in Key mode when no structure is committed
  • Updated test expectations to verify that mapping keys are excluded in Key mode scenarios
  • All affected tests now correctly expect only scalar completions (or no completions) at inline positions

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
languageservice/src/value-providers/definition.ts Added logic to skip mapping variants in Key mode when user hasn't committed to a structure (lines 209-211), preventing confusing newline-based completions for inline value positions
languageservice/src/complete.test.ts Updated test names, comments, and expectations to reflect new behavior where mapping keys are filtered in Key mode (e.g., `permissions:

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@ericsciple ericsciple force-pushed the users/ericsciple/25-12-options branch 2 times, most recently from 662015c to 90b57e3 Compare December 24, 2025 01:43
Follow-up to #265

When completing an empty value (e.g., `permissions: |`), mapping keys were
incorrectly shown alongside scalar values. This made completions confusing.

Before:
- `permissions: |` showed read-all, write-all, AND actions, contents, etc.
- `on: |` showed check_run AND check_run (full syntax), etc.

After:
- `permissions: |` shows only read-all and write-all
- `on: |` shows only event names like push, check_run
- `concurrency: |` shows no completions (user types their own group name)

Users who want the mapping form choose (full syntax) completions at the
parent level.
@ericsciple ericsciple force-pushed the users/ericsciple/25-12-options branch from 90b57e3 to da716cb Compare December 24, 2025 01:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants