Skip to content

Add label completions #888

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

Merged
merged 1 commit into from
May 21, 2025
Merged

Add label completions #888

merged 1 commit into from
May 21, 2025

Conversation

gabritto
Copy link
Member

No description provided.

@Copilot Copilot AI review requested due to automatic review settings May 20, 2025 19:13
Copy link
Contributor

@Copilot 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

Adds support for showing label completions after break/continue statements.

  • Introduce an early branch in getCompletionsAtPosition to call new label-completion helpers
  • Implement getLabelCompletionsAtPosition and getLabelStatementCompletions
  • Update the AST alias list and add tests covering various label-completion scenarios

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

File Description
internal/ls/completions_test.go New tests under TestCompletions for break/continue label suggestions
internal/ls/completions.go Added logic to detect break/continue context and return label completions
internal/ast/ast.go Extended Node aliases with BreakOrContinueStatement
Comments suppressed due to low confidence (1)

internal/ls/completions.go:4137

  • [nitpick] the name uniques is ambiguous; consider renaming to seenLabels or uniqueLabels to clarify that it tracks which label names have already been added.
var uniques core.Set[string]

@gabritto gabritto added this pull request to the merge queue May 21, 2025
Merged via the queue into main with commit 6d650e8 May 21, 2025
23 checks passed
@gabritto gabritto deleted the gabritto/labelcompletion branch May 21, 2025 00:18
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.

None yet

3 participants