feat: add setting to disable completion - #3058
Draft
imtiyazakiwat wants to merge 1 commit into
Draft
Conversation
imtiyazakiwat
force-pushed
the
feat/disable-completion
branch
from
July 25, 2026 14:53
88c4700 to
272b737
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! 🚀 New features to boost your workflow:
|
Adds `ansible.completion.enabled` (default true) so users who want the extension only for syntax highlighting can turn off all completion items. The guard runs at the top of doCompletion, ahead of the schema-based completion branch, so schema-backed files such as meta/main.yml are covered as well. doCompletionResolve leaves items untouched when the setting is off. fixes: ansible#837
imtiyazakiwat
force-pushed
the
feat/disable-completion
branch
from
July 25, 2026 15:53
272b737 to
2d1dd32
Compare
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
Adds
ansible.completion.enabled(defaulttrue) so users who use theextension mainly for syntax highlighting can turn off completion entirely.
This was requested in #837, where a maintainer indicated a PR would be
welcome.
Implementation
Follows the existing
ansible.validation.enabledpattern:ansible.completion.enableddeclared in the existing Completion sectionof
contributes.configuration. No new configuration section was added, sincepackages/ansible-language-server/test/globalSetup.tsreadscontributes.configuration[6]by index.ExtensionSettings.completionandCompletionSettingsWithDescription,with the default and description in
SettingsManager.doCompletionreads settings and returns[]at the top of the function,deliberately above the schema-completion branch, so schema-backed files
such as
meta/main.ymlare covered too.doCompletionResolvereturns the item untouched when the setting is off.ansible.completion.*toggles now cross-reference the newsetting in their descriptions, matching how
ansible.validation.lint.enabledrefers to
ansible.validation.enabled.Note: this suppresses items offered by this extension. VS Code's own
word-based suggestions remain governed by
editor.wordBasedSuggestions, andLightspeed inline suggestions stay under
ansible.lightspeed.suggestions.enabled.Tests
Four cases added to
completionProvider.test.ts:completer is not consulted a second time, which pins the guard's position
ahead of the schema branch
doCompletionResolveleavesinsertTextundefined when disabledVerification
vitest runovercompletionProvider,completionResolverandsettingsManagersuites: 77 passed, 57 skipped (@eecontainer tests), exit 0task lint: 19 hooks passed, 0 failedtask e2eandtask wdiowere not run locally; leaving this as a draft for CIfixes: #837