Repository navigation
fix(completion): replace only the version slot after @ so VS Code filters on it - #379
Merged
eFAILution merged 1 commit intoNov 5, 2026
Conversation
X-Guardian
marked this pull request as ready for review
October 30, 2026 09:02
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
@showed nothing when a YAML extension's word pattern treats/,$and@as word characters (the Red Hat YAML extension's does). The items had norange, so VS Code filtered them against the word at the cursor, which was the whole$CI_SERVER_FQDN/group/project/component@reference. No version label matched it.@.parseVersionCompletionPrefixreports where that slot starts, and the provider sets the item'srangefrom there to the cursor, so VS Code filters on the partial version alone.@when the YAML extension's word pattern is active #378Change Type
Context
User-facing impact
@again. With or without the Red Hat YAML extension, typing@after a cached component lists its versions, and typing part of a version narrows the list.Why a range rather than
filterTextSetting
filterTextto the version would still be scored against the whole-reference word, since VS Code takes the word from the item's range (or, absent one, the word at the cursor). The range is the thing that was wrong, so the fix sets it. The slot column comes from the parser the provider already uses, which keeps the regex as the one place that knows where the version starts.GitLab scope
Affected areas
What changed by bucket
src/utils/componentReference.tsparseVersionCompletionPrefixalso returnsversionStart, the column right after the@.src/providers/completionProvider.tsprovideVersionCompletionstakes the cursor position and sets every version item'srangeto[versionStart, cursor]on that line.tests/unit/componentReference.test.tsValidation
Local checks
npm run compilenpm test(876 passing)npm run lint(clean,--max-warnings 0)npm run test:extension-hostTests
componentReference.test.ts: everyparseVersionCompletionPrefixcase assertsversionStart, including the empty partial version, the quoted reference, references with$CI_SERVER_FQDNand${CI_SERVER_FQDN}, and a new case where the partial version itself contains a/(@feature/my-).--disable-extensionsand no network, so it can neither install the YAML extension's word pattern nor seed a cached remote component. The parser test pins the column; the range assignment is one line.Breaking Changes
parseVersionCompletionPrefixreturns an extra field. Its only callers are the completion provider and its tests.Screenshots / Recordings (if UI behavior changed)
- component: $CI_SERVER_FQDN/g/p/c@shows no suggestions.Risk and Rollback
@part of the word in the other direction (so the word started inside the version), the explicit range still wins, since VS Code uses the item's range when one is set.Release Notes Draft
@in acomponent:reference now appear when the Red Hat YAML extension (or any YAML word pattern that allows/and@in a word) is active.Checklist