-
Couldn't load subscription status.
- Fork 35.8k
Allows insertText to be empty, introduces URI and renames DisplayLocation to Hint. #273125
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
Conversation
There was a problem hiding this 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 refactors inline completion functionality by renaming DisplayLocation to Hint and allowing insertText to be optional. The changes introduce a uri field to support completions that apply to files other than the current document, and consolidate naming conventions across the codebase (e.g., action → gutterMenuLinkAction, label → content, kind → style).
Reviewed Changes
Copilot reviewed 15 out of 17 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| extHostTypeConverters.ts | Renames namespace from InlineCompletionDisplayLocationKind to InlineCompletionHintStyle and updates type conversions to use languages.InlineCompletionHintStyle |
| extHostLanguageFeatures.ts | Updates import to remove InlineCompletionDisplayLocationKind, changes action to gutterMenuLinkAction, displayLocation to hint, and adds uri field support |
| standaloneLanguages.ts | Updates exported enum name from InlineCompletionDisplayLocationKind to InlineCompletionHintStyle |
| suggestInlineCompletions.ts | Renames action parameter to gutterMenuLinkAction in constructor |
| inlineEditsCustomView.ts | Updates imports and type signatures to use InlineSuggestHint instead of InlineCompletionDisplayLocation, renames label to content and kind to style |
| inlineEditsViewInterface.ts | Changes type of displayLocation from InlineCompletionDisplayLocation to InlineSuggestHint |
| inlineEditsView.ts | Adds check for uri field to determine when to use custom view |
| inlineEditsModel.ts | Updates type imports and renames displayLocation to hint |
| inlineEditWithChanges.ts | Adds trailing comma to constructor parameters |
| provideInlineCompletions.ts | Handles optional insertText, adds URI support, removes IDisplayLocation interface, and updates to use InlineCompletionHint |
| inlineSuggestionItem.ts | Renames displayLocation to hint throughout, adds uri field support, renames class from InlineSuggestDisplayLocation to InlineSuggestHint, and updates property names (label → content, kind → style) |
| inlineCompletionsSource.ts | Simplifies telemetry logging to use hint directly instead of deconstructing properties |
| inlineCompletionsModel.ts | Updates all references from displayLocation to hint |
| standaloneEnums.ts | Moves and renames enum from InlineCompletionDisplayLocationKind to InlineCompletionHintStyle |
| languages.ts | Updates InlineCompletion interface to allow optional insertText, adds uri field, renames action to gutterMenuLinkAction and displayLocation to hint, renames related types and enums |
|
|
||
| snippetInfo = undefined; | ||
| } else if (inlineCompletion.insertText === undefined) { | ||
| insertText = ''; // TODO use undefined |
Copilot
AI
Oct 24, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The TODO comment 'use undefined' conflicts with the actual implementation of setting insertText to an empty string. Either remove the TODO if empty string is the intended behavior, or implement the undefined behavior and remove this fallback.
| insertText = ''; // TODO use undefined | |
| insertText = undefined; |
| if (result) { | ||
| for (const item of result.inlineSuggestions.items) { | ||
| if (item.isInlineEdit || typeof item.insertText !== 'string') { | ||
| if (item.isInlineEdit || typeof item.insertText !== 'string' && item.insertText !== undefined) { |
Copilot
AI
Oct 24, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The condition typeof item.insertText !== 'string' && item.insertText !== undefined should use parentheses for clarity: (typeof item.insertText !== 'string' && item.insertText !== undefined)
|
Red CI |
No description provided.