Skip to content

Don't show word based suggestions when completion provider available#284094

Merged
benibenj merged 1 commit intomainfrom
benibenj/weird-chicken
Dec 17, 2025
Merged

Don't show word based suggestions when completion provider available#284094
benibenj merged 1 commit intomainfrom
benibenj/weird-chicken

Conversation

@benibenj
Copy link
Contributor

Copilot Generated Description: Update the word-based suggestions configuration to include an option that disables suggestions when inline completions are available. Adjust the completion provider registration to accommodate this new behavior.

closes #284076

Copilot AI review requested due to automatic review settings December 17, 2025 16:03
@benibenj benibenj enabled auto-merge December 17, 2025 16:03
@benibenj benibenj self-assigned this Dec 17, 2025
@vs-code-engineering vs-code-engineering bot added this to the December / January 2026 milestone Dec 17, 2025
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 pull request adds a new configuration option 'offWithInlineSuggestions' to the word-based suggestions setting. This option is designed to disable word-based completions when inline completion providers (like GitHub Copilot) are available for the current file. The change includes both the configuration schema definition and the implementation logic in the completion provider.

Key changes:

  • Adds 'offWithInlineSuggestions' enum value to the wordBasedSuggestions configuration
  • Passes ILanguageFeaturesService to WordBasedCompletionItemProvider to check for inline completion provider availability
  • Implements logic to skip word-based suggestions when the new option is set and inline completions are available

Reviewed changes

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

File Description
src/vs/editor/common/config/editorConfigurationSchema.ts Adds new 'offWithInlineSuggestions' enum value with description and experiment flag
src/vs/editor/browser/services/editorWorkerService.ts Adds ILanguageFeaturesService parameter and implements check to disable word-based completions when inline completion providers are available

Comment on lines 70 to +71
nls.localize('wordBasedSuggestions.off', 'Turn off Word Based Suggestions.'),
nls.localize('wordBasedSuggestions.offWithInlineSuggestions', 'Turn off Word Based Suggestions when Inline Suggestions are present.'),
Copy link

Copilot AI Dec 17, 2025

Choose a reason for hiding this comment

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

The enumDescriptions array order doesn't match the enum values order. The description for 'offWithInlineSuggestions' is placed second in the array, but 'offWithInlineSuggestions' is the last (5th) value in the enum. The descriptions should appear in the same order as their corresponding enum values: 'off', 'currentDocument', 'matchingDocuments', 'allDocuments', 'offWithInlineSuggestions'.

See below for a potential fix:

				nls.localize('wordBasedSuggestions.currentDocument', 'Only suggest words from the active document.'),
				nls.localize('wordBasedSuggestions.matchingDocuments', 'Suggest words from all open documents of the same language.'),
				nls.localize('wordBasedSuggestions.allDocuments', 'Suggest words from all open documents.'),
				nls.localize('wordBasedSuggestions.offWithInlineSuggestions', 'Turn off Word Based Suggestions when Inline Suggestions are present.'),

Copilot uses AI. Check for mistakes.
Comment on lines +67 to +71
enum: ['off', 'currentDocument', 'matchingDocuments', 'allDocuments', 'offWithInlineSuggestions'],
default: 'matchingDocuments',
enumDescriptions: [
nls.localize('wordBasedSuggestions.off', 'Turn off Word Based Suggestions.'),
nls.localize('wordBasedSuggestions.offWithInlineSuggestions', 'Turn off Word Based Suggestions when Inline Suggestions are present.'),
Copy link

Copilot AI Dec 17, 2025

Choose a reason for hiding this comment

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

The enum value 'offWithInlineSuggestions' is ambiguous. It's unclear whether this means "off when inline suggestions are present" or "off, but with inline suggestions enabled". Consider a more explicit name like 'offWhenInlineCompletions' or 'offWithInlineCompletions' to better convey that word-based suggestions are disabled when inline completion providers are available.

Suggested change
enum: ['off', 'currentDocument', 'matchingDocuments', 'allDocuments', 'offWithInlineSuggestions'],
default: 'matchingDocuments',
enumDescriptions: [
nls.localize('wordBasedSuggestions.off', 'Turn off Word Based Suggestions.'),
nls.localize('wordBasedSuggestions.offWithInlineSuggestions', 'Turn off Word Based Suggestions when Inline Suggestions are present.'),
enum: ['off', 'offWithInlineCompletions', 'currentDocument', 'matchingDocuments', 'allDocuments'],
default: 'matchingDocuments',
enumDescriptions: [
nls.localize('wordBasedSuggestions.off', 'Turn off Word Based Suggestions.'),
nls.localize('wordBasedSuggestions.offWithInlineCompletions', 'Turn off Word Based Suggestions when Inline Completions are present.'),

Copilot uses AI. Check for mistakes.
return undefined;
}

if (config.wordBasedSuggestions === 'offWithInlineSuggestions' && this.languageFeaturesService.inlineCompletionsProvider.has(model)) {
Copy link

Copilot AI Dec 17, 2025

Choose a reason for hiding this comment

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

The public API type definition in standalone/browser/standaloneCodeEditor.ts (line 128) also defines wordBasedSuggestions but does not include the new 'offWithInlineSuggestions' option. Consider whether this new option should be exposed in the standalone API as well for consistency.

Copilot uses AI. Check for mistakes.
Comment on lines +283 to +285
if (config.wordBasedSuggestions === 'offWithInlineSuggestions' && this.languageFeaturesService.inlineCompletionsProvider.has(model)) {
return undefined;
}
Copy link

Copilot AI Dec 17, 2025

Choose a reason for hiding this comment

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

When config.wordBasedSuggestions is 'offWithInlineSuggestions' but no inline completion provider is registered for the model, the function continues and falls into the else branch at line 293. This means 'offWithInlineSuggestions' will be treated like 'matchingDocuments' (line 302 check will fail, so it will match documents of the same language). This behavior is likely unintended. Consider what the expected behavior should be when 'offWithInlineSuggestions' is set but no inline completions provider is available - should it behave like 'matchingDocuments' or should there be an explicit fallback behavior?

Copilot uses AI. Check for mistakes.
@benibenj benibenj merged commit 608d33f into main Dec 17, 2025
33 of 34 checks passed
@benibenj benibenj deleted the benibenj/weird-chicken branch December 17, 2025 16:23
@vs-code-engineering vs-code-engineering bot locked and limited conversation to collaborators Jan 31, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Inline Suggestions: Do not show word based suggest widget if inline completions provider is available

3 participants