Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions packages/amazonq/src/app/inline/completion.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import {
Disposable,
window,
TextEditor,
InlineCompletionTriggerKind,
} from 'vscode'
import { LanguageClient } from 'vscode-languageclient'
import {
Expand All @@ -30,6 +31,7 @@ import {
ReferenceInlineProvider,
ReferenceLogViewProvider,
ImportAdderProvider,
CodeSuggestionsState,
} from 'aws-core-vscode/codewhisperer'

export class InlineCompletionManager implements Disposable {
Expand Down Expand Up @@ -180,6 +182,12 @@ export class AmazonQInlineCompletionItemProvider implements InlineCompletionItem
token: CancellationToken
): Promise<InlineCompletionItem[] | InlineCompletionList> {
if (this.isNewSession) {
const isAutoTrigger = context.triggerKind === InlineCompletionTriggerKind.Automatic
if (isAutoTrigger && !CodeSuggestionsState.instance.isSuggestionsEnabled()) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this a bug on master as well?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Technically yeah for lsp inline support, but nobody has that enabled. For regular inline support master is working as expected

Copy link
Contributor

Choose a reason for hiding this comment

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

I see, wanted to double check this was hidden behind feature flag, but that makes sense.

// return early when suggestions are disabled with auto trigger
return []
}

// make service requests if it's a new session
await this.recommendationService.getAllRecommendations(
this.languageClient,
Expand Down
Loading