diff --git a/README.md b/README.md index b7a101827f6a7..9ef3a879555c3 100644 --- a/README.md +++ b/README.md @@ -54,7 +54,7 @@ Many of the core components and extensions to VS Code live in their own reposito ## Bundled Extensions -VS Code includes a set of built-in extensions located in the [extensions](extensions) folder, including grammars and snippets for many languages. Extensions that provide rich language support (code completion, Go to Definition) for a language have the suffix `language-features`. For example, the `json` extension provides coloring for `JSON` and the `json-language-features` extension provides rich language support for `JSON`. +VS Code includes a set of built-in extensions located in the [extensions](extensions) folder, including grammars and snippets for many languages. Extensions that provide rich language support (inline suggestions, Go to Definition) for a language have the suffix `language-features`. For example, the `json` extension provides coloring for `JSON` and the `json-language-features` extension provides rich language support for `JSON`. ## Development Container diff --git a/extensions/json-language-features/server/README.md b/extensions/json-language-features/server/README.md index 1c38291607229..8047006f4e3c1 100644 --- a/extensions/json-language-features/server/README.md +++ b/extensions/json-language-features/server/README.md @@ -17,7 +17,7 @@ The JSON language server supports requests on documents of language id `json` an The server implements the following capabilities of the language server protocol: -- [Code completion](https://microsoft.github.io/language-server-protocol/specification#textDocument_completion) for JSON properties and values based on the document's [JSON schema](http://json-schema.org/) or based on existing properties and values used at other places in the document. JSON schemas are configured through the server configuration options. +- [Inline Suggestion](https://microsoft.github.io/language-server-protocol/specification#textDocument_completion) for JSON properties and values based on the document's [JSON schema](http://json-schema.org/) or based on existing properties and values used at other places in the document. JSON schemas are configured through the server configuration options. - [Hover](https://microsoft.github.io/language-server-protocol/specification#textDocument_hover) for values based on descriptions in the document's [JSON schema](http://json-schema.org/). - [Document Symbols](https://microsoft.github.io/language-server-protocol/specification#textDocument_documentSymbol) for quick navigation to properties in the document. - [Document Colors](https://microsoft.github.io/language-server-protocol/specification#textDocument_documentColor) for showing color decorators on values representing colors and [Color Presentation](https://microsoft.github.io/language-server-protocol/specification#textDocument_colorPresentation) for color presentation information to support color pickers. The location of colors is defined by the document's [JSON schema](http://json-schema.org/). All values marked with `"format": "color-hex"` (VSCode specific, non-standard JSON Schema extension) are considered color values. The supported color formats are `#rgb[a]` and `#rrggbb[aa]`. @@ -37,7 +37,7 @@ The JSON language server expects the client to only send requests and notificati The JSON language server has the following dependencies on the client's capabilities: -- Code completion requires that the client capability has *snippetSupport*. If not supported by the client, the server will not offer the completion capability. +- Inline suggestion requires that the client capability has *snippetSupport*. If not supported by the client, the server will not offer the completion capability. - Formatting support requires the client to support *dynamicRegistration* for *rangeFormatting*. If not supported by the client, the server will not offer the format capability. ## Configuration diff --git a/src/vs/editor/browser/services/inlineCompletionsService.ts b/src/vs/editor/browser/services/inlineCompletionsService.ts index 260d617e7af3c..0f8fcc0cfdbe0 100644 --- a/src/vs/editor/browser/services/inlineCompletionsService.ts +++ b/src/vs/editor/browser/services/inlineCompletionsService.ts @@ -222,7 +222,7 @@ export class SnoozeInlineCompletion extends Action2 { ]; const picked = await quickInputService.pick(items, { - placeHolder: localize('snooze.placeholder', "Select snooze duration for Code completions and NES"), + placeHolder: localize('snooze.placeholder', "Select snooze duration for Inline Suggestions"), activeItem: items.find(item => item.value === lastSelectedDuration), }); diff --git a/src/vs/editor/common/standaloneStrings.ts b/src/vs/editor/common/standaloneStrings.ts index 262c6383f9eab..f15817953a8b6 100644 --- a/src/vs/editor/common/standaloneStrings.ts +++ b/src/vs/editor/common/standaloneStrings.ts @@ -24,7 +24,7 @@ export namespace AccessibilityHelpNLS { export const tabFocusModeOnMsg = nls.localize("tabFocusModeOnMsg", "Pressing Tab in the current editor will move focus to the next focusable element. Toggle this behavior{0}.", ''); export const tabFocusModeOffMsg = nls.localize("tabFocusModeOffMsg", "Pressing Tab in the current editor will insert the tab character. Toggle this behavior{0}.", ''); export const stickScroll = nls.localize("stickScrollKb", "Focus Sticky Scroll{0} to focus the currently nested scopes.", ''); - export const suggestActions = nls.localize("suggestActionsKb", "Trigger the suggest widget{0} to show possible code completions.", ''); + export const suggestActions = nls.localize("suggestActionsKb", "Trigger the suggest widget{0} to show possible inline suggestions.", ''); export const acceptSuggestAction = nls.localize("acceptSuggestAction", "Accept suggestion{0} to accept the currently selected suggestion.", ''); export const toggleSuggestionFocus = nls.localize("toggleSuggestionFocus", "Toggle focus between the suggest widget and the editor{0} and toggle details focus with{1} to learn more about the suggestion.", '', ''); export const codeFolding = nls.localize("codeFolding", "Use code folding to collapse blocks of code and focus on the code you're interested in via the Toggle Folding Command{0}.", ''); diff --git a/src/vs/editor/contrib/inlineCompletions/browser/controller/commands.ts b/src/vs/editor/contrib/inlineCompletions/browser/controller/commands.ts index 68c7820558587..58846c3a38651 100644 --- a/src/vs/editor/contrib/inlineCompletions/browser/controller/commands.ts +++ b/src/vs/editor/contrib/inlineCompletions/browser/controller/commands.ts @@ -13,9 +13,8 @@ import { IClipboardService } from '../../../../../platform/clipboard/common/clip import { IConfigurationService } from '../../../../../platform/configuration/common/configuration.js'; import { ContextKeyExpr } from '../../../../../platform/contextkey/common/contextkey.js'; import { KeybindingsRegistry, KeybindingWeight } from '../../../../../platform/keybinding/common/keybindingsRegistry.js'; -import { INotificationService, Severity } from '../../../../../platform/notification/common/notification.js'; import { ICodeEditor } from '../../../../browser/editorBrowser.js'; -import { EditorAction, EditorCommand, ServicesAccessor } from '../../../../browser/editorExtensions.js'; +import { EditorAction, ServicesAccessor } from '../../../../browser/editorExtensions.js'; import { EditorContextKeys } from '../../../../common/editorContextKeys.js'; import { Context as SuggestContext } from '../../../suggest/browser/suggest.js'; import { hideInlineCompletionId, inlineSuggestCommitId, jumpToNextInlineEditId, showNextInlineSuggestionActionId, showPreviousInlineSuggestionActionId, toggleShowCollapsedId } from './commandIds.js'; @@ -81,43 +80,6 @@ export class TriggerInlineSuggestionAction extends EditorAction { } } -export class ExplicitTriggerInlineEditAction extends EditorAction { - constructor() { - super({ - id: 'editor.action.inlineSuggest.triggerInlineEditExplicit', - label: nls.localize2('action.inlineSuggest.trigger.explicitInlineEdit', "Trigger Next Edit Suggestion"), - precondition: EditorContextKeys.writable, - }); - } - - public async run(accessor: ServicesAccessor, editor: ICodeEditor): Promise { - const notificationService = accessor.get(INotificationService); - const controller = InlineCompletionsController.get(editor); - - await controller?.model.get()?.triggerExplicitly(undefined, true); - if (!controller?.model.get()?.inlineEditAvailable.get()) { - notificationService.notify({ - severity: Severity.Info, - message: nls.localize('noInlineEditAvailable', "No inline edit is available.") - }); - } - } -} - -export class TriggerInlineEditAction extends EditorCommand { - constructor() { - super({ - id: 'editor.action.inlineSuggest.triggerInlineEdit', - precondition: EditorContextKeys.writable, - }); - } - - public override async runEditorCommand(accessor: ServicesAccessor, editor: ICodeEditor, args: { triggerKind?: 'automatic' | 'explicit' }): Promise { - const controller = InlineCompletionsController.get(editor); - await controller?.model.get()?.trigger(undefined, { onlyFetchInlineEdits: true }); - } -} - export class AcceptNextWordOfInlineCompletion extends EditorAction { constructor() { super({ diff --git a/src/vs/editor/contrib/inlineCompletions/browser/inlineCompletions.contribution.ts b/src/vs/editor/contrib/inlineCompletions/browser/inlineCompletions.contribution.ts index f0294b339b550..1885a412fb295 100644 --- a/src/vs/editor/contrib/inlineCompletions/browser/inlineCompletions.contribution.ts +++ b/src/vs/editor/contrib/inlineCompletions/browser/inlineCompletions.contribution.ts @@ -6,9 +6,9 @@ import { AccessibleViewRegistry } from '../../../../platform/accessibility/browser/accessibleViewRegistry.js'; import { registerAction2 } from '../../../../platform/actions/common/actions.js'; import { wrapInHotClass1 } from '../../../../platform/observable/common/wrapInHotClass.js'; -import { EditorContributionInstantiation, registerEditorAction, registerEditorCommand, registerEditorContribution } from '../../../browser/editorExtensions.js'; +import { EditorContributionInstantiation, registerEditorAction, registerEditorContribution } from '../../../browser/editorExtensions.js'; import { HoverParticipantRegistry } from '../../hover/browser/hoverTypes.js'; -import { AcceptInlineCompletion, AcceptNextLineOfInlineCompletion, AcceptNextWordOfInlineCompletion, DevExtractReproSample, HideInlineCompletion, JumpToNextInlineEdit, ShowNextInlineSuggestionAction, ShowPreviousInlineSuggestionAction, ToggleAlwaysShowInlineSuggestionToolbar, ExplicitTriggerInlineEditAction, TriggerInlineSuggestionAction, TriggerInlineEditAction, ToggleInlineCompletionShowCollapsed } from './controller/commands.js'; +import { AcceptInlineCompletion, AcceptNextLineOfInlineCompletion, AcceptNextWordOfInlineCompletion, DevExtractReproSample, HideInlineCompletion, JumpToNextInlineEdit, ShowNextInlineSuggestionAction, ShowPreviousInlineSuggestionAction, ToggleAlwaysShowInlineSuggestionToolbar, TriggerInlineSuggestionAction, ToggleInlineCompletionShowCollapsed } from './controller/commands.js'; import { InlineCompletionsController } from './controller/inlineCompletionsController.js'; import { InlineCompletionsHoverParticipant } from './hintsWidget/hoverParticipant.js'; import { InlineCompletionsAccessibleView } from './inlineCompletionsAccessibleView.js'; @@ -17,8 +17,6 @@ import { CancelSnoozeInlineCompletion, SnoozeInlineCompletion } from '../../../b registerEditorContribution(InlineCompletionsController.ID, wrapInHotClass1(InlineCompletionsController.hot), EditorContributionInstantiation.Eventually); registerEditorAction(TriggerInlineSuggestionAction); -registerEditorAction(ExplicitTriggerInlineEditAction); -registerEditorCommand(new TriggerInlineEditAction()); registerEditorAction(ShowNextInlineSuggestionAction); registerEditorAction(ShowPreviousInlineSuggestionAction); registerEditorAction(AcceptNextWordOfInlineCompletion); diff --git a/src/vs/workbench/contrib/chat/browser/actions/chatActions.ts b/src/vs/workbench/contrib/chat/browser/actions/chatActions.ts index 1df45c2c16929..51c8fec2a8841 100644 --- a/src/vs/workbench/contrib/chat/browser/actions/chatActions.ts +++ b/src/vs/workbench/contrib/chat/browser/actions/chatActions.ts @@ -1462,7 +1462,7 @@ export function registerChatActions() { constructor() { super({ id: 'workbench.action.chat.configureCodeCompletions', - title: localize2('configureCompletions', "Configure Code Completions..."), + title: localize2('configureCompletions', "Configure Inline Suggestions..."), precondition: ContextKeyExpr.and( ChatContextKeys.Setup.installed, ChatContextKeys.Setup.disabled.negate(), @@ -1501,11 +1501,11 @@ export function registerChatActions() { const chatQuotaExceeded = chatEntitlementService.quotas.chat?.percentRemaining === 0; const completionsQuotaExceeded = chatEntitlementService.quotas.completions?.percentRemaining === 0; if (chatQuotaExceeded && !completionsQuotaExceeded) { - message = localize('chatQuotaExceeded', "You've reached your monthly chat messages quota. You still have free code completions available."); + message = localize('chatQuotaExceeded', "You've reached your monthly chat messages quota. You still have free inline suggestions available."); } else if (completionsQuotaExceeded && !chatQuotaExceeded) { - message = localize('completionsQuotaExceeded', "You've reached your monthly code completions quota. You still have free chat messages available."); + message = localize('completionsQuotaExceeded', "You've reached your monthly inline suggestions quota. You still have free chat messages available."); } else { - message = localize('chatAndCompletionsQuotaExceeded', "You've reached your monthly chat messages and code completions quota."); + message = localize('chatAndCompletionsQuotaExceeded', "You've reached your monthly chat messages and inline suggestions quota."); } if (chatEntitlementService.quotas.resetDate) { @@ -1515,7 +1515,7 @@ export function registerChatActions() { } const free = chatEntitlementService.entitlement === ChatEntitlement.Free; - const upgradeToPro = free ? localize('upgradeToPro', "Upgrade to GitHub Copilot Pro (your first 30 days are free) for:\n- Unlimited code completions\n- Unlimited chat messages\n- Access to premium models") : undefined; + const upgradeToPro = free ? localize('upgradeToPro', "Upgrade to GitHub Copilot Pro (your first 30 days are free) for:\n- Unlimited inline suggestions\n- Unlimited chat messages\n- Access to premium models") : undefined; await dialogService.prompt({ type: 'none', diff --git a/src/vs/workbench/contrib/chat/browser/chat.contribution.ts b/src/vs/workbench/contrib/chat/browser/chat.contribution.ts index c79d3b3fb1084..469ddcce68057 100644 --- a/src/vs/workbench/contrib/chat/browser/chat.contribution.ts +++ b/src/vs/workbench/contrib/chat/browser/chat.contribution.ts @@ -694,7 +694,7 @@ configurationRegistry.registerConfiguration({ }, 'chat.disableAIFeatures': { type: 'boolean', - description: nls.localize('chat.disableAIFeatures', "Disable and hide built-in AI features provided by GitHub Copilot, including chat, code completions and next edit suggestions."), + description: nls.localize('chat.disableAIFeatures', "Disable and hide built-in AI features provided by GitHub Copilot, including chat and inline suggestions."), default: false, scope: ConfigurationScope.WINDOW }, diff --git a/src/vs/workbench/contrib/chat/browser/chatStatus.ts b/src/vs/workbench/contrib/chat/browser/chatStatus.ts index 63b9e0c04bce5..1025c89b78f1d 100644 --- a/src/vs/workbench/contrib/chat/browser/chatStatus.ts +++ b/src/vs/workbench/contrib/chat/browser/chatStatus.ts @@ -236,7 +236,7 @@ export class ChatStatusBarEntry extends Disposable implements IWorkbenchContribu if (chatQuotaExceeded && !completionsQuotaExceeded) { quotaWarning = localize('chatQuotaExceededStatus', "Chat quota reached"); } else if (completionsQuotaExceeded && !chatQuotaExceeded) { - quotaWarning = localize('completionsQuotaExceededStatus', "Completions quota reached"); + quotaWarning = localize('completionsQuotaExceededStatus', "Inline suggestions quota reached"); } else { quotaWarning = localize('chatAndCompletionsQuotaExceededStatus', "Quota reached"); } @@ -249,13 +249,13 @@ export class ChatStatusBarEntry extends Disposable implements IWorkbenchContribu // Completions Disabled else if (this.editorService.activeTextEditorLanguageId && !isCompletionsEnabled(this.configurationService, this.editorService.activeTextEditorLanguageId)) { text = '$(copilot-unavailable)'; - ariaLabel = localize('completionsDisabledStatus', "Code completions disabled"); + ariaLabel = localize('completionsDisabledStatus', "Inline suggestions disabled"); } // Completions Snoozed else if (this.completionsService.isSnoozing()) { text = '$(copilot-snooze)'; - ariaLabel = localize('completionsSnoozedStatus', "Code completions snoozed"); + ariaLabel = localize('completionsSnoozedStatus', "Inline suggestions snoozed"); } } @@ -392,7 +392,7 @@ class ChatStatusDashboard extends Disposable { run: () => this.runCommandAndClose(() => this.openerService.open(URI.parse(defaultChat.manageSettingsUrl))), })); - const completionsQuotaIndicator = completionsQuota && (completionsQuota.total > 0 || completionsQuota.unlimited) ? this.createQuotaIndicator(this.element, disposables, completionsQuota, localize('completionsLabel', "Code completions"), false) : undefined; + const completionsQuotaIndicator = completionsQuota && (completionsQuota.total > 0 || completionsQuota.unlimited) ? this.createQuotaIndicator(this.element, disposables, completionsQuota, localize('completionsLabel', "Inline Suggestions"), false) : undefined; const chatQuotaIndicator = chatQuota && (chatQuota.total > 0 || chatQuota.unlimited) ? this.createQuotaIndicator(this.element, disposables, chatQuota, localize('chatsLabel', "Chat messages"), false) : undefined; const premiumChatQuotaIndicator = premiumChatQuota && (premiumChatQuota.total > 0 || premiumChatQuota.unlimited) ? this.createQuotaIndicator(this.element, disposables, premiumChatQuota, localize('premiumChatsLabel', "Premium requests"), true) : undefined; @@ -429,7 +429,7 @@ class ChatStatusDashboard extends Disposable { else if (this.chatEntitlementService.anonymous && this.chatEntitlementService.sentiment.installed) { addSeparator(localize('anonymousTitle', "Copilot Usage")); - this.createQuotaIndicator(this.element, disposables, localize('quotaLimited', "Limited"), localize('completionsLabel', "Code completions"), false); + this.createQuotaIndicator(this.element, disposables, localize('quotaLimited', "Limited"), localize('completionsLabel', "Inline Suggestions"), false); this.createQuotaIndicator(this.element, disposables, localize('quotaLimited', "Limited"), localize('chatsLabel', "Chat messages"), false); } @@ -493,7 +493,7 @@ class ChatStatusDashboard extends Disposable { // Settings { const chatSentiment = this.chatEntitlementService.sentiment; - addSeparator(localize('codeCompletions', "Code Completions"), chatSentiment.installed && !chatSentiment.disabled && !chatSentiment.untrusted ? toAction({ + addSeparator(localize('inlineSuggestions', "Inline Suggestions"), chatSentiment.installed && !chatSentiment.disabled && !chatSentiment.untrusted ? toAction({ id: 'workbench.action.openChatSettings', label: localize('settingsLabel', "Settings"), tooltip: localize('settingsTooltip', "Open Settings"), @@ -699,14 +699,14 @@ class ChatStatusDashboard extends Disposable { const modeId = this.editorService.activeTextEditorLanguageId; const settings = container.appendChild($('div.settings')); - // --- Code completions + // --- Inline Suggestions { const globalSetting = append(settings, $('div.setting')); - this.createCodeCompletionsSetting(globalSetting, localize('settings.codeCompletions.allFiles', "All files"), '*', disposables); + this.createInlineSuggestionsSetting(globalSetting, localize('settings.codeCompletions.allFiles', "All files"), '*', disposables); if (modeId) { const languageSetting = append(settings, $('div.setting')); - this.createCodeCompletionsSetting(languageSetting, localize('settings.codeCompletions.language', "{0}", this.languageService.getLanguageName(modeId) ?? modeId), modeId, disposables); + this.createInlineSuggestionsSetting(languageSetting, localize('settings.codeCompletions.language', "{0}", this.languageService.getLanguageName(modeId) ?? modeId), modeId, disposables); } } @@ -756,7 +756,7 @@ class ChatStatusDashboard extends Disposable { return checkbox; } - private createCodeCompletionsSetting(container: HTMLElement, label: string, modeId: string | undefined, disposables: DisposableStore): void { + private createInlineSuggestionsSetting(container: HTMLElement, label: string, modeId: string | undefined, disposables: DisposableStore): void { this.createSetting(container, [defaultChat.completionsEnablementSetting], label, this.getCompletionsSettingAccessor(modeId), disposables); } @@ -846,10 +846,10 @@ class ChatStatusDashboard extends Disposable { const timeLeftMs = this.inlineCompletionsService.snoozeTimeLeft; if (!isEnabled || timeLeftMs <= 0) { - timerDisplay.textContent = localize('completions.snooze5minutesTitle', "Hide completions for 5 min"); + timerDisplay.textContent = localize('completions.snooze5minutesTitle', "Hide suggestions for 5 min"); timerDisplay.title = ''; button.label = label; - button.setTitle(localize('completions.snooze5minutes', "Hide completions and NES for 5 min")); + button.setTitle(localize('completions.snooze5minutes', "Hide inline suggestions for 5 min")); return true; } @@ -858,7 +858,7 @@ class ChatStatusDashboard extends Disposable { const seconds = timeLeftSeconds % 60; timerDisplay.textContent = `${minutes}:${seconds < 10 ? '0' : ''}${seconds} ${localize('completions.remainingTime', "remaining")}`; - timerDisplay.title = localize('completions.snoozeTimeDescription', "Completions are hidden for the remaining duration"); + timerDisplay.title = localize('completions.snoozeTimeDescription', "Inline suggestions are hidden for the remaining duration"); button.label = localize('completions.plus5min', "+5 min"); button.setTitle(localize('completions.snoozeAdditional5minutes', "Snooze additional 5 min")); toolbar.push([cancelAction], { icon: true, label: false }); diff --git a/src/vs/workbench/contrib/welcomeGettingStarted/common/gettingStartedContent.ts b/src/vs/workbench/contrib/welcomeGettingStarted/common/gettingStartedContent.ts index 64b06614e3ef1..8264534af8d80 100644 --- a/src/vs/workbench/contrib/welcomeGettingStarted/common/gettingStartedContent.ts +++ b/src/vs/workbench/contrib/welcomeGettingStarted/common/gettingStartedContent.ts @@ -328,7 +328,7 @@ export const walkthroughs: GettingStartedWalkthroughContent = [ { id: 'findLanguageExtensionsWeb', title: localize('gettingStarted.findLanguageExts.title', "Rich support for all your languages"), - description: localize('gettingStarted.findLanguageExts.description.interpolated', "Code smarter with syntax highlighting, code completion, linting and debugging. While many languages are built-in, many more can be added as extensions.\n{0}", Button(localize('browseLangExts', "Browse Language Extensions"), 'command:workbench.extensions.action.showLanguageExtensions')), + description: localize('gettingStarted.findLanguageExts.description.interpolated', "Code smarter with syntax highlighting, inline suggestions, linting and debugging. While many languages are built-in, many more can be added as extensions.\n{0}", Button(localize('browseLangExts', "Browse Language Extensions"), 'command:workbench.extensions.action.showLanguageExtensions')), when: 'workspacePlatform != \'webworker\'', media: { type: 'svg', altText: 'Language extensions', path: 'languages.svg' diff --git a/src/vs/workbench/services/chat/common/chatEntitlementService.ts b/src/vs/workbench/services/chat/common/chatEntitlementService.ts index ac2e2ee50218e..4dbad52014de4 100644 --- a/src/vs/workbench/services/chat/common/chatEntitlementService.ts +++ b/src/vs/workbench/services/chat/common/chatEntitlementService.ts @@ -472,7 +472,7 @@ type EntitlementClassification = { sku: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The SKU of the chat entitlement' }; quotaChat: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The number of chat requests available to the user' }; quotaPremiumChat: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The number of premium chat requests available to the user' }; - quotaCompletions: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The number of code completions available to the user' }; + quotaCompletions: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The number of inline suggestions available to the user' }; quotaResetDate: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The date the quota will reset' }; owner: 'bpasero'; comment: 'Reporting chat entitlements';