Skip to content

Commit 286a0f1

Browse files
committed
fix: accept null in updateCurrentEditor
1 parent 741bb9b commit 286a0f1

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/signature-help-manager.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ export class SignatureHelpManager {
143143
* it has been decided to track this instance
144144
* @param editor the Atom Text editor instance to be tracked
145145
*/
146-
updateCurrentEditor(editor: TextEditor) {
146+
updateCurrentEditor(editor: TextEditor | null) {
147147
if (editor === this.editor) {
148148
return
149149
}
@@ -157,7 +157,7 @@ export class SignatureHelpManager {
157157
this.editor = null
158158
this.editorView = null
159159

160-
if (!atom.workspace.isTextEditor(editor)) {
160+
if (!editor || !atom.workspace.isTextEditor(editor)) {
161161
return
162162
}
163163

@@ -306,6 +306,7 @@ export class SignatureHelpManager {
306306
}
307307
const hight = view.element.getBoundingClientRect().height
308308
const lineHight = editor.getLineHeightInPixels()
309+
//@ts-ignore internal type
309310
const availableHight = (position.row - editor.getFirstVisibleScreenRow()) * lineHight
310311
if (hight < availableHight + 80) {
311312
overlay.style.transform = `translateY(-${lineHight + hight}px)`

0 commit comments

Comments
 (0)