Skip to content

Commit

Permalink
feat(audoedit): ensure inline completions are also hidden on dismiss (#…
Browse files Browse the repository at this point in the history
…6465)

Programmatically dismisses inline completion ghost text on autoedit
dismissal.
  • Loading branch information
valerybugakov authored Dec 27, 2024
1 parent 8160d00 commit d0cbb2d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
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()

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

0 comments on commit d0cbb2d

Please sign in to comment.