Skip to content
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

feat(audoedit): ensure inline completions are also hidden on dismiss #6465

Merged
merged 2 commits into from
Dec 27, 2024
Merged
Show file tree
Hide file tree
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: 4 additions & 4 deletions vscode/src/autoedits/autoedits-provider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,20 +59,20 @@ export interface AutoeditsPrediction {
*/
export class AutoeditsProvider implements vscode.InlineCompletionItemProvider, vscode.Disposable {
private readonly disposables: vscode.Disposable[] = []
private readonly onSelectionChangeDebounced: DebouncedFunc<typeof this.onSelectionChange>
/** Keeps track of the last time the text was changed in the editor. */
private lastTextChangeTimeStamp: number | undefined
private readonly onSelectionChangeDebounced: DebouncedFunc<typeof this.onSelectionChange>
public readonly rendererManager: AutoEditsRendererManager
private readonly modelAdapter: AutoeditsModelAdapter

private readonly promptStrategy = new ShortTermPromptStrategy()
public readonly filterPrediction = new FilterPredictionBasedOnRecentEdits()
private readonly contextMixer = new ContextMixer({
strategyFactory: new DefaultContextStrategyFactory(Observable.of(AUTOEDITS_CONTEXT_STRATEGY)),
contextRankingStrategy: ContextRankingStrategy.TimeBased,
dataCollectionEnabled: false,
})

public readonly rendererManager: AutoEditsRendererManager
public readonly filterPrediction = new FilterPredictionBasedOnRecentEdits()
Comment on lines -62 to -74
Copy link
Member Author

Choose a reason for hiding this comment

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

No changes; just grouped and ordered them semantically.


constructor(chatClient: ChatClient) {
this.modelAdapter = createAutoeditsModelAdapter({
providerName: autoeditsProviderConfig.provider,
Expand Down
1 change: 1 addition & 0 deletions vscode/src/autoedits/renderer/manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@ export class AutoEditsDefaultRendererManager implements AutoEditsRendererManager
decorator.dispose()
}
this.activeEdit = null
await vscode.commands.executeCommand('editor.action.inlineSuggest.hide')
await vscode.commands.executeCommand('setContext', 'cody.supersuggest.active', false)
}

Expand Down
Loading