Skip to content

Commit 6178b02

Browse files
authored
Notebooks -- lightbulbs hide upon leaving cell focus (microsoft#184929)
* lightbulbs hide upon cell leaving focus * whitespace/format
1 parent ab8ed4b commit 6178b02

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

src/vs/editor/contrib/codeAction/browser/codeActionController.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,10 @@ export class CodeActionController extends Disposable implements IEditorContribut
9797
return this.showCodeActionList(actions, at, { includeDisabledActions: false, fromLightbulb: false });
9898
}
9999

100+
public hideCodeActions(): void {
101+
this._actionWidgetService.hide();
102+
}
103+
100104
public manualTriggerAtCurrentPosition(
101105
notAvailableMessage: string,
102106
triggerAction: CodeActionTriggerSource,
@@ -126,6 +130,10 @@ export class CodeActionController extends Disposable implements IEditorContribut
126130
}
127131
}
128132

133+
public hideLightBulbWidget(): void {
134+
this._lightBulbWidget.rawValue?.hide();
135+
}
136+
129137
private async update(newState: CodeActionsState.State): Promise<void> {
130138
if (newState.type !== CodeActionsState.Type.Triggered) {
131139
this._lightBulbWidget.rawValue?.hide();

src/vs/workbench/contrib/notebook/browser/view/cellParts/codeCell.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ import { CodeCellRenderTemplate } from 'vs/workbench/contrib/notebook/browser/vi
3030
import { CodeCellViewModel, outputDisplayLimit } from 'vs/workbench/contrib/notebook/browser/viewModel/codeCellViewModel';
3131
import { INotebookExecutionStateService } from 'vs/workbench/contrib/notebook/common/notebookExecutionStateService';
3232
import { WordHighlighterContribution } from 'vs/editor/contrib/wordHighlighter/browser/wordHighlighter';
33+
import { CodeActionController } from 'vs/editor/contrib/codeAction/browser/codeActionController';
3334

3435
export class CodeCell extends Disposable {
3536
private _outputContainerRenderer: CellOutputContainer;
@@ -267,6 +268,8 @@ export class CodeCell extends Disposable {
267268

268269
this._register(this.templateData.editor.onDidBlurEditorWidget(() => {
269270
WordHighlighterContribution.get(this.templateData.editor)?.stopHighlighting();
271+
CodeActionController.get(this.templateData.editor)?.hideCodeActions();
272+
CodeActionController.get(this.templateData.editor)?.hideLightBulbWidget();
270273
}));
271274
this._register(this.templateData.editor.onDidFocusEditorWidget(() => {
272275
WordHighlighterContribution.get(this.templateData.editor)?.restoreViewState(true);

0 commit comments

Comments
 (0)