Skip to content

Commit

Permalink
hide ghost text when invoking IE session (#180682)
Browse files Browse the repository at this point in the history
  • Loading branch information
jrieken authored Apr 24, 2023
1 parent 0a6b7a3 commit dbac899
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -215,4 +215,10 @@ export class InlineCompletionsController extends Disposable {
public shouldShowHoverAtViewZone(viewZoneId: string): boolean {
return this.ghostTextWidget.ownsViewZone(viewZoneId);
}

hide() {
transaction(tx => {
this?.model.get()?.stop(tx);
});
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ import { ModelDecorationOptions, createTextBufferFactoryFromSnapshot } from 'vs/
import { IEditorWorkerService } from 'vs/editor/common/services/editorWorker';
import { ILanguageFeaturesService } from 'vs/editor/common/services/languageFeatures';
import { IModelService } from 'vs/editor/common/services/model';
import { InlineCompletionsController } from 'vs/editor/contrib/inlineCompletions/browser/inlineCompletionsController';
import { localize } from 'vs/nls';
import { IConfigurationService } from 'vs/platform/configuration/common/configuration';
import { IContextKey, IContextKeyService } from 'vs/platform/contextkey/common/contextkey';
Expand Down Expand Up @@ -334,6 +335,9 @@ export class InteractiveEditorController implements IEditorContribution {

async run(options: InteractiveEditorRunOptions | undefined): Promise<void> {

// hide/cancel inline completions when invoking IE
InlineCompletionsController.get(this._editor)?.hide();

const editMode = this._getMode();

this._ctsSession.dispose(true);
Expand Down

0 comments on commit dbac899

Please sign in to comment.