Skip to content

Commit 4bc97d7

Browse files
committed
Re microsoft#78168 Hover, codeAction
1 parent 580088d commit 4bc97d7

4 files changed

Lines changed: 15 additions & 10 deletions

File tree

src/vs/editor/contrib/codeAction/test/codeAction.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,8 @@ suite('CodeAction', () => {
5959
command: {
6060
abc: {
6161
command: new class implements modes.Command {
62-
id: '1';
63-
title: 'abc';
62+
id!: '1';
63+
title!: 'abc';
6464
},
6565
title: 'Extract to inner function in function "test"'
6666
}
@@ -69,7 +69,7 @@ suite('CodeAction', () => {
6969
bcd: {
7070
diagnostics: <IMarkerData[]>[],
7171
edit: new class implements modes.WorkspaceEdit {
72-
edits: modes.ResourceTextEdit[];
72+
edits!: modes.ResourceTextEdit[];
7373
},
7474
title: 'abc'
7575
}

src/vs/editor/contrib/hover/hover.ts

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -34,27 +34,27 @@ export class ModesHoverController implements IEditorContribution {
3434
private readonly _toUnhook = new DisposableStore();
3535
private readonly _didChangeConfigurationHandler: IDisposable;
3636

37-
private _contentWidget: ModesContentHoverWidget;
38-
private _glyphWidget: ModesGlyphHoverWidget;
37+
private _contentWidget: ModesContentHoverWidget | null;
38+
private _glyphWidget: ModesGlyphHoverWidget | null;
3939

4040
get contentWidget(): ModesContentHoverWidget {
4141
if (!this._contentWidget) {
4242
this._createHoverWidget();
4343
}
44-
return this._contentWidget;
44+
return this._contentWidget!;
4545
}
4646

4747
get glyphWidget(): ModesGlyphHoverWidget {
4848
if (!this._glyphWidget) {
4949
this._createHoverWidget();
5050
}
51-
return this._glyphWidget;
51+
return this._glyphWidget!;
5252
}
5353

5454
private _isMouseDown: boolean;
5555
private _hoverClicked: boolean;
56-
private _isHoverEnabled: boolean;
57-
private _isHoverSticky: boolean;
56+
private _isHoverEnabled!: boolean;
57+
private _isHoverSticky!: boolean;
5858

5959
static get(editor: ICodeEditor): ModesHoverController {
6060
return editor.getContribution<ModesHoverController>(ModesHoverController.ID);
@@ -69,6 +69,8 @@ export class ModesHoverController implements IEditorContribution {
6969
) {
7070
this._isMouseDown = false;
7171
this._hoverClicked = false;
72+
this._contentWidget = null;
73+
this._glyphWidget = null;
7274

7375
this._hookEvents();
7476

@@ -200,7 +202,7 @@ export class ModesHoverController implements IEditorContribution {
200202
return;
201203
}
202204

203-
this._glyphWidget.hide();
205+
this._glyphWidget!.hide();
204206
this._contentWidget.hide();
205207
}
206208

src/vs/editor/contrib/hover/hoverWidgets.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ export class ContentHoverWidget extends Widget implements editorBrowser.IContent
4242
this._id = id;
4343
this._editor = editor;
4444
this._isVisible = false;
45+
this._stoleFocus = false;
4546

4647
this._containerDomNode = document.createElement('div');
4748
this._containerDomNode.className = 'monaco-editor-hover hidden';

src/vs/editor/contrib/hover/modesContentHover.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -214,6 +214,8 @@ export class ModesContentHoverWidget extends ContentHoverWidget {
214214
this._computer = new ModesContentComputer(this._editor, markerDecorationsService);
215215
this._highlightDecorations = [];
216216
this._isChangingDecorations = false;
217+
this._shouldFocus = false;
218+
this._colorPicker = null;
217219

218220
this._hoverOperation = new HoverOperation(
219221
this._computer,

0 commit comments

Comments
 (0)